-
Notifications
You must be signed in to change notification settings - Fork 275
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
Support individual canonical links for nested models #685
Conversation
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Conflicts need to be fixed |
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Done! |
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.
A few minor comments. I haven't looked over the changes in physics.cc
too closely yet since we discussed some modifications that need to be made offline, but once those changes are in, I'll give it a more thorough review.
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
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.
This looks great, thanks! The comments in Physics.cc
about frame semantics/computations are also very helpful. I left a few small comments/questions, but other than that, I think this is ready to go 🚢
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Windows CI is backed up. The previous job (https://build.osrfoundation.org/job/ign_gazebo-pr-win/2399/) built fine, so I'll go ahead and merge this. |
🎉 New feature
Summary
When #258 was added, we discussed a limitation that prevented the poses of nested models (just the model frame) from being updated and left a TODO in the code. This was due to the
CanonicalLink
being a component attached to links and not models. For example, in the following example,nested_model1
andnested_model2
havenested_link1
andnested_link2
as their canonical links respectively. The canonical link oftop_level_model
isnested_link1
. However, since theCanonicalLink
component onnested_link1
doesn't have enough information to indicate that it is the canonical link oftop_level_model
, the physics system has no way of knowing which canonical link to use to updatetop_level_model
. Therefore, in #258, we opted for creating only one canonical link in a model hierarchy. Thus, for this example, onlynested_link1
would have theCanonicalLink
component.And since only one canonical link is created, the poses of other nested models would not get updated.
This PR creates a new component
ModelCanonicalLink
that is attached to models and contains a reference to the link entity that serves as the canonical link of the model. This allows us to update the poses of all models including nested ones. In addition, by updating the model poses first, it addresses the issue discussed here where we have previously assumed that the canonical link's pose update will be handled before the rest of the links in the model since the it is the first link in the model. However, in SDFormat 1.7 and later, the canonical link can be manually specified such that it's not the first link in the model.Finally, this also addresses the comment in #479
Peek.2021-03-16.01-43.mp4
Test it
TODO
Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge