RobotLocomotion / drake

Model-based design and verification for robotics.
https://drake.mit.edu
Other
3.35k stars 1.27k forks source link

[multibody] Allow reversed weld joints #22122

Closed sherm1 closed 1 week ago

sherm1 commented 3 weeks ago

When building the tree-structured model for a system of rigid bodies and joints, it is possible that the inboard/outboard sense of the underlying mobilizer will have to be reversed from the parent/child ordering of the joint it models. MultibodyPlant currently forbids that; this PR relaxes that restriction for Weld joints, which are the most common case we see where reversal is needed.

Fixes #13040


This change is Reviewable

jwnimmer-tri commented 3 weeks ago

I can't actually review this, but it seems like about what I was looking for.

In my particular use case, there was actually a somewhat long chain of FixedOffsetFrame instances between the world body and my welded body, and the unit test seems to use the weld between body frames (not offset frames). I imagine that doesn't matter much, but anyway if you want a more representative use case you could demonstrate using a reversed weld between offset frames.