Repository navigation
feat(robot): add self-collision checks for non-adjacent links - #816
Conversation
Include gripper and nested collision geometry, reject models without collision shapes, and support iscollided(q, robot). Add documentation and 34 regression tests for issue petercorke#723.
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| Security | 24 high |
🟢 Metrics 66 complexity · 0 duplication
Metric Results Complexity 66 Duplication 0
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #816 +/- ##
=====================================
Coverage 0.00% 0.00%
=====================================
Files 146 146
Lines 17168 17212 +44
=====================================
- Misses 17168 17212 +44 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Thank you for the self-collision check, which is a useful feature and well tested. Two requests before it goes in.
There is also a one-line docstring conflict with |
Co-Authored-By: Codex (GPT-6) <noreply@openai.com>
Co-Authored-By: Codex (GPT-6) <noreply@openai.com>
|
Thank you, Peter. Both points are now addressed, and I have merged main and resolved the docstring conflict.
All 44 self-collision tests pass with real Coal, including Panda().isselfcollided(qr) and Frankie().isselfcollided(qr), both False. Five regression cases fail before the fixes and pass afterwards. The broader related suite has 273 passing tests, 4 skips and 4 failures that also reproduce before these fixes; details are in the updated PR description. The Linux-targeted mypy check passes for all 165 modules. Thank you for the concrete examples; they helped make the adjacency rules and scene updates much clearer. |
|
Thank you for these changes to |
Summary
Adds
robot.isselfcollided(q=None, skip=False)to check collision geometry between non-adjacent links, including grippers and nested groups. Passing the robot itself toiscollided(q, robot)(or the deprecatedcollidedalias) now performs this check instead of raising an attribute error or silently returningFalsefor a model without geometry.Shapes on the same link, neighbouring collision-bearing links, and links within the same gripper are excluded. Links without collision geometry are transparent when determining adjacency. Siblings outside a shared gripper, separate branches and different grippers are still checked. Touching counts as collision for the pairs tested. This changes public behaviour by removing false positives across empty spacer links and normal finger contact within a gripper. Models without collision geometry raise
ValueError. Pose updates preserve local geometry transforms and stored joint configurations, and work without the optional RTB C extension. Documentation explains partial geometry coverage andskip=True.Related issue
Fixes #723.
Validation
main; this environment lacks the RTB native extensions. The broader local suite is not fully green.mypy --platform linux: no issues in 165 source files. Default Windows mypy reports six pre-existing POSIX-signal attribute errors insymbolic_ik.py.git diff --checkpass. The changed method adds no Ruff findings; existing unrelated module findings/formatting were left unchanged.mainand resolved the deprecated-alias docstring conflict. Remote CI and other platforms still need to validate the updated branch.Checklist
pytest) — focused feature tests pass; full-suite baseline failures detailed aboveImplementation, documentation, tests and review fixes were developed with OpenAI Codex (GPT-6) assistance.