gz-sim
gz-sim copied to clipboard
Detachable joint: support for nested models of the same name
🦟 Bug fix
Fixes #<NUMBER>
Summary
Not sure if this is a bugfix or a feature tbh. Currently, if we are loading multiple models with child models that have the same name, the detachable joint will pick the wrong one. This is because given the current logic we only check for a child model by name. My understanding is that we wrote this plugin so we can detach sibling models.
The proposed fix in this PR is that if there are multiple models with a similar name, the system will look for the model which is a child of the parent model. This is by no means the best solution, as I do not handle grandchildren or the case where there are multiple children of the same name but it is a solution. Would be happy to have other suggestions as to how I should handle this.
Checklist
- [x] Signed all commits for DCO
- [x] Added tests
- [ ] Updated documentation (as needed)
- [ ] Updated migration guide (as needed)
- [x]
codecheck
passed (See contributing) - [ ] All tests passed (See test coverage)
- [ ] While waiting for a review on your PR, please help review another open pull request to support the maintainers
Note to maintainers: Remember to use Squash-Merge
Codecov Report
Merging #1097 (a4cd125) into ign-gazebo6 (97f2e9c) will increase coverage by
0.01%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## ign-gazebo6 #1097 +/- ##
===============================================
+ Coverage 61.88% 61.89% +0.01%
===============================================
Files 274 274
Lines 22441 22447 +6
===============================================
+ Hits 13887 13893 +6
Misses 8554 8554
Impacted Files | Coverage Δ | |
---|---|---|
src/systems/detachable_joint/DetachableJoint.cc | 72.50% <100.00%> (+2.22%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 97f2e9c...a4cd125. Read the comment docs.
Removing beta
label. Let me know if you're planning to get this in before Harmonic is released.
I'll address this after the code freeze.