Version-Agnostic SDF Bindings


This module is experimental and not all SDFormat elements are currently supported. If an element is not supported, it will raise a warning. To suppress this warning use:

skbot.ignition.sdformat.generic_sdf.base.WARN_UNSUPPORTED = False

This module contains version-agnostic bindings for SDFormat. The idea of these bindings is that they can parse SDF in any one version, and allow you to consume the SDF as if it were any other SDF version.

This, of course, comes with the limitation of compatibility between versions. For example, you can load a SDF v1.6 file and access elements introduced in SDF v1.8 if they have a default value or can be computed from the values available. However, if an element is now required in SDF v1.8 but wasn’t available in SDF v1.6 then it will not be set. Further, if an element is no longer available in the most recent SDF version, it will raise a depreciation warning. Such cases will be documented as such.

In addition to unavoidable version incompatibilities listed above, the bindings make the following oppinionated decisions:

  • Some variable names differ from SDFormat

    • If an element may have multiple children of the same kind, they corresponding attribute uses plural instead of singular, e.g. models instead of model.

    • If different SDF versions use different names for the same variable, they are converted into the name used in the most recent SDFormat version. Old names are still available via a @property and will raise a depreciation warning.

  • vectors are converted to numpy arrays

  • includes are resolved, removes, and the included element is inserted instead

  • __model__ is appended to frame references where necessary, e.g., a reference of the form model_A::model_B will become model_A::model_b:__model__.

Supported Elements

sdf.Sdf(*[, payload, version, worlds, ...])

SDFormat Root Element

camera.Camera(*[, name, pose, ...])

A Camera Sensor.

frame.Frame(*, name[, pose, attached_to])

A frame of reference.

joint.Joint(*, name, type, parent, child[, ...])

A constraint between two rigid bodys.

link.Link(*, name[, gravity, enable_wind, ...])

A rigid body.

model.Model(*, name[, canonical_link, ...])

A physical object in the simulation

sensor.Sensor(*, name, type[, always_on, ...])

A sensor.

world.World(*[, name, audio, wind, gravity, ...])

A simulation world

include.Include(*, uri[, name, static, ...])

Include a fragment (Model, World, or Light) from URI.

origin.Origin(*[, pose])

Unsupported Elements

The following elements are currently recognized, but not implemented. When encountered, they will raise a warning.

state.State(*, sdf_version)

light_state.Light(*, sdf_version)

link_state.Link(*, sdf_version)

model_state.Model(*, sdf_version)

collision.Collision(*, sdf_version)

inertial.Inertial(*, sdf_version)

material.Material(*, sdf_version)

geometry.Geometry(*, sdf_version)

visual.Visual(*, sdf_version)

actor.Actor(*, sdf_version)

audio_sink.AudioSink(*, sdf_version)

audio_source.AudioSource(*, sdf_version)

collision_engine.CollisionEngine(*, sdf_version)

gripper.Gripper(*, sdf_version)

particle_emitter.ParticleEmitter(*, sdf_version)

physics.Physics(*, sdf_version)

scene.Scene(*, sdf_version)

surface.Surface(*, sdf_version)

urdf.URDF(*, sdf_version)


sensors.Lidar(*, sdf_version)

sensors.Ray(*, sdf_version)

sensors.AirPressure(*, sdf_version)

sensors.Altimeter(*, sdf_version)

sensors.Contact(*, sdf_version)

sensors.ForceTorque(*, sdf_version)

sensors.Gps(*, sdf_version)

sensors.Imu(*, sdf_version)

sensors.LogicalCamera(*, sdf_version)

sensors.Magnetometer(*, sdf_version)

sensors.Navsat(*, sdf_version)

sensors.RfidTag(*, sdf_version)

sensors.Rfid(*, sdf_version)

sensors.Sonar(*, sdf_version)

sensors.Transceiver(*, sdf_version)

light.Light(*, sdf_version)


shapes.Box(*, sdf_version)

shapes.Capsule(*, sdf_version)

shapes.Cylinder(*, sdf_version)

shapes.Ellipsoid(*, sdf_version)

shapes.Heightmap(*, sdf_version)

shapes.Image(*, sdf_version)

shapes.Mesh(*, sdf_version)

shapes.Plane(*, sdf_version)


gui.Gui(*, sdf_version)

atmosphere.Atmosphere(*, sdf_version)

battery.Battery(*, sdf_version)

noise.Noise(*, sdf_version)

population.Population(*, sdf_version)

projector.Projector(*, sdf_version)