Install ROS: http://wiki.ros.org/ROS/Installation
This package calculates the pose (extrinsics) of a camera with respect to a fixed frame. The output transform between the camera frame and fixed frame is optionally published on the ROS server, connecting the tf tree. The package expects as input an image and a registered point cloud with the OpenCV asymmetric circle pattern clearly visible in the image.
The asymmetric circle pattern can be taken from https://docs.opencv.org/2.4/_downloads/acircles_pattern.png:
Print this pattern and mount it on a known pose with respect to fixed frame.
Considering this example image of the asymmetric circle pattern of width 4 and height 11:
The tf from calibration tag to the fixed frame should be published on the ROS server. One way to do this is by supplying this as a link in the URDF and bringing the tf's of the URDF to the ROS server. Alternatively, this tf can be published by a static transform publisher.
Three services are provided, choose whatever service you need: All three of them perform the same processing for calibration. They differ only in the way the image and point cloud is passed.
Configuration parameters are given in the service call request:
tag_frame
: Name of the asymmetric circle frame on the ROS servertarget_frame
: Tf frame to connect camera topoint_cloud_scale_x
: Optional scale factor between image and point cloud (default 1)point_cloud_scale_y
: Optional scale factor between image and point cloud (default 1)pattern
: Pattern msg type with distance and size of the asymmetric circles pattern, more details explained here: Pattern msg.The detection of the asymmetric circle pattern will commence after calling the service. The pose of the camera to the fixed frame will then be returned and optionally published.
The patternParametersMsg
contains the following fields:
pattern_width
and pattern_height
: The number of circles in horizontal and vertical direction, as defined by OpenCV: https://docs.opencv.org/3.0-beta/doc/tutorials/calib3d/camera_calibration/camera_calibration.htmlpattern_distance
: The circle center-to-center distance of the printed pattern.neighbor_distance
: Optional averaging of point cloud's (x, y, z) values within certain distance in pixelsvalid_pattern_ratio_threshold
: Optional acceptance threshold for the ratio of valid points to point cloud's NaN values