gazebosim / sdformat

Simulation Description Format (SDFormat) parser and description files.
http://sdformat.org
Apache License 2.0
166 stars 92 forks source link

Add <voxel_resolution> SDF element to <convex_decomposition> #1403

Closed iche033 closed 4 months ago

iche033 commented 5 months ago

šŸŽ‰ New feature

Summary

Adds a new <voxel_resolution> parameter. This is only applicable to voxel based convex decomposition methods.

See below for alternative proposals that I have considered. I'm open to suggestions.

Alternatives considered

  1. Use a more generic parameter <resolution> instead of <voxel_resolution> so that it's applicable to a wider range of convex decomposition methods. e.g.
<convex_decomposition>
   <resolution>100000</resolution>
</convex_decomposition>

One example of non-voxel based method is the CoACD method which offers a couple resolution configuration params (resolution and manifold preprocess resolution).

  1. Have specific SDF elements for each different method / library (similar to how there is <bullet>, <ode>, and <dart> specific params):
<convex_decomposition>
  <VHACD>
    <voxel_resolution>200000</voxel_resolution>
  <VHACD>
  <some_other_method>
    <another_param>50</another_param>
  <some_other_method>
</convex_decomposition>

This PR chose an approach that's kind of half way between the 2 above alternatives. I added the <voxel_resolution> SDF element to be more explicit in limiting this element to voxel based methods but not overly specific to a particular convex decomposition library.

One option for extending the spec in the future would be:

<!-- `method` can be VHACD, CoACD, etc and this determines the corresponding resolution param to use --> 
<convex_decomposition method="VHACD>
  <voxel_resolution>200000</voxel_resolution>
  <manifold_resolution>50</manifold_resolution>
</convex_decomposition>

Test it

Run the tests: UNIT_Mesh_TEST and INTEGRATION_geometry_dom

Checklist

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.