-
Notifications
You must be signed in to change notification settings - Fork 41
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
bullet-featherstone: Support nested models #574
Conversation
Signed-off-by: Shameek Ganguly <[email protected]>
Minor refactor based on #493. Signed-off-by: Steve Peters <[email protected]>
Test for #562. Signed-off-by: Steve Peters <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## gz-physics6 #574 +/- ##
===============================================
+ Coverage 78.52% 79.06% +0.54%
===============================================
Files 140 140
Lines 7670 7950 +280
===============================================
+ Hits 6023 6286 +263
- Misses 1647 1664 +17 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
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.
It's a little weird that the WorldModelAPI
test in world_features.cc passes even though it's not actually creating the joints between //world/model
s. When I load world_joint_test.sdf
in gz sim
with bullet-featherstone, I see the following error messages, which aren't obvious to interpret but do indicate that something is wrong:
[Err] [Physics.cc:1710] Attempting to create a new joint [j1], but the physics engine doesn't support constructing joints at runtime.
[Err] [Physics.cc:1710] Attempting to create a new joint [j2], but the physics engine doesn't support constructing joints at runtime.
I also tried loading the nested_model.sdf
example world from gz-sim
, which I believe is not supported because it has multiple kinematic trees, but it results in a comprehensible error message that is obscured by infinite console spamming:
[Err] [SDFFeatures.cc:534] Multiple subt-trees / floating links detected in a model. This is not supported in bullet-featherstone implementation yet.
[Wrn] [Physics.cc:1285] Cannot create a new link [link_01] because the physics engine plugin does not support link construction during runtime
[Wrn] [Physics.cc:1372] Collision's parent entity [13] not found on link map.
[Err] [Physics.cc:2894] Internal error: link [13] not in entity map
[Err] [Physics.cc:3050] Internal error: entity [13] not in entity map
...
other messages
...
[Err] [Physics.cc:2894] Internal error: link [13] not in entity map
[Err] [Physics.cc:2894] Internal error: link [13] not in entity map
[Err] [Physics.cc:2894] Internal error: link [13] not in entity map
[Err] [Physics.cc:2894] Internal error: link [13] not in entity map
...
This may be a gz-sim problem but if there's a way to mitigate it in gz-physics, that would be helpful to users.
I also get infinite console spam when loading the nested_model_joint_positions.sdf example world from gz-sim unless I remove model4
Signed-off-by: Ian Chen <[email protected]>
…' into bullet_nested_model
Signed-off-by: Ian Chen <[email protected]>
yeah the
I added support for the
I added necessary logic to add all remaining links (floating bodies / other subtrees) in gz-physics but without bullet structures. This is just for book-keeping and prevents gz-sim from printing warning messages when trying to access these links. Added warning msgs to let users know that these links are non-functional. 2c85f5e and 06016b7
Fixed issue with an empty top level model that has no links. 2c85f5e |
…, fix model transform Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
Fixed a todo item and that resolved the pose issue of model4 which occurs when the root link is inside a nested model (as opposed to a top level model). 575e73b |
Signed-off-by: Ian Chen <[email protected]>
Adapted from #574. Signed-off-by: Steve Peters <[email protected]>
Adapted from #574 with acknowledgement to Ian Chen. Signed-off-by: Steve Peters <[email protected]>
Adapted from #574 with acknowledgement to Ian Chen. Signed-off-by: Steve Peters <[email protected]> Co-authored-by: Ian Chen <[email protected]>
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.
overall it looks good; I left a few minor comments and will approve once they are resolved
auto *model = this->ReferenceInterface<ModelInfo>(_modelID); | ||
auto *world = this->ReferenceInterface<WorldInfo>(model->world); | ||
if (world->modelIndexToEntityId.erase(model->indexInWorld) == 0) | ||
{ | ||
// The model has already been removed at some point. | ||
if (!model) | ||
return false; |
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.
nit: I think this check could be removed, since RemoveModelImpl
performs the same check for the existence of the model
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.
removed. ca1715e
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, now I think I was wrong, since I didn't notice that we are dereferencing model
on the next line. Those two lines from ca1715e should probably come back. Thanks for your patience
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.
ah yes, reverted change. d08d0ef
da3aac6
to
7c9b368
Compare
Signed-off-by: Ian Chen <[email protected]>
7c9b368
to
ca1715e
Compare
thanks for the review! Addressed all comments. |
also, one small patch to improve test coverage:
|
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 two remaining comments: a suggested revert of one of my suggestions and a patch to improve coverage
Signed-off-by: Ian Chen <[email protected]>
Added, thanks. d08d0ef |
🎉 New feature
Closes #546
Summary
Extended bullet-featurestone implementation to support these features related to nested models:
ConstructSdfJoint
(limited to creating world joints)ConstructSdfNestedModel
(bullet-featherstone: implement ConstructSdfNestedModel feature #546)GetNestedModelFromModel
WorldModelFeature
(bullet-featherstone: implement WorldModelFeature feature #547)RemoveEntities
The nested models are currently added to a single multibody since bullet-featherstone does not seem to support joints between 2 different multibodies. The nested model just keeps a shared ptr to the rootLink's btMultibody.
Test it
With the addition of the above features, more common tests are now being run using bullet-feathersone plugin. Note that I had to skip a few of tests in
free_joint_features
andjoint_features
because the bullet-featherstone implementation does not support 1) multiple floating bodies / sub-trees yet (#550) and 2) joints between two different models.Here's an example nested model world file I use for testing. To run:
Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.