Conversation
Greptile SummaryThis PR adds unit tests for Confidence Score: 5/5Safe to merge — all remaining findings are P2 test quality improvements, not correctness blockers. The PR is test-only. Both P2 findings (missing _init_joints in _make_module() and the weak norm-only quaternion assertion) are quality/fragility concerns rather than defects in the tests that exist today. No production code is changed. No files require special attention.
|
| Filename | Overview |
|---|---|
| dimos/manipulation/test_manipulation_unit.py | New unit tests for ManipulationModule covering state machine, robot selection, joint-name translation, execute, and the critical _on_joint_state routing; generally sound but _make_module() omits _init_joints initialization, leaving tests one refactor away from an AttributeError. |
| dimos/manipulation/test_pick_and_place_unit.py | New unit tests for PickAndPlaceModule covering object lookup, occlusion-offset math, grasp orientation, and place_back guard; the grasp-orientation near-object test only checks quaternion norm (always ~1), not the actual top-down orientation. |
Sequence Diagram
sequenceDiagram
participant Driver as JointState Driver
participant MM as ManipulationModule
participant Monitor as WorldMonitor
Driver->>MM: _on_joint_state(aggregated_msg)
MM->>MM: Build name-to-index map
loop For each robot
MM->>MM: get_coordinator_joint_names()
alt All joints present
MM->>MM: Extract sub-positions and sub-velocities
MM->>Monitor: on_joint_state(sub_msg, robot_id)
MM->>MM: Capture _init_joints on first call
else Missing joints
MM->>MM: Log warning and skip robot
end
end
Comments Outside Diff (1)
-
dimos/manipulation/test_manipulation_unit.py, line 89-103 (link)_make_module()missing_init_jointsinitialization_on_joint_stateunconditionally readsself._init_joints(line 286 ofmanipulation_module.py) after the earlyif self._world_monitor is None: returnguard. Any future test that uses_make_module()directly (instead of_make_module_with_monitor) and calls_on_joint_statewith a non-Noneworld monitor will hitAttributeError: 'ManipulationModule' object has no attribute '_init_joints'._make_module_with_monitoradds this attribute, but the base helper does not.
Reviews (1): Last reviewed commit: "deleted unnecessary robot config test" | Re-trigger Greptile
ae279fb to
4e1c032
Compare
…ong ids are a match
4e1c032 to
1fae3a1
Compare
Problem
The manipulation module used a single flat joint namespace which broke when multiple robots were connected — joint names collided and state updates routed to the wrong robot. Blueprint configs also had redundant
or Nonepatterns, anddrake_world.pyhad dead code left over from a removed model cache.Solution
Added unit tests for the two most critical pieces of new logic:
_on_joint_state: routing, splitting, missing-joint handling, init capture, multi-robot correctnessPickAndPlaceModuleheuristics: object detection lookup, occlusion offset math, grasp orientation, place_back guardBreaking Changes
joint_name_mappingonRobotModelConfignow uses/as the prefix separator (e.g.left/joint1instead ofleft_joint1). Existing blueprints in this repo are already updated. External code that constructsRobotModelConfigwith customjoint_name_mappingdicts needs to adopt the new convention.How to Test
pytest dimos/manipulation/test_manipulation_unit.py dimos/manipulation/test_pick_and_place_unit.py -vpytest dimos/manipulation/ -v