SDFormat, the Simulation Description Format (often shortened to SDF), is an XML schema for describing robots and their environments so that simulators, visualizers and control tools can load them consistently. In robotics simulation it captures not only a robot’s links, joints and inertial properties but also sensors, lights, physics engine settings and entire worlds in a single, versioned file format.
SDFormat was created for the Gazebo simulator and is maintained today as an open specification with a reference parser library, libsdformat. It sits next to URDF, MJCF and Xacro in the toolbox of anyone who builds a robot simulator scene, and it is the native scene format of Gazebo in both its classic and current generations.
How an SDFormat file is structured
An SDFormat file is a hierarchical XML document whose root element sdf carries a mandatory version attribute, such as 1.7 or 1.11, that tells the parser which specification rules apply. Below the root sits either a world, which describes a complete simulated environment, or a standalone model, which describes one reusable object such as a robot, a table or a sensor rig.
Inside a model, links represent rigid bodies and joints connect them. Each link can hold three separate descriptions: an inertial block with mass and inertia tensor, one or more collision geometries used by the physics engine, and one or more visual geometries used only for rendering. This separation of collision and visual geometry is deliberate, because simple collision shapes keep contact computation fast while detailed meshes keep images realistic.
The following table summarizes the core elements and what each one contributes to a simulation.
| Element | Contains | Used by |
|---|---|---|
| world | Models, lights, physics, gravity, scene settings | Simulator at startup |
| model | Links, joints, plugins, nested models | Physics and rendering |
| link | Inertial, collision, visual, sensor blocks | Rigid-body dynamics |
| joint | Type, parent, child, axis, limits, dynamics | Kinematic constraints |
| sensor | Camera, lidar, IMU, contact, force-torque settings | Sensor simulation |
| plugin | Library name and custom parameters | Controllers and extensions |
| physics | Step size, solver, real-time factor target | Physics engine |
All quantities use SI units: meters, kilograms, seconds and radians. Poses are written as six numbers, x y z roll pitch yaw, and since version 1.7 every pose can name the frame it is expressed in through the relative_to attribute, which removes much of the ambiguity that older files suffered from.
Specification versions and their changes
SDFormat evolves through numbered specification versions, and libsdformat can convert older files upward automatically when it loads them. Knowing which version introduced a feature matters, because a file that relies on newer semantics will not behave correctly in a tool that only understands an older specification.
| Version | Notable change | Practical effect |
|---|---|---|
| 1.4 to 1.6 | Mature model, sensor and plugin elements | Basis of most Gazebo classic content |
| 1.7 | Explicit frame semantics and pose relative_to | Unambiguous poses and named frames |
| 1.8 | Nested model improvements, merge-include | Composable robots from smaller parts |
| 1.9 and later | Refinements to joints, frames and attributes | Better consistency across tools |
The frame semantics of version 1.7 are the most significant change for practitioners. Earlier files often relied on implicit conventions, such as a joint pose being relative to its child link, which caused subtle placement errors when models were reused. Explicit frames make the intent visible in the file and allow validation tools to catch mistakes before the simulation starts.
SDFormat compared with URDF and MJCF
SDFormat differs from URDF mainly in scope: URDF describes a single robot as a kinematic tree, while SDFormat describes robots, objects and the surrounding world, including closed kinematic loops. MJCF, the native format of MuJoCo, covers similar ground to SDFormat but is designed around MuJoCo’s own solver and its concepts of default classes and tendons.
The comparison below shows where each format fits in a typical robotics workflow.
| Aspect | SDFormat | URDF | MJCF |
|---|---|---|---|
| Primary ecosystem | Gazebo | ROS and ROS 2 | MuJoCo |
| Describes worlds | Yes | No | Yes |
| Closed kinematic loops | Supported | Not supported | Supported via constraints |
| Multiple robots per file | Yes | No | Yes |
| Sensors and lights | Native elements | Only through extensions | Sensors native, lights native |
| Versioned specification | Yes, explicit attribute | Informal | Tied to MuJoCo releases |
In practice the formats coexist. Many ROS teams keep a URDF generated with Xacro as the single source of truth for the robot, and Gazebo converts it to SDFormat on load, reading extra simulation details from gazebo extension tags. Teams that need closed chains, such as parallel grippers or delta robots, often write SDFormat directly because URDF cannot express those loops.
Joints, sensors and plugins in practice
Joint definitions determine how links may move relative to each other, and SDFormat offers more joint types than URDF. Each joint names a parent and a child link, an axis expressed in a chosen frame, and optional limits, damping and friction that feed the physics engine’s contact dynamics.
| Joint type | Degrees of freedom | Typical use |
|---|---|---|
| revolute | One rotation with limits | Robot arm shoulder or elbow |
| continuous | One unlimited rotation | Wheel axle |
| prismatic | One translation with limits | Linear actuator, gripper slide |
| ball | Three rotations | Passive spherical linkage |
| universal | Two rotations | Cardan shaft coupling |
| fixed | None | Rigidly mounted sensor bracket |
| screw | Coupled rotation and translation | Lead-screw mechanism |
Sensor elements attach to links and define update rate, noise models and measurement ranges, so a simulated lidar can report realistic Gaussian noise at, for example, 10 Hz. Plugins load shared libraries that add controllers, custom physics behavior or bridges to ROS 2 topics. The include element pulls in models by URI, either from a local path or from an online model repository, which keeps world files short and reusable.
Common mistakes and limitations
Most SDFormat problems come from physically implausible parameters rather than syntax errors. A file can be perfectly valid XML yet produce a robot that jitters, sinks through the floor or explodes when the simulation starts.
| Symptom | Likely cause | Fix |
|---|---|---|
| Model vibrates or explodes | Unrealistic inertia tensor or zero mass | Compute inertia from geometry and density |
| Slow simulation | High-polygon collision meshes | Use primitives or simplified collision meshes |
| Parts appear misplaced | Wrong pose frame assumption | Use version 1.7 frames with relative_to |
| Robot slides unexpectedly | Missing or default friction values | Set surface friction coefficients explicitly |
| Plugin not loaded | Library path or name mismatch | Check plugin filename and environment paths |
SDFormat also has structural limitations. It is tightly associated with Gazebo, so portability to other simulators is partial: Isaac Sim, Webots and MuJoCo each import only a subset of elements, and plugin sections are never portable. Deformable bodies, fluids and cable dynamics have limited or engine-specific support. The format describes a scene, not a control program, so behavior still lives in plugins or external nodes.
Stripped to the essentials
SDFormat is a recipe file for a virtual robot world. It lists every part of a robot, how heavy each part is, how the parts are connected, what the robot can sense, and what the room around it looks like.
A simulator reads this recipe and builds a virtual test environment where the robot can move, bump into things and collect sensor data. Because the recipe is written in a shared, well-defined format, different engineers and tools can open the same file and get the same world. The key point is simple: SDFormat describes the whole scene, not just the robot.
Where it is applied
A warehouse automation team is developing a mobile manipulator: a wheeled base with a six-axis arm and a two-finger gripper. The team keeps the robot description in Xacro for its ROS 2 software, but it writes the warehouse world in SDFormat, with shelving models pulled in through include elements, overhead lights, a floor with measured friction values and a physics step of 1 millisecond.
The gripper uses a parallel linkage that forms a closed loop, so engineers model it directly in SDFormat with revolute joints that URDF could not express. A depth camera and a 2D lidar are defined as sensor elements with noise models tuned to the datasheets. Each night, a continuous integration job launches Gazebo with this world, runs 200 pick-and-place trials and records success rates.
Over several weeks, the simulated runs reveal that the arm’s planned trajectories clip the shelf edges in tight aisles. The team adjusts its motion planner before building the physical cell, which avoids collisions on real hardware and shortens commissioning on site.