-
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: Fix loading mesh from relative path #599
Conversation
Signed-off-by: Ian Chen <[email protected]>
|
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## gz-physics6 #599 +/- ##
===============================================
- Coverage 78.52% 78.34% -0.19%
===============================================
Files 140 140
Lines 7670 7688 +18
===============================================
Hits 6023 6023
- Misses 1647 1665 +18 ☔ View full report in Codecov by Sentry. |
That shouldn't be the case, I looked a bit, but can't find any substantial reason it was excluded in the final merge? |
Just checking how |
IIRC, your callback should be fired when the mesh URI is parsed. You can then choose to resolve the URL however you want and then that's what sdformat will return to anyone parsing the sdf file. Previously, the mesh URI would just be passed directly from the SDF file to the downstream user, this gives an opportunity to resolve that URI in a different way before the consumer sees it. |
ok so we want to do this in gz-sim to resolve all URIs before passing to gz-phsyics. The tricky part is that the user callback takes a single |
proposed an alternative approach in gazebosim/sdformat#1373 |
closing this in favor of the new approach in gazebosim/sdformat#1373 |
🦟 Bug fix
Summary
When loading a model sdf that contains relative path to meshes, bullet featherstone implementation will fail to load the mesh and print out errors like these:
bullet featherstone implementation works differently from other physics engines. It does not rely on gz-sim to load the mesh and attach it using the
AttachMeshFeature
. Instead, it uses its own mesh manager for loading meshes. So we'll also need to resolve the mesh URI here in gz-physics. This is done using theasFullPath
function taken from gz-sim. We should consider refactoring this function, e.g. to gz-common, in the main branches so it can be reused in gz-physics.To test
You can download these world sdf and box mesh model files for testing:
and run the test world with bullet-featherstone physics engine in gz-sim:
Hit play and the box mesh should fall, collide (and then explode) instead of falling through the ground :)
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.