An effort to replace ROS packages describing a robot (a directory structure with URDF, SRDF, OBJ-MTL-STL-salad) with a single GLTF 2.0 GLB file including URDF and SRDF descriptions in the "extras" field of the GLTF header.
- All geometry is put into a GLTF 2.0
.GLB
file. - Nodes in GLTF scene description are not used, but can be defined for visualization
- The URDF and SRDF descriptions are stored in the
extras
field of the GLTF header.- Using the
extras
field keeps us completely compliant with the spec. - XML is converted to native JSON using a reversible XML-JSON mapping.
- One could also just dump the XML file as a string into the extras field, but that is pretty ugly. This way if new tools are being written, they can reference only the JSON format.
- Implemented by xmltodict.
- Using the
- URDF mesh
package://file_name
references are a replaced by a GLTF geometry name.
GLTF has emerged as a very popular alternative to other mesh and scene descriptions. It is incredibly easy and fast to parse (JSON header describing data in a binary blob), has a sensible hierarchical scene graph in the JSON header, and a great looking modern physically based material system. It has support in dozens-to-hundreds of libraries, as well as a coveted John Carmack endorsment.
Collada is an XML approach, also from Khronos group. Another way of stating this question is, "why do we have ROS packages instead of a single Collada file?". Reasons: the COLLADA spec is gigantic, the files are annoying and slow to parse, it half- assedly supports everything in the universe, is XML based, and has multiple very incompatible versions.
- Replace ROS package (e.g.
pr2_description
,herb_description
, etc) with a single.GLB
file - No ROS dependency.
- Allow the ecosystem of GLTF viewing and authoring tools (Blender, Maya, etc.) to use and edit it as a regular GLTF file.
- Bidirection autogeneration: Given a ROS package, we should be able to generate the
robot-gltf
file, and given arobot-gltf
file we should be able to generate a ROS package older tools can use without being totally re- written. We can design new tools to use it natively and incrementally replace old pipelines. - Eventually replace
xacro
withjinja2
pip install robot-gltf
works on Windows, Linux, and Mac.
- OBJ files referencing materials that have to be found somewhere on the file system
- Nice PBR materials included in the same file
- Robot models can be exported from Solidworks and then textured and edited by visual artists using their existing workflow (Blender, etc).
- Robots are in a single file, with no ROS dependencies and are fully multiplatform.
- Doesn't require re- writing the whole ROS ecosystem.
Robots in the ROS ecosystem are described in a ROS package, like pr2_description
, herb_description
, turtlebot_description
, etc. The packages consist of a few things:
- a directory structure including meshes of various types
- URDF or SRDF files, which are an XML- based kinematics description
- URDF.xacro files, a robotics- specific templating language
Xacro fills a need, but at its core it is a templating language that is only used by robotics researchers. Templating is not a robot specific problem, and there are a number of extremely active, well tested, widely deployed options. As a very approximate metric, Jinja2
has 5800 github stars and 1800 commits compared to xacro
with 12 github stars and 384 commits. Jinja2
has Python and C++ implementations.
Very interesting! Is there any implementation of this in progress?