Use FEP as the default Franka IK solver - #687
Conversation
Enable redundancy search for the Franka arm preset, exercise that preset in the FEP circle demo, and cover the default Robot IK binding. Update solver context to match.
|
|
|
||
| self.solver_cfg = { | ||
| "arm": PytorchSolverCfg( | ||
| "arm": FEPSolverCfg( |
There was a problem hiding this comment.
Existing solver overrides prevent startup
An existing Franka configuration can override just the former default solver’s num_samples, for example with FrankaPandaCfg.from_dict({"solver_cfg": {"arm": {"num_samples": 8}}}). Partial overrides are applied to the default solver object, so this now sets num_samples on FEPSolverCfg. FEP rejects that setting when the robot initializes its solver, preventing the robot from starting. Please preserve compatibility for these overrides or provide a migration path.
Prompt To Fix With AI
This is a comment left during a code review.
Path: embodichain/lab/sim/robots/franka_panda.py
Line: 131
Comment:
**Existing solver overrides prevent startup**
An existing Franka configuration can override just the former default solver’s `num_samples`, for example with `FrankaPandaCfg.from_dict({"solver_cfg": {"arm": {"num_samples": 8}}})`. Partial overrides are applied to the default solver object, so this now sets `num_samples` on `FEPSolverCfg`. FEP rejects that setting when the robot initializes its solver, preventing the robot from starting. Please preserve compatibility for these overrides or provide a migration path.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Add a Franka-only benchmark mode with shared targets and seeds, warmed CPU/CUDA timing, memory, success, pose accuracy, and speedup reporting.
| "-s", | ||
| nargs="+", | ||
| choices=(*SUPPORTED_SOLVERS, "all"), | ||
| choices=(*SUPPORTED_SOLVERS, "franka", "all"), |
There was a problem hiding this comment.
Franka benchmark option is rejected
The new franka selection cannot run through the documented embodichain benchmark robotics-kinematic-solver -s franka command. That command first parses --solvers in scripts/benchmark/__main__.py, where the choices still exclude franka. Argparse therefore rejects the command before the new comparison runs. Add the option to that parser too.
Prompt To Fix With AI
This is a comment left during a code review.
Path: scripts/benchmark/robotics/kinematic_solver/run_benchmark.py
Line: 81
Comment:
**Franka benchmark option is rejected**
The new `franka` selection cannot run through the documented `embodichain benchmark robotics-kinematic-solver -s franka` command. That command first parses `--solvers` in `scripts/benchmark/__main__.py`, where the choices still exclude `franka`. Argparse therefore rejects the command before the new comparison runs. Add the option to that parser too.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Description
Make
FEPSolverCfg(redundancy_search=True)the default inverse kinematics solver for the Franka Panda arm. FEP's fixed-q7 mode can reject reachable poses when the supplied seed q7 is unsuitable, so the preset enables adaptive redundancy search.Update the existing Franka FEP circle demo to use the robot preset instead of replacing its solver. The demo retains its 0.04 rad command-step bound and accepts the previous
--redundancy-searchoption for compatibility. Update the Robot IK integration test and project solver context.Add an explicit
--solvers frankamode to the unified kinematic benchmark. It compares the new Franka FEP preset with the former Pytorch preset (num_samples=30, maximum 500 iterations) on identical URDF, target poses, joint seeds, joint limits, and device. It reports warmed median batch latency, memory, success rate, FK pose error, and speedup. The existing defaultallbenchmark scope is unchanged.Dependencies: none. No issue is linked.
Type of change
Benchmark result
Command:
python -m scripts.benchmark.robotics.kinematic_solver.run_benchmark --solvers frankaHardware: AMD Ryzen 9 9950X, NVIDIA GeForce RTX 5090; PyTorch 2.7.1+cu128. Each latency is the median of five synchronized warmed calls. All cases below had 100% IK success for both solvers. Times are milliseconds per whole batch; speedup is Pytorch time divided by FEP time.
For the 64-target central workload, mean translation error was 0.000072 mm (FEP) versus 0.146476 mm (Pytorch) on CPU, and 0.000070 mm versus 0.144063 mm on CUDA. The generated report also includes the 16-target case, rotation errors, memory, and a leaderboard. These figures describe this machine and the scripted workloads; they do not include solver construction or Warp compilation time.
Validation
black .— 1135 files unchanged after final formatting.python docs/scripts/check_api_docs.py— 2270/2270 exports documented.python .agents/skills/project-dev-context/scripts/context.py check— passed.pytest -q tests/sim/motion/solvers/test_fep_solver.py tests/sim/objects/test_robot_cfg.py tests/sim/objects/test_dual_arm.py— 160 passed, 61 skipped under default pytest markers.--headless --device cpu --max-steps 301— completed 301 targets; maximum IK position error 0.0002 mm; maximum joint step 0.0373 rad.Checklist
black .to format the code base.