Load fuse and export URDF - epfl-lasa/wiki GitHub Wiki

Intro

Working with URDF's and meshes is easy but it takes some knowledge and time to find the relevant documentations. The following is a piece of code that opens an URDF file fuses all the geometry meshes and saves them as a variety of format. Supported format should be:

  • obj (tested)
  • stl (tested)
  • off (not tested)
  • ply (not tested)
  • collada (not tested)
  • json (not tested)
  • dict (not tested)
  • glb (not tested)
  • dict64 (not tested)
  • msgpack (not tested)

This code snippet uses urdfpy to load the urdf. However urdfpy does not support rosurls in the URDF's. This implies that the code written has ton replace the "package://" with the actual abosute path to these files. The default is to use the curretnt working directory but anything could be used by tweaking the stings defined in convert_rosurls_2_abspath.

Full code

For readability the code is published with docstrings and comments as a github gist.

Link to the code