Update CobotMagic default safe margin#235
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the OPW IK “safe margin” used for joint-limit filtering to reduce IK failures near joint limits, specifically for the CobotMagic robot configuration.
Changes:
- Change
OPWSolverCfg.safe_margindefault from5°(in radians) to0.0. - Update CobotMagic left/right arm solver configs to use
safe_margin=0.0.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
embodichain/lab/sim/solvers/opw_solver.py |
Changes the global OPW solver configuration default joint-limit safe margin. |
embodichain/lab/sim/robots/cobotmagic.py |
Sets CobotMagic left/right arm OPW solver safe margin to zero. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # safe margin for joint limits, in radians | ||
| safe_margin: float = 5.0 * np.pi / 180.0 | ||
| safe_margin: float = 0.0 # 5.0 * np.pi / 180.0 |
There was a problem hiding this comment.
This change updates the global OPWSolverCfg default safe_margin from 5° to 0, which affects any OPWSolver user—not just CobotMagic. If the intent is only to adjust CobotMagic defaults (per PR title/description), keep OPWSolverCfg’s default at 5° and override it in cobotmagic.py instead; otherwise, please update the PR description/title and remove the stale commented-out previous value.
| ), | ||
| safe_margin=5.0 * np.pi / 180.0, | ||
| ) | ||
| ), |
There was a problem hiding this comment.
safe_margin is documented/used in radians; setting it to a bare 0.0 works but makes the unit ambiguous compared to the previous 5.0 * np.pi / 180.0. Consider expressing this as 0.0 * np.pi / 180.0 or adding a short inline comment like # 0 deg to keep the unit intent clear.
| safe_margin=5.0 * np.pi / 180.0, | ||
| ) | ||
| ), | ||
| }, |
There was a problem hiding this comment.
safe_margin is documented/used in radians; setting it to a bare 0.0 works but makes the unit ambiguous compared to the previous 5.0 * np.pi / 180.0. Consider expressing this as 0.0 * np.pi / 180.0 or adding a short inline comment like # 0 deg to keep the unit intent clear.
Co-authored-by: chenjian <chenjian@dexforce.com>
Co-authored-by: chenjian <chenjian@dexforce.com>
Description
Update CobotMagic default safe margin:
5.0 degrees->0 degrees, in order to avoid ik failed near joint limits.Fixes # (issue)
Type of change
Checklist
black .command to format the code base.