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
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)| Skill | Returns | Description |
|---|---|---|
save_eye_to_hand_result(output_path, *, base_T_camera, ...) | Path | Write 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) | dict | Read an eye_to_hand.json file (or the one inside a directory). |
All parameters after output_path are keyword-only:
| Parameter | Type | Description |
|---|---|---|
output_path | str | Path | File path, or a directory to write eye_to_hand.json into. |
base_T_camera | (4, 4) ndarray | Camera optical frame in the robot base frame. |
tcp_T_target | (4, 4) ndarray | None | Board frame in the TCP (or flange) frame. |
method | str | None | Hand-eye method used, e.g. "TSAI". |
num_frames_used | int | None | Frames used in the solve. |
num_frames_total | int | None | Frames captured. |
intrinsic_matrix | (3, 3) ndarray | None | Camera matrix the transform was solved with. |
distortion_coefficients | ndarray | None | Distortion coefficients. |
reprojection_error | float | None | Intrinsic RMS reprojection error (px). |
consistency_mean_translation_m | float | None | Mean TargetConsistencyStats translation deviation. |
consistency_mean_rotation_deg | float | None | Mean 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
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):
{
"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.