-
Notifications
You must be signed in to change notification settings - Fork 310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix chained pofs or sdfs in model #3711
Conversation
…hensive demo with fix
Downstream PR of Binary builds available via Actions |
Not obvious from this screenshot, but the topology here is something like:
Little bit pathological, but the idea is that users might be combining mesh data, landmarks, etc. to build frames dynamically, so the engine needs to handle mixed-, chained-, etc. frames. |
…MobilizedBodyIndex
The implementation was updated to mean that there's now no user-facing API changes at all: what was |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, had to go through some mental transitive loops, but it terminated at an empty extendSetMobilizedBodyIndex()
;)
Was wondering if setMobilizedBodyIndexOf
should be static
?
Looks good to me :)
Thanks @pepbos |
Fixes an issue found during #3694 where chaining
PhysicalOffsetFrame
s orStationDefinedFrame
s does not work.The reason it doesn't work is because the previous implementation does things like
dynamic_cast
ing toPhysicalOffsetFrame
followed by hard-setting its parent'sMobilizedBodyIndex
. That approach doesn't take into account that (e.g.) the parent may, itself, be aPhysicalOffsetFrame
(a correct implementation should also iterate through the whole chain). It also doesn't account for other dependent frame types (e.g.StationDefinedFrame
).To work around this, the following changes were necessary:
PhysicalOffsetFrame
'sextendAddToSystem
to instead set its own body index based on the base frame it's attached to (previously, it would usegetParentFrame
, which doesn't account for chains of frames)PhysicalOffsetFrame
with a new extension member method,extendSetMobilizedBodyIndex
:Frame
implementations transitively set body indices based on what they know about their frame topology (e.g. aPhysicalOffsetFrame
"knows" it has a parent)dynamic_cast
ing toPhysicalOffsetFrame
from joint:setMobilizedBodyIndex
PhysicalOffsetFrame
/StationDefinedFrame
now use the extension point to (e.g.) ensure that theMobilizedBodyIndex
is set on frames that they are transitively attached tosetMobilizedBodyIndex
on each element in the chain, rather than just the parent)API CHANGES (NONE)
setMobilizedBodyIndexis now
public, rather than
protected` (it is still labelled as advanced, though).A new method was added,
setMobilizedBodyIndexOf
, which keeps the existing API backwards-compatible but lets frames set eachovers indices (required)Testing I've completed
StationDefinedFrame
then failedStationDefinedFrame
tests were re-enabled/reversed (as documented)CHANGELOG.md (choose one)
This change is![Reviewable](https://camo.githubusercontent.com/23b05f5fb48215c989e92cc44cf6512512d083132bd3daf689867c8d9d386888/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)