Conversation
Greptile SummaryThis PR introduces eye-in-hand visual servoing using ArUco markers: a new
Confidence Score: 4/5Safe to merge the tracking/blueprint code; the calibration tool has two P1 issues that should be resolved before it is used on hardware. The ArucoTracker module and blueprints are well-structured and follow the existing architecture. However, calibrate_hand_eye.py has two P1 findings: a likely mm/meter unit mismatch that would silently corrupt the calibration result, and calls to XArmAdapter methods that don't exist in the repository. Both would cause incorrect or crashing behavior when the calibration tool is run against real hardware. dimos/manipulation/dynamic_tracking/calibrate_hand_eye.py — unit mismatch and unverified adapter API methods. Important Files Changed
Sequence DiagramsequenceDiagram
participant RS as RealSenseCamera
participant AT as ArucoTracker
participant TF as TF Tree
participant CC as ControlCoordinator
participant HW as Hardware (mock/xArm6)
RS->>AT: color_image (LCM)
RS->>AT: camera_info (LCM)
AT->>AT: detectMarkers() + estimatePoseSingleMarkers()
AT->>TF: publish camera_optical_frame → aruco_avg
AT->>TF: lookup base_link → aruco_avg
TF-->>AT: aruco_wrt_base
AT->>AT: apply reach_offset + min_move filter
AT->>CC: cartesian_command PoseStamped (LCM)
AT->>RS: annotated_image (LCM)
CC->>CC: CartesianIKTask (Pinocchio IK)
CC->>HW: joint commands
CC->>TF: publish joint_state FK (base_link → ee_link)
|
|
|
||
| # ========================================================================= | ||
| # Visual servo |
There was a problem hiding this comment.
estimatePoseSingleMarkers is deprecated in OpenCV 4.7+
cv2.aruco.estimatePoseSingleMarkers was deprecated in OpenCV 4.7 and its use generates DeprecationWarning on newer builds; some CI environments treat warnings as errors. The same applies to line 738 of calibrate_hand_eye.py. The recommended replacement is to call cv2.solvePnP directly using the marker corners and the known 3D object points of the marker.
Files Created
dimos/manipulation/dynamic_tracking/__init__.pyPackage init.
dimos/manipulation/dynamic_tracking/aruco_tracker.pyArUco marker tracker module — completely rewritten for main's architecture:
In[Image](color) andIn[CameraInfo](intrinsics) from RealSensecamera_optical_frame → aruco_avgtransform to TF treePoseStampedonOut[cartesian_command]PoseStamped.frame_idis set to the CartesianIKTask name, so the coordinator routes it correctlydimos/manipulation/dynamic_tracking/calibrate_hand_eye.pyEye-in-hand calibration tool:
cv2.calibrateHandEye()(5 methods available)load_calibration()andcalibration_to_transform()helpers for blueprint usedimos/manipulation/dynamic_tracking/blueprints.pyThree visual servoing blueprints:
aruco_tracker_realsensedimos run aruco-trackeraruco_servo_mockdimos run aruco-servo-mockaruco_servo_xarm6dimos run aruco-servo-xarm6Each wires:
RealSenseCamera→ArucoTracker→PoseStamped→ControlCoordinator(withCartesianIKTaskusing Pinocchio IK viaLfsPath("xarm_description/urdf/xarm6/xarm6.urdf"))Files Modified
dimos/robot/all_blueprints.pyAdded 3 new blueprint entries:
aruco-servo-mock,aruco-servo-xarm6,aruco-trackerTF Tree (Full Chain)
Architecture Decision
Rather than rebasing the 25-commit
ruthwik_dynamic_trackingbranch (which was 216 commits behind main and referenced a completely differentControlOrchestratorAPI), I ported thecore concepts onto a fresh branch from main. Main has evolved significantly —
ControlOrchestrator→ControlCoordinator, newCartesianIKTaskwith built-in Pinocchio IK. The new implementation is ~50% less code because it leveragesCartesianIKTaskrather than doing IK internally.One-line Test Command
Gradual Testing
Just verify the code loads without errors in your dimos environment:
python3 -c "from dimos.manipulation.dynamic_tracking.aruco_tracker import ArucoTracker; print('OK')"
python3 -c "from dimos.manipulation.dynamic_tracking.blueprints import aruco_servo_mock; print('OK')"
dimos run aruco-tracker
This runs detection only — verifies ArUco markers are detected and TF transforms are published. You'll need ArUco markers (DICT_4X4_50, 15mm) visible to the camera. Check the Rerun
viewer for annotated images and TF frames.
dimos run aruco-servo-mock
Real camera + mock arm. Verifies the full pipeline: detection → TF lookup → PoseStamped → CartesianIKTask. The mock arm won't move physically but you can watch joint state changes in
Rerun or on the /coordinator/joint_state LCM topic.
dimos run aruco-servo-xarm6
Real camera + real arm.