Skip to content

Fix hand-eye pose matching - #15

Open
Daniel-rmc wants to merge 3 commits into
RealManRobot:mainfrom
Daniel-rmc:daniel_rmc
Open

Fix hand-eye pose matching#15
Daniel-rmc wants to merge 3 commits into
RealManRobot:mainfrom
Daniel-rmc:daniel_rmc

Conversation

@Daniel-rmc

@Daniel-rmc Daniel-rmc commented Apr 16, 2026

Copy link
Copy Markdown

Summary

Fixes #14

This fixes a pose/image pairing bug in compute_in_hand.py and compute_to_hand.py.

Previously, when some checkerboard images failed detection, the scripts appended only successful image observations but still paired them with the first N robot poses from poses.txt. This caused later images to be matched with the wrong robot end-effector poses.

The fix tracks the numeric image id for every successful checkerboard detection and uses that id to select the corresponding line from poses.txt.

Root Cause

For example, if 11.jpg and 12.jpg fail checkerboard detection, the old code pairs:

  • 13.jpg with pose line 11
  • 14.jpg with pose line 12
  • 15.jpg with pose line 13

This produces a wrong hand-eye transform even when the collected data is otherwise valid.

Changes

  • Sort numeric image filenames explicitly.
  • Track successful checkerboard image ids.
  • Match each successful N.jpg with line N in poses.txt.
  • Log skipped images when checkerboard detection fails.
  • Add clearer errors for insufficient detections or missing pose rows.
  • Apply the same fix to both eye-in-hand and eye-to-hand scripts.

Validation

  • python3 -m py_compile compute_in_hand.py compute_to_hand.py
  • Recomputed a right-arm eye-in-hand dataset where 11.jpg and 12.jpg failed detection.
  • The corrected matching reduced fixed-board RMS deviation from about 104.9 mm to about 1.5 mm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]compute_in_hand.py (& compute_to_hand.py) may mismatch images and robot poses when checkerboard detection fails

2 participants