Skip to content

Use FEP as the default Franka IK solver - #687

Merged
yuecideng merged 2 commits into
mainfrom
codex/franka-fep-default
Sep 24, 2026
Merged

yuecideng merged 2 commits into
mainfrom
codex/franka-fep-default

Conversation

@yuecideng

@yuecideng yuecideng commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

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-search option for compatibility. Update the Robot IK integration test and project solver context.

Add an explicit --solvers franka mode 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 default all benchmark scope is unchanged.

Dependencies: none. No issue is linked.

Type of change

  • Enhancement (changes the Franka arm's default solver and adds a benchmark)

Benchmark result

Command: python -m scripts.benchmark.robotics.kinematic_solver.run_benchmark --solvers franka

Hardware: 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.

Device Workload Targets FEP search Former Pytorch Speedup
CPU central 1 1.19 20.60 17.28x
CPU central 64 4.73 701.72 148.40x
CPU wide 64 5.33 690.88 129.66x
CPU nearby seed 64 3.14 675.92 215.32x
CUDA central 1 1.44 61.43 42.64x
CUDA central 64 1.58 264.07 167.57x
CUDA wide 64 1.94 259.07 133.63x
CUDA nearby seed 64 1.55 260.31 167.72x

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.
  • Franka FEP demo, --headless --device cpu --max-steps 301 — completed 301 targets; maximum IK position error 0.0002 mm; maximum joint step 0.0373 rad.
  • Franka comparison benchmark completed on CPU and CUDA; its Markdown report contains the required three tables.

Checklist

  • I have run black . to format the code base.
  • I reviewed and updated affected agent context.
  • Public API documentation coverage passes.
  • Tests cover the Franka default Robot IK binding.
  • No dependency changes are needed.

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.
@yuecideng yuecideng added enhancement New feature or request solver Robot kinematics solver robot Module related to robot labels Sep 24, 2026
@greptile-apps

greptile-apps Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 3/5

The PR is not yet safe to merge: the documented command rejects the new comparison, and existing partial Franka solver overrides can still prevent robot startup.

Fix All in CodexFindings

  1. P1 Franka benchmark option is rejected ▶
  2. P1 Existing solver overrides prevent startup ▶
Fix with agent prompt
### Issue 1
scripts/benchmark/robotics/kinematic_solver/run_benchmark.py:81
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.

### Issue 2
embodichain/lab/sim/robots/franka_panda.py:undefined-131
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.

Summary

The PR makes redundancy-search FEP the Franka arm default, updates its demo and integration test, and adds an optional comparison with the former PyTorch solver.

  • The new comparison cannot be selected through the documented benchmark command because its top-level parser has not been updated.
  • The previously reported incompatibility with partial num_samples overrides remains.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A["embodichain benchmark robotics-kinematic-solver -s franka"] --> B["Top-level argparse choices"]
  B -->|franka rejected| C["Argument error"]
  B -->|accepted selection| D["run_all_benchmarks"]
  D --> E["Franka FEP / PyTorch comparison"]
Loading

Reviews (2) · Last reviewed commit: "benchmark(franka): compare FEP and Pytor..."


self.solver_cfg = {
"arm": PytorchSolverCfg(
"arm": FEPSolverCfg(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 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.

Fix in Codex Fix in Claude Code

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"),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 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.

Fix in Codex Fix in Claude Code

@yuecideng
yuecideng merged commit 95df35f into main Sep 24, 2026
9 checks passed
@yuecideng
yuecideng deleted the codex/franka-fep-default branch September 24, 2026 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request robot Module related to robot solver Robot kinematics solver

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant