gazebosim / gz-mujoco

25 stars 4 forks source link

SDFormat to MJCF: Fix bug when using relative output paths #78

Closed azeey closed 2 years ago

azeey commented 2 years ago

🦟 Bug fix

Summary

sdformat2mjcf currently crashes when using relative output paths. When I ran sdformat2mjcf shapes.sdf mjcf/shapes.xml, I got

FileNotFoundError: [Errno 2] No such file or directory: '/home/addisu/ws/garden/src/ign-gazebo/examples/worlds/mjcf/mjcf/shapes.xml

This fixes it by passing the output directory and filename (not path to file) to export_with_assets

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 #78 (a6b35dd) into main (555c440) will increase coverage by 0.00%. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main      #78   +/-   ##
=======================================
  Coverage   93.75%   93.75%           
=======================================
  Files          24       24           
  Lines        1072     1073    +1     
=======================================
+ Hits         1005     1006    +1     
  Misses         67       67           
Impacted Files Coverage Δ
...mat_mjcf/src/sdformat_mjcf/sdformat_to_mjcf/cli.py 90.90% <100.00%> (ø)
...sdformat_mjcf/sdformat_to_mjcf/sdformat_to_mjcf.py 100.00% <100.00%> (ø)

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 555c440...a6b35dd. Read the comment docs.

azeey commented 2 years ago

this fixes the bug you noted, but I just noticed the weird spelling of sdformat_mjcf/src/sdformat_mjcf/sdformat_to_mjcf/sformat_to_mjcf.py. note the first two letters sf in sformat_to_mjcf.py

Ah, yeah, I noticed that the other day as well. I can rename it in this PR if that's okay.

scpeters commented 2 years ago

this fixes the bug you noted, but I just noticed the weird spelling of sdformat_mjcf/src/sdformat_mjcf/sdformat_to_mjcf/sformat_to_mjcf.py. note the first two letters sf in sformat_to_mjcf.py

Ah, yeah, I noticed that the other day as well. I can rename it in this PR if that's okay.

go for it