Skip to content

Update CobotMagic default safe margin#235

Merged
matafela merged 3 commits into
mainfrom
cj/update-cobot-magic-default-safe-margin
Apr 16, 2026
Merged

Update CobotMagic default safe margin#235
matafela merged 3 commits into
mainfrom
cj/update-cobot-magic-default-safe-margin

Conversation

@matafela
Copy link
Copy Markdown
Collaborator

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

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I have run the black . command to format the code base.
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • Dependencies have been updated, if applicable.

@matafela matafela requested review from Copilot and yuecideng and removed request for Copilot April 16, 2026 07:38
Copilot AI review requested due to automatic review settings April 16, 2026 07:57
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_margin default from (in radians) to 0.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.

Comment on lines 75 to +76
# 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
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
),
safe_margin=5.0 * np.pi / 180.0,
)
),
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
safe_margin=5.0 * np.pi / 180.0,
)
),
},
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
@matafela matafela merged commit d52ea77 into main Apr 16, 2026
3 of 4 checks passed
@matafela matafela deleted the cj/update-cobot-magic-default-safe-margin branch April 16, 2026 08:08
chase6305 pushed a commit that referenced this pull request Apr 16, 2026
Co-authored-by: chenjian <chenjian@dexforce.com>
yangchen73 pushed a commit that referenced this pull request Apr 16, 2026
Co-authored-by: chenjian <chenjian@dexforce.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants