fix(rne): don't crash when a joint's kinematic parent is a base-mounted static link - #696
Merged
Merged
Conversation
…ed static link Follow-up to #693: a static link with no joint ancestor at all (rigidly mounted directly on the immovable base, e.g. URDF Panda's panda_link0) is correctly dropped from link_groups -- it contributes no joint torque. But the joint immediately downstream of it still needs to resolve its own *kinematic* parent group for velocity/acceleration propagation, and doing that via a raw list-membership search over link_groups broke once that static link stopped being a member of any group: IndexError on any robot with the same shape as the default Panda(), caught while smoke- testing the previous fix against real models rather than just synthetic test topologies. Reuses group_of_link_idx (already built once for #693's grouping) to resolve a joint's nearest joint ancestor directly, treating "no entry" (no joint ancestor upstream) the same as .parent being None outright, rather than crashing. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
petercorke
deleted the
fix/rne-base-mounted-static-link-parent-lookup
branch
September 19, 2026 12:57
Merged
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #696 +/- ##
=====================================
Coverage 0.00% 0.00%
=====================================
Files 143 143
Lines 14091 14089 -2
=====================================
+ Misses 14091 14089 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Follow-up to #693. While cleaning up the dev conda environment (unrelated
to this fix) and smoke-testing `rne()` against a real model rather than
just synthetic test topologies, hit an `IndexError` on the default
`Panda()`:
```
IndexError: list index out of range
group_idx = [
i for i, group in enumerate(link_groups) if parent_idx in group
][0]
```
Root cause: `panda_link0` is a static base link with no joint ancestor at
all (`isjoint=False`, `parent=None`) -- #693's grouping correctly drops
it from `link_groups` entirely, since it contributes no joint torque
(rigidly fixed to the immovable base). But the first joint's own
`.parent` is that static link, and resolving its upstream kinematic
group via a raw list-membership search over `link_groups` breaks once
that link is (correctly) a member of no group.
Fix
Reuse `group_of_link_idx` (already built once by #693's grouping pass)
to resolve a joint's nearest joint ancestor directly. "No entry" (no
joint ancestor upstream at all) is now treated the same as `.parent`
being `None` outright, rather than crashing.
Verification
confirmed it fails with the exact same `IndexError`; restored the fix
and confirmed it passes.
this exact topology.
previously crashed on this path, both now compute correctly)
🤖 Generated with Claude Code