Skip to content

Eye-to-Hand Result ​

SUMMARY

Write and read an eye_to_hand.json result file: the static camera's base_T_camera, the board's tcp_T_target, and the intrinsics, reprojection error and consistency they were obtained with. See EyeToHandCalibrator.

UNITS

base_T_camera and tcp_T_target are (4, 4) SE(3) matrices with translation in meters. base_T_camera is the pose of the camera optical frame (x right, y down, z forward) in the robot base frame. The reprojection error is RMS in pixels; consistency values are in meters and degrees.

The Skill ​

python
path = io.save_eye_to_hand_result(
    output_path,
    base_T_camera=base_T_camera,
    tcp_T_target=None,
    method=None,
    num_frames_used=None,
    num_frames_total=None,
    intrinsic_matrix=None,
    distortion_coefficients=None,
    reprojection_error=None,
    consistency_mean_translation_m=None,
    consistency_mean_rotation_deg=None,
)
fields = io.load_eye_to_hand_result(input_path)
SkillReturnsDescription
save_eye_to_hand_result(output_path, *, base_T_camera, ...)PathWrite an eye_to_hand.json result file. If output_path is a directory (or has no extension), writes <output_path>/eye_to_hand.json. Returns the file written.
load_eye_to_hand_result(input_path)dictRead an eye_to_hand.json file (or the one inside a directory).

All parameters after output_path are keyword-only:

ParameterTypeDescription
output_pathstr | PathFile path, or a directory to write eye_to_hand.json into.
base_T_camera(4, 4) ndarrayCamera optical frame in the robot base frame.
tcp_T_target(4, 4) ndarray | NoneBoard frame in the TCP (or flange) frame.
methodstr | NoneHand-eye method used, e.g. "TSAI".
num_frames_usedint | NoneFrames used in the solve.
num_frames_totalint | NoneFrames captured.
intrinsic_matrix(3, 3) ndarray | NoneCamera matrix the transform was solved with.
distortion_coefficientsndarray | NoneDistortion coefficients.
reprojection_errorfloat | NoneIntrinsic RMS reprojection error (px).
consistency_mean_translation_mfloat | NoneMean TargetConsistencyStats translation deviation.
consistency_mean_rotation_degfloat | NoneMean TargetConsistencyStats rotation deviation.

load_eye_to_hand_result() returns a dict with the same keys. Missing entries come back as None.

EyeToHandCalibrator.calibrate(..., output_path=...) writes this file for you after a successful solve.

The Code ​

python
from telekinesis.axon import EyeToHandCalibrator, io

result = calibrator.calibrate(robot_T_tcp_list, image_list, output_path="calibrations/")

fields = io.load_eye_to_hand_result("calibrations/")
base_T_camera = fields["base_T_camera"]
K = fields["intrinsic_matrix"]

Output (calibrations/eye_to_hand.json):

json
{
  "method": "TSAI",
  "num_frames_used": 30,
  "num_frames_total": 30,
  "base_T_camera": [[...], [...], [...], [0.0, 0.0, 0.0, 1.0]],
  "tcp_T_target": [[...], [...], [...], [0.0, 0.0, 0.0, 1.0]],
  "transform_convention": "base_T_camera is the pose of the camera optical frame (OpenCV: x right, y down, z forward) in the robot base frame; it maps camera-frame points into the base frame. tcp_T_target is the pose of the target frame in the frame the robot poses referred to (TCP or flange). Translations are in meters.",
  "intrinsic_matrix": [[fx, 0, cx], [0, fy, cy], [0, 0, 1]],
  "distortion_coefficients": [k1, k2, p1, p2, k3],
  "reprojection_error_px": 0.12,
  "consistency_mean_translation_m": 0.0002,
  "consistency_mean_rotation_deg": 0.02
}

transform_convention is written for human readers and ignored on load. null marks a missing entry.