feat: pink ik adapter for manipulation module#2481
Conversation
Greptile SummaryThis PR adds a Pink-based differential IK solver as a new
Confidence Score: 5/5Safe to merge — all new code is additive, the previous review issues were both resolved, and the change is guarded behind an opt-in config field. The Pink IK backend follows the existing KinematicsSpec contract precisely, the JOINT_LIMITS early-return and wrong install-hint bugs called out in prior review are both fixed, the new solve_ik RPC properly resets module state on every exit path, and the discriminated-union config is backward-compatible with the deprecated kinematics_name string. Unit tests cover the retry loop, collision rejection, and dependency error messaging. No files require special attention. The new pink_ik.py is the most complex file but it is fully unit-tested. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[ManipulationModule.solve_ik / plan_to_pose] --> B{kinematics_name set?}
B -- yes --> C[kinematics_config_from_name]
B -- no --> D[use config.kinematics]
C --> E[create_kinematics factory]
D --> E
E --> F{config type?}
F -- JacobianKinematicsConfig --> G[JacobianIK.solve]
F -- DrakeOptimizationKinematicsConfig --> H[DrakeOptimizationIK.solve]
F -- PinkKinematicsConfig --> I[PinkIK.solve]
I --> J[_get_robot_context pinocchio model + frame + mapping]
J --> K{attempt loop max_attempts}
K -- attempt 0 --> L[seed q from JointState]
K -- attempt 1..N --> M[random q from joint limits]
L --> N[_solve_single pink.solve_ik iterations]
M --> N
N -- SUCCESS --> O{collision check?}
O -- free --> P[return IKResult SUCCESS]
O -- collision --> Q[fallback = COLLISION continue]
N -- JOINT_LIMITS --> R[fallback = JOINT_LIMITS continue]
N -- NO_SOLUTION --> S[fallback = NO_SOLUTION continue]
Q --> K
R --> K
S --> K
K -- exhausted --> T[return fallback or NO_SOLUTION]
Reviews (3): Last reviewed commit: "feat: expose kinematics backend config" | Re-trigger Greptile |
Codecov Report❌ Patch coverage is
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 21 files with indirect coverage changes 🚀 New features to boost your workflow:
|
|
@mustafab0 confirmed that using this for vis ik solving will be much faster than original in-house ik |
|
@mustafab0 can you review again? |
Straight forward IK solver addition trying to resolve current IK speed issue in viser visualizer #2475 . Can be merged independently.
Features
How to Test
uv run dimos run xarm7-planner-coordinator \ -o manipulationmodule.kinematics_name=pink # in a different term uv run python -i -m dimos.manipulation.planning.examples.manipulation_client ik_pose(0.45, 0, 0.25)Contributor License Agreement