thanhndv212/figaroh-plus/figaroh-setup-optimal
Claude Code and agent skill by thanhndv212/figaroh-plus
- community
Checking that the SKILL.md file is still in the repository.
Set up and run FIGAROH optimal experiment design — generating well-conditioned measurement configurations for calibration and exciting trajectories for identification. Use when a calibration or identification is badly conditioned, before collecting data on a new robot, or when the user asks about condition number, dexterity, exciting trajectories, or cyipopt/IPOPT.
Install
npx vskill@latest install thanhndv212/figaroh-plus/figaroh-setup-optimalSKILL.md
Set Up an Optimal Experiment Design (OED) Task
_Arguments: robot name, and which you need — measurement configurations (calibration) or an exciting trajectory (identification)._
Paths.$FIGAROH_WSis the workspace root — the directory holding thefigarohandfigaroh-examplesrepos side by side. Set it once per shell:export FIGAROH_WS="$(cd /path/to/your/workspace && pwd)".
Prerequisites: figaroh-setup-env exits 0 and `cyipopt` imports. Optimal trajectory generation is the one task that hard-requires it:
cyipopt is conda-only — it is not pip-installable in practice, and it is the entire reason figaroh-dev exists as a conda env.
Working directory for every command below: $FIGAROH_WS/figaroh-examples/examples/<robot>/.
Run this before collecting data
OED is upstream of the other two tasks. Both a huge calibration residual spread and a huge identification condition number are usually data problems, and the fix is a better experiment, not a different solver. Sequence:
The two sub-tasks
| Sub-task | Script | Produces | Feeds | |
|---|---|---|---|---|
| Optimal configurations | optimal_config.py | A set of static joint configurations that maximise information for geometric calibration | tasks.calibration.data.sample_configurations_file | |
| Optimal trajectory | optimal_trajectory.py | A continuous exciting trajectory (cubic-spline waypoints) for dynamic identification | The motion you execute to log q/tau |
Availability today: ur10 and tiago have both. tiago_pro has generate_optimal_configs.py (a variant entry point). Others have neither — model new ones on examples/ur10/.
Step 1 — Configure optimal configurations
number_of_samplesis the count you will physically measure. More is better
statistically and worse operationally — 30–60 is the usual range for a manipulator.
- `collision_checking: false` is only safe for open workspaces. UR10's config sets
it false because a UR10 in free space rarely self-collides. Any humanoid, mobile manipulator, or robot near fixtures should set it true.
joint_limit_marginkeeps the optimiser from proposing poses the controller will
refuse at the limit.
Step 2 — Configure the optimal trajectory
frequencyhere andidentification.signal_processing.sampling_frequencydescribe
the same experiment. Keep them consistent with how the robot actually logs, or the identification will derive wrong velocities from correct data.
- More
waypointsand longersegment_durationexcite more but take much longer to
solve and to execute.
velocity_scaling/acceleration_scalingat 0.5 is conservative. Raising them
excites inertial terms more strongly — that is exactly what identification needs — but is also where you hit real hardware limits. Raise deliberately.
max_attempts: 500exists because feasibility is not guaranteed; exhausting it
prints a failure rather than raising.
Step 3 — Run
Both accept --config, --urdf, and --verbose/-v only — everything else lives in the YAML. Both exit(1) with a clear message if the URDF or config path is missing.
Budget time for `optimal_trajectory.py`, not for `optimal_config.py`. Both are marked is_slow with a 600 s timeout in validate.py, and --quick skips both, but they are not comparable in practice: optimal_trajectory.py runs IPOPT and takes minutes, while optimal_config.py on UR10 (500 candidates) finished in ~35 s. In validate.py output, an IPOPT timeout is reported separately from a failure and is expected — do not treat it as a regression.
With sample_configurations_file empty, optimal_config.py prints Generating random configurations instead. That is the normal path when you have no candidate pool — a fallback notice, not an error. Set the key to "", never to a bare None: YAML parses None as the string "None", which is then treated as a filename and produces a confusing Unsupported file format: None.
Step 4 — Use the output
optimal_config.py writes a timestamped triple into the directory named by optimal_configuration.output.output_file (only the directory part is used — the filenames are managed), falling back to results/ when that is unset:
The script prints the directory it used; point the calibration config at the YAML:
The selected count is emergent, not requested. Selection is threshold-based on the SOCP weights, so you get however many configurations clear the threshold — a UR10 run selected 70 of 500 candidates. There is no key that fixes the count: the optimal_configuration.parameters block is inert and the shipped configs comment it out. The summary CSV's configuration_count and the count printed to stdout now agree; if they ever diverge, trust the YAML's contents.
A hand-maintained candidate pool works too, and is what TIAGo uses — see data/calibration/optimal_configurations/tiago_calibration_joint_configurations_500_pmb2_hey5.yaml.
Trajectory → identification. Execute it on the robot, log q and tau at the configured frequency, and write them into data/ in the layout that robot's load_trajectory_data() expects (see figaroh-setup-identification, Step 2).
Step 5 — Verify the design actually helped
The point of OED is a number, so check the number:
If the condition number did not improve, the trajectory is not more exciting — raise velocity_scaling/acceleration_scaling or waypoints rather than re-running the same design.
Failure → cause → fix
| Symptom | Cause | Fix | |
|---|---|---|---|
ModuleNotFoundError: cyipopt | pip install attempted, or wrong env | conda install -n figaroh-dev -c conda-forge cyipopt | |
get_backend("pinocchio") → ValueError: not available | backends/ has no Pinocchio backend; Pinocchio is used directly, not via the backend abstraction | Do not route through get_backend — this is a known ARCHITECTURE.md inaccuracy | |
| "Failed to generate optimal trajectory" | Infeasible constraints | Lower velocity_scaling/acceleration_scaling, raise soft_lim, reduce waypoints, raise max_attempts | |
| Runs for 10+ minutes with no output | Normal for IPOPT | Use -v for progress; budget 600 s; validate.py --quick to skip | |
Timeout in validate.py | Expected for IPOPT-heavy scripts | Reported separately from failures — not a bug | |
| Configurations collide on the real robot | collision_checking: false | Set it true and regenerate | |
| Configurations rejected by the controller at limits | joint_limit_margin too small | Raise it and regenerate |
Anything else: Re-run with --verbose/-v for INFO logging and work from the traceback; each repo's AGENTS.md lists the known gotchas.
Related
figaroh-setup-calibration and figaroh-setup-identification consume this skill's output. Speeding up the OED solve, and new objectives or solvers, belong in figaroh/src/figaroh/optimal/.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/figaroh-setup-optimal/SKILL.md
Popularity
- Repository stars
- 61
- Repository forks
- 8
- 7-day trend score
- 21
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/thanhndv212/figaroh-plus/figaroh-setup-optimal)