-
Notifications
You must be signed in to change notification settings - Fork 276
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
Set a cloned joint's parent/child link names to the cloned parent/child link names #1075
Conversation
Signed-off-by: Ashton Larkin <[email protected]>
/// \TODO(anyone) We shouldn't be giving joints special treatment. | ||
/// We should figure out a way to update a joint's parent/child links without | ||
/// having to explicitly search/track for the cloned links. |
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.
There's a similar TODO
note here: https://github.com/ignitionrobotics/ign-gazebo/blob/8f083d6d212c5867cc18cd45162ba3e4807643c4/src/EntityComponentManager.cc#L248-L250
I don't think we have an issue for tracking the idea of "generalizable component cloning" yet, do we? Should we create one?
Detachable joints also contain information about parent and child links. Should we add those as well or state that they're not supported? |
Codecov Report
@@ Coverage Diff @@
## ign-gazebo6 #1075 +/- ##
===============================================
- Coverage 64.09% 64.07% -0.03%
===============================================
Files 255 255
Lines 20002 20051 +49
===============================================
+ Hits 12821 12847 +26
- Misses 7181 7204 +23
Continue to review full report at Codecov.
|
Signed-off-by: Ashton Larkin <[email protected]>
As we discussed offline, adding support for cloning detachable joints would require cloning the I've also created an issue for adding detachable joint cloning support so that we can re-visit this in the future: #1080 |
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.
Just one minor comment.
Signed-off-by: Ashton Larkin <[email protected]>
Signed-off-by: Ashton Larkin [email protected]
🦟 Bug fix
Summary
When a joint is cloned, the cloned joint's parent and child links need to be set to the cloned parent and child links (currently, the cloned joint's parent/child links are the original joint's parent/child links). Otherwise, links will not be connected to joints when cloning things like models that have links and joints.
The approach taken here is similar to the approach taken for updating a cloned canonical link in #959, where internal maps are used to keep track of a joint's original links and cloned links. As discussed in #959 (comment), we shouldn't give special treatment to certain components. This is just a temporary workaround until we find a better solution.
To test this, do the following:
If you repeat the steps above without this PR, you'll notice that the links on the cloned pendulum fall to the ground because the cloned pendulum does not have proper joints:
Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge