Skip to content

Compare Hand-Eye Methods

SUMMARY

compare_hand_eye_methods re-solves the same dataset with every hand-eye method. Methods that converge to similar poses are jointly trustworthy; an outlier, often DANIILIDIS, indicates a method-specific local optimum rather than a data problem.

SUPPORTED TARGETS

Available only on CharucoTarget, it re-solves an eye-in-hand dataset, which requires per-corner ArUco ids.

UNITS

robot_T_tcp_list, camera_T_target_list, and each result's tcp_T_camera are (4, 4) SE(3) matrices with translation in meters. pose_deg is [x, y, z, rx, ry, rz] with translation in meters and rotation in degrees; consensus_threshold_deg is in degrees.

The Skill

python
results = diagnostics.compare_hand_eye_methods(
    target, robot_T_tcp_list, image_list, camera_T_target_list,
    intrinsic_matrix, distortion_coefficients,
)
print(diagnostics.format_method_comparison(results))
SkillReturnsDescription
compare_hand_eye_methods(target, robot_T_tcp_list, image_list, camera_T_target_list, intrinsic_matrix, distortion_coefficients, per_view_error_threshold=1.0)dict[str, HandEyeMethodResult | None]Re-solves with every method in HAND_EYE_METHOD_BY_NAME_MAP. A None entry marks a method that raised or failed to converge.
format_method_comparison(method_results, consensus_threshold_deg=1.5)strHuman-readable report; flags methods more than consensus_threshold_deg from the consensus pose.
ParameterTypeDescription
targetCharucoTargetCalibration target used for the solve.
robot_T_tcp_listlist[(4, 4) ndarray]Per-frame robot base to TCP transforms.
image_listlist[ndarray]Per-frame BGR images.
camera_T_target_listlist[(4, 4) ndarray]Per-frame target poses.
intrinsic_matrix(3, 3) ndarrayCamera matrix.
distortion_coefficientsndarrayDistortion coefficients.
per_view_error_thresholdfloatPer-view reprojection error cutoff, in pixels. Default 1.0.
consensus_threshold_degfloatRotation difference above which a method is flagged as an outlier, in degrees. Default 1.5, for format_method_comparison().

The Code

python
from telekinesis.axon import diagnostics

HandEyeMethodResult

FieldTypeDescription
method_namestrMethod name, e.g. "TSAI".
tcp_T_camera(4, 4) ndarraySolved transform.
pose_deglist[float][x, y, z, rx, ry, rz], translation in meters and rotation in degrees.

Best Practices

  • A single outlier method doesn't necessarily mean bad data. DANIILIDIS in particular is more prone to converging to a local optimum than the other four; if the remaining methods agree within consensus_threshold_deg, trust the consensus over the outlier rather than the reverse.
  • Re-run after any change to the intrinsics or the target definition. A comparison run against stale intrinsics or a stale target definition will report a misleading consensus.