Blender  →  .urdf

Blender to URDF

Blender has no joints, no masses and no idea what a robot is, and still a lot of robots are modelled in it. The bridge is Phobos, a Blender URDF exporter that adds links, joints and inertia to the scene and writes URDF, SDF or SMURF with the meshes beside it.

The export itself happens in Blender

This site does not read Blender files. The conversion is done by Phobos — BSD 3-Clause, from DFKI's Robotics Innovation Center, at github.com/dfki-ric/phobos. What follows is what the export needs from you, and then the half that is ours: what these exports get wrong, and how to find out which of it happened to yours.

Getting a description out

Install Phobos into the Blender it supports

Phobos is an add-on, installed from its release zip through Blender's preferences, and it is tested against one Blender — currently the 3.3 LTS. A newer Blender may load it and fail on export, which is the least useful moment to find out. The same project also runs from the command line, without Blender, for converting between the formats it writes.

Turn the scene into links and joints

Each part becomes a link in Phobos's sense: an object of its own in the tree, with the visual meshes under it and a joint type, axis and limits set on it. The parent-child structure of the Blender scene is the kinematic tree of the robot, so a part parented to the wrong object becomes a joint in the wrong place.

Generate inertia and collision, deliberately

Phobos can create inertial objects from the visual geometry once you give each link a mass, and collision objects as boxes, cylinders, spheres or meshes. Both are explicit steps. Skipped, the links have no mass and collide with nothing — and the export still succeeds.

Export the model folder and look at it here

The export is a folder: the description in URDF, SDF or SMURF, and the meshes as STL, OBJ or COLLADA. Drop the whole folder into the viewer; the check runs as it loads and names every link the steps above missed.

Or skip the exporter

For a robot of a few parts the add-on is more than the job needs. Export each part from Blender as STL or GLB with its scale applied first, and put them together in the URDF editor: links, joints and limits in a form, and each link's inertia worked out from its mesh rather than typed in.

What comes out wrong, and how you find out

A CAD export produces a file that opens, renders and looks like your robot. The failures below are the ones that survive that impression and show up later as a simulation behaving strangely for no visible reason. Each is a check this site runs on a model you open — not a warning to keep in mind, a line naming the link or the joint.

Links that weigh nothing

A link without an inertial object is exported without an <inertial> block. ROS reads that as massless, Gazebo drops such a link along with its joint, and MuJoCo refuses any moving body with no mass. The check lists each link without inertia, and each whose mass and size imply a density no robot part has.

A robot at the wrong size

Blender's unit is whatever the scene was modelled in, and an object scale left unapplied is carried into where the joints are. The check states the size of the model in metres as it opens and says outright when it looks a hundred or a thousand times off.

The display mesh as the collision shape

Collision objects generated as meshes copy the visual geometry, sculpt detail and all. It loads and looks right, and every contact test runs against it. The check names the links whose collision shape is their visual mesh.

Joint limits that were never set

A revolute or prismatic joint written without limits does not just lack documentation: ROS's own URDF parser refuses the whole file because of it. Each such joint is named, along with joints whose lower and upper limits are equal and so cannot move.

Check the export

The masses. Blender has no notion of one, so every number in a Phobos export was typed or generated by somebody — and a link nobody gave an inertial object arrives with no mass at all, which a simulator either refuses or invents.

Drop the URDF and its mesh folder into the viewer. Nothing is installed and nothing is published; the file is read to draw it and deleted after a day. For a model out of Blender, in this order:

  1. Mass and inertia, link by link. The panel lists every link with no inertial block, and every one whose implied density is nothing a robot part is made of. Both are what an inertial object left out, or generated from the wrong mesh, looks like.
  2. The size. Stated in metres as the model opens. Blender scenes are often modelled at whatever scale was convenient, and an unapplied scale on an object travels into the joint origins.
  3. Collision against visual. Phobos can generate collision objects as primitives or as the mesh itself; the second is a sculpt-resolution shape in every contact test.
  4. Joint limits. A revolute joint whose limits were never filled in is refused outright by ROS's parser, not merely undocumented.

Then send it further: convert to MJCF and run it in the physics lab, where a robot that cannot hold itself up says so in the first second — or author a movement in motion and find out whether the motors your CAD material implies can actually perform it.

Other CAD packages