gazebosim / gz-mujoco

25 stars 4 forks source link

Handle default geom types and mesh scales #95

Closed azeey closed 2 years ago

azeey commented 2 years ago

🦟 Bug fix

Summary

While trying to convert dm_control/dm_control/suite/dog.xml I noticed that we are not handling geoms without a type attribute. The default value of geom types is sphere according to the MJCF docs.

Apparently it's also possible to specify geom[@mesh] without setting type, and this PR also addresses that.

Finally, we were not checking if geom[@scale] was set when processing meshes. This PR applies the default scale if the attribute is not set.

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.

codecov[bot] commented 2 years ago

Codecov Report

Merging #95 (71b4688) into main (952e032) will increase coverage by 0.00%. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main      #95   +/-   ##
=======================================
  Coverage   95.11%   95.12%           
=======================================
  Files          24       24           
  Lines        1168     1170    +2     
=======================================
+ Hits         1111     1113    +2     
  Misses         57       57           
Impacted Files Coverage Δ
...ormat_mjcf/mjcf_to_sdformat/converters/geometry.py 96.77% <100.00%> (+0.07%) :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 952e032...71b4688. Read the comment docs.