ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The parameters that worked for me with a RealSense R200 and the circles pattern from https://nerian.com/support/resources/patterns/ (printed on US letter size) were:

srv.request.tag_frame = "calibration_circles_frame"; // This is defined in a URDF. It's known.
srv.request.camera_frame = "camera_ee_depth_frame"; // Unknown pose. Find its relation to target_frame
srv.request.target_frame = "base_link"; // This is defined in a URDF. It's fixed

  camera_pose_calibration::PatternParameters circle_pattern;
  circle_pattern.pattern_width = 4; // 4 circles wide
  circle_pattern.pattern_height = 11; // 11 circles long
  circle_pattern.pattern_distance = 0.038; // Distance between circle centers. [m]
  circle_pattern.neighbor_distance = 1; // Expected distance between pixels of image
  circle_pattern.valid_pattern_ratio_threshold = 0.5; // Min. ratio of valid pixels to NaN's
  srv.request.pattern = circle_pattern;

I still had an unexplained 45 degree rotation and a Z-offset, but those were easy enough to correct manually. So it was easier than calibrating by hand, for sure.

The parameters that worked for me with a RealSense R200 and the circles pattern from https://nerian.com/support/resources/patterns/ (printed on US letter size) were:

srv.request.tag_frame = "calibration_circles_frame"; // This is defined in a URDF. It's known.
srv.request.camera_frame = "camera_ee_depth_frame"; // Unknown pose. Find its relation to target_frame
srv.request.target_frame = "base_link"; // This is defined in a URDF. It's fixed

  camera_pose_calibration::PatternParameters circle_pattern;
  circle_pattern.pattern_width = 4; // 4 circles wide
  circle_pattern.pattern_height = 11; // 11 circles long
  circle_pattern.pattern_distance = 0.038; // Distance between circle centers. [m]
  circle_pattern.neighbor_distance = 1; // Expected distance between pixels of image
  circle_pattern.valid_pattern_ratio_threshold = 0.5; // Min. ratio of valid pixels to NaN's
  srv.request.pattern = circle_pattern;

I still had an unexplained 45 degree rotation and a Z-offset, but those were easy enough to correct manually. So it was easier than calibrating by hand, for sure.sure. Also, for the RealSense in particular, notice camera_depth_frame vs. camera_depth_optical_frame.

The parameters that worked for me with a RealSense R200 and the circles pattern from https://nerian.com/support/resources/patterns/ (printed on US letter size) were:

srv.request.tag_frame = "calibration_circles_frame"; // This is defined in a URDF. It's known.
srv.request.camera_frame = "camera_ee_depth_frame"; // Unknown pose. Find its relation to target_frame
srv.request.target_frame = "base_link"; // This is defined in a URDF. It's fixed

  camera_pose_calibration::PatternParameters circle_pattern;
  circle_pattern.pattern_width = 4; // 4 circles wide
  circle_pattern.pattern_height = 11; // 11 circles long
  circle_pattern.pattern_distance = 0.038; // Distance between circle centers. [m]
  circle_pattern.neighbor_distance = 1; // Expected distance between pixels of image
  circle_pattern.valid_pattern_ratio_threshold = 0.5; // Min. ratio of valid pixels to NaN's
  srv.request.pattern = circle_pattern;

I still had an unexplained 45 degree rotation and a Z-offset, but those were easy enough to correct manually. So it was easier than calibrating by hand, for sure. Also, sure.

The RealSense is more tricky than most cameras, I think, because the point cloud is published in the frame camera_depth_optical_frame, which is a child of camera_depth_frame. So camera_depth_frame is what actually needs to be attached to camera_link in the URDF. Maybe this was the cause of the extra rotation -- which I corrected for the RealSense in particular, notice camera_depth_frame vs. camera_depth_optical_frame.with an extra transformation matrix.