Dartsim uses AttachMeshShapeFeature for constructing meshes. It expects a common::Mesh to already be loaded and passed to it. So we need to optimize the mesh first in gz-sim (instead of doing mesh optimization inside gz-physics dartsim plugin). To support this, this PR adds logic to perform mesh optimization whenever a mesh is being loaded (e.g. via loadMeshhere in physics system).
Mesh collision visualization support is in https://github.com/gazebosim/gz-sim/pull/2352. I'll refactor that PR to use the new optimizeMesh function introduced here once this PR gets in.
Checklist
[ ] Signed all commits for DCO
[ ] Added tests
[ ] Added example and/or tutorial
[ ] Updated documentation (as needed)
[ ] Updated migration guide (as needed)
[ ] Consider updating Python bindings (if the library has them)
[ ] 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 and edit the commit message to match the pull request summary while retaining Signed-off-by messages.
π New feature
Summary
Add mesh optimization support in dartsim.
Dartsim uses
AttachMeshShapeFeature
for constructing meshes. It expects acommon::Mesh
to already be loaded and passed to it. So we need to optimize the mesh first in gz-sim (instead of doing mesh optimization inside gz-physics dartsim plugin). To support this, this PR adds logic to perform mesh optimization whenever a mesh is being loaded (e.g. vialoadMesh
here in physics system).Test it
You can test with the cordless drill simplified mesh. Here's a cordless_drill.sdf test world
Launch gz-sim with the optimized mesh
and you should see a debug msg like this:
Mesh collision visualization support is in https://github.com/gazebosim/gz-sim/pull/2352. I'll refactor that PR to use the new
optimizeMesh
function introduced here once this PR gets in.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.