SDFormat

Also known as: SDF · Simulation Description Format

On this page 7

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.

ElementContainsUsed by
worldModels, lights, physics, gravity, scene settingsSimulator at startup
modelLinks, joints, plugins, nested modelsPhysics and rendering
linkInertial, collision, visual, sensor blocksRigid-body dynamics
jointType, parent, child, axis, limits, dynamicsKinematic constraints
sensorCamera, lidar, IMU, contact, force-torque settingsSensor simulation
pluginLibrary name and custom parametersControllers and extensions
physicsStep size, solver, real-time factor targetPhysics engine
Core SDFormat elements and their roles

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.

VersionNotable changePractical effect
1.4 to 1.6Mature model, sensor and plugin elementsBasis of most Gazebo classic content
1.7Explicit frame semantics and pose relative_toUnambiguous poses and named frames
1.8Nested model improvements, merge-includeComposable robots from smaller parts
1.9 and laterRefinements to joints, frames and attributesBetter consistency across tools
Selected SDFormat versions and notable additions

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.

AspectSDFormatURDFMJCF
Primary ecosystemGazeboROS and ROS 2MuJoCo
Describes worldsYesNoYes
Closed kinematic loopsSupportedNot supportedSupported via constraints
Multiple robots per fileYesNoYes
Sensors and lightsNative elementsOnly through extensionsSensors native, lights native
Versioned specificationYes, explicit attributeInformalTied to MuJoCo releases
Robot description formats compared

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 typeDegrees of freedomTypical use
revoluteOne rotation with limitsRobot arm shoulder or elbow
continuousOne unlimited rotationWheel axle
prismaticOne translation with limitsLinear actuator, gripper slide
ballThree rotationsPassive spherical linkage
universalTwo rotationsCardan shaft coupling
fixedNoneRigidly mounted sensor bracket
screwCoupled rotation and translationLead-screw mechanism
Common SDFormat joint types

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.

SymptomLikely causeFix
Model vibrates or explodesUnrealistic inertia tensor or zero massCompute inertia from geometry and density
Slow simulationHigh-polygon collision meshesUse primitives or simplified collision meshes
Parts appear misplacedWrong pose frame assumptionUse version 1.7 frames with relative_to
Robot slides unexpectedlyMissing or default friction valuesSet surface friction coefficients explicitly
Plugin not loadedLibrary path or name mismatchCheck plugin filename and environment paths
Frequent SDFormat errors and fixes

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.