Open
Conversation
added 3 commits
February 28, 2026 11:12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request introduces a new whole‑body inverse kinematics solver,
WholeBodyIKSolver, and integrates it into the existing simulation framework alongside the existingPinocchioSolverandSRSSolver.Summary of changes
WholeBodyIKSolverCfgandWholeBodyIKSolverthat build a reduced Pinocchio model keeping torso + single arm joints active, use Damped Least Squares (DLS) in task space, and add null‑space secondary objectives (joint regularization, smoothness, leg / torso stability) to resolve redundancy in a physically reasonable way.end_link_name,root_link_name,tcp,joint_namesfields fromSolverCfg/PinocchioSolverCfg, keepingget_ik(target_xpos, qpos_seed, qvel_seed=None, return_all_solutions=False, **kwargs)andget_fk(qpos, **kwargs)signatures compatible with other solvers, and integrating viaRobot.init_solverandRobot.compute_ik/compute_fkusing control parts such as"left_arm_body"/"right_arm_body".DexforceW1Cfg._build_default_solver_cfgto define"left_arm_body"/"right_arm_body"solvers usingWholeBodyIKSolverCfg, and relying on control parts to supplyjoint_names(torso + corresponding arm) so configuration stays consistent with other solvers.examples/sim/solvers/whole_body_ik_solver.pyshowing how to callrobot.compute_fk/robot.compute_ikwith whole‑body IK;scripts/visualize_whole_body_ik.py/scripts/visualize_whole_body_ik_robot.pyfor interactive visualization; a new conceptual overview indocs/source/overview/sim/solvers/whole_body_ik_solver.md; and a short comparison notedocs/source/overview/sim/solvers/whole_body_ik_vs_pinocchio.mdexplaining how this solver differs fromPinocchioSolver.Motivation and rationale
The existing
PinocchioSolveris designed as a single‑chain DLS solver for manipulators where the number of joints is close to the 6‑DOF task space (non‑redundant or only lightly redundant). Its core update is (\Delta q = J^\dagger e), where (J \in \mathbb{R}^{6 \times n}) is the Jacobian and (e \in \mathbb{R}^6) is the pose error. This works well for arms, but is not sufficient for whole‑body IK on W1:WholeBodyIKSolveraddresses this by building a reduced whole‑body model (torso + arm) viabuildReducedRobot, computing a primary DLS step in task space, and adding a null‑space secondary step:[
\Delta q = J^\dagger e - (I - J^\dagger J),\nabla E_{\text{sec}},
]
where
E_secencodes joint regularization (keep joints near 0 or another neutral posture), smoothness (stay close to the seed configuration), and leg / torso stability (viaLegCostCfgover linear combinations of joints).This design keeps the external API aligned with
PinocchioSolver, but separates the implementation so that existing users ofPinocchioSolverare not affected by whole‑body specific behavior or parameters, and whole‑body IK users have clear, explicit controls for redundancy resolution (standing posture, smoothness, etc.).Why a new class instead of extending
PinocchioSolver?Conceptually, the null‑space and leg‑stability logic could be implemented inside
PinocchioSolver, but this would significantly blur its responsibilities: it would have to support both “simple arm DLS” and “whole‑body redundant IK” modes in a single class, with many conditional code paths; configuration semantics would diverge (some parameters only meaningful for whole‑body IK), making the solver harder to understand and tune; enabling new behavior by default risks changing the behaviour of existing arms‑only applications.By introducing
WholeBodyIKSolveras a separate class that reuses the same configuration surface (end_link_name,root_link_name,tcp,joint_names) and plugs intoRobotin the same way as other solvers, we keep the public API unified while allowing the internal implementation to specialize for redundant whole‑body control.