misc/ik_benchmark/ik_backends.py compares manipulation IK backends (Pink, RoboPlan
OInK, and any future KinematicsSpec implementation) on representative DimOS
workloads: latency, convergence reliability, solution accuracy, and coarse
resource usage, across supported robot configurations.
How it works
- Scenarios are drawn from
SCENARIOS— one or more robots sharing a world (currentlyxarm6,xarm7, anddual_xarm6, a two-arm setup mirroring thedual-xarm6-planner-coordinatorblueprint). Multi-robot scenarios are solved as joint multi-targetsolve_pose_targetscalls. Each backend run builds its own freshRoboPlanWorld— no shared mutable scene between backends. - Targets are sampled by drawing joint configurations uniformly within limits for every robot, keeping only scene-wide collision-free ones, and mapping them through the world’s FK. Every target is reachable by construction, so failures measure solver behavior rather than unreachable goals.
- Fairness: all backends solve identical targets with an equivalent seed
joint state,
check_collision=True, and the samemax_attempts. - Latency is
time.perf_counteraroundKinematicsSpec.solve, after warmup solves are discarded. - Accuracy: every successful solution is independently re-verified by
pushing it through the world’s FK and scoring against the target with
compute_pose_error— the same metric for every backend. - Resource usage: coarse current-RSS delta (
/proc/self/statm) across each backend’s measured window; model construction happens during warmup.
Running
--scenario / --solver (repeatable), --samples, --warmup,
--max-attempts, --pink-max-iterations, --seed, --output.
Requires the xarm_description LFS data (fetched automatically by
get_data("xarm_description")).
Extending
- New scenario: add a
ScenarioSpectoSCENARIOS— a name plus a factory returning theRobotModelConfiglist for one world (one entry per arm for multi-robot setups). - New backend: add a
SolverSpecto_solver_registry()— a name plus a constructor from a freshWorldSpecto aKinematicsSpec. Backends that are world-agnostic (like Pink) may ignore the world; world-native backends (like OInK) take it as their solver.
