RepositoryC++
gazebosim

gazebosim/sdformat

Simulation Description Format (SDFormat) parser and description files.

223stars
131forks
248issues
1views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: robot-description

#1 Repository of the month

1
TINIX TRENDING·Topic: sdformat

#1 Repository of the month

1
TINIX TRENDING·Topic: gazebo

#1 Repository of the month

sdformat

GitHub open issues GitHub open pull requests Discourse topics Hex.pm

BuildStatus
Test coveragecodecov
Ubuntu JammyBuild Status
HomebrewBuild Status
WindowsBuild Status

SDFormat is an XML file format that describes environments, objects, and robots in a manner suitable for robotic applications. SDFormat is capable of representing and describing different physic engines, lighting properties, terrain, static or dynamic objects, and articulated robots with various sensors, and actuators. The format of SDFormat is also described by XML, which facilitates updates and allows conversion from previous versions.

Documentation

See the SDFormat Website for a more comprehensive description of the specification, proposals for modifications, developer information, etc. This website is published using some information from the sdf_tutorials repository.

Terminology

  • SDFormat - The specification.
    • SDF - Synonym for SDFormat, though SDFormat should be preferred, as "SDF" is an acronym with other meanings.
  • libsdformat - The C++ parsing code contained within this repository, which can be used to read SDFormat files and return a C++ interface.

http://sdformat.org/

Installation

We recommend following the Binary Installation instructions to get up and running as quickly and painlessly as possible.

The Source Installation instructions should be used if you need the very latest software improvements, you need to modify the code, or you plan to make a contribution.

Binary Installation

Ubuntu

On Ubuntu systems, apt-get can be used to install sdformat:

sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list'
wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
sudo apt-get update

sudo apt install libsdformat<#>-dev libsdformat<#>

Be sure to replace <#> with a number value, such as 14 or 15, depending on which version you need, or leave it empty for version 1.

macOS

On macOS, after installing the Homebrew package manager, add OSRF packages:

brew tap osrf/simulation

Install sdformat:

brew install sdformat<#>

Be sure to replace <#> with a number value, such as 14 or 15, depending on which version you need.

Windows

Install Conda package management system. Miniconda suffices.

Create if necessary, and activate a Conda environment:

conda create -n gz-ws
conda activate gz-ws

Install sdformat:

conda install libsdformat --channel conda-forge

You can view all the versions with

conda search libsdformat --channel conda-forge

and install a specific minor version with

conda install libsdformat=12.5.0 --channel conda-forge

Source Installation

Note: the main branch is under development for libsdformat16 and is currently unstable. A release branch (sdf12, sdf11, sdf10, sdf9, etc.) is recommended for most users.

UNIX

Prerequisites

Clone the repository

git clone https://github.com/gazebosim/sdformat -b sdf<#>

Be sure to replace <#> with a number value, such as 14 or 15, depending on which version you need.

Install dependencies

Ubuntu

cd sdformat
sudo apt -y install \
  $(sort -u $(find . -iname 'packages-'`lsb_release -cs`'.apt' -o -iname 'packages.apt' | tr '\n' ' '))

macOS

brew install --only-dependencies sdformat<#>

Be sure to replace <#> with a number value, such as 14 or 15, depending on which version you need.

Build from Source

Standard installation can be performed in UNIX systems using the following steps:

cd sdformat
mkdir build
cd build
cmake ..  # Consider specifying -DCMAKE_INSTALL_PREFIX=...
make install

sdformat supported cmake parameters at configuring time:

NameTypeDefaultDescription
SKIP_PYBIND11BOOLFalseSkip generating Python bindings via pybind11
USE_INTERNAL_URDFBOOLFalseUse an internal copy of urdfdom 1.0.0 instead of looking for one installed in the system
USE_UPSTREAM_CFLAGSBOOLTrueUse the sdformat team compilation flags instead of the common set defined by cmake.

Build python bindings separately from main library

If you want to build Python bindings separately from the main libsdformat library (for example if you want to build Python bindings for multiple versions of Python), you can invoke cmake on the python folder instead of the root folder. Specify the path to the python executable with which you wish to build bindings in the Python3_EXECUTABLE cmake variable. Specify the install path for the bindings in the CMAKE_INSTALL_PREFIX variable, and be sure to set your PYTHONPATH accordingly after install.

cd sdformat
mkdir build_python3
cd build_python3
cmake ../python \
    -DPython3_EXECUTABLE=/usr/local/bin/python3.12 \
    -DCMAKE_INSTALL_PREFIX=<prefix>

See the homebrew sdformat15 formula for an example of building bindings for multiple versions of Python.

Uninstallation

To uninstall the software installed with the previous steps:

cd build
make uninstall

Windows

Prerequisites

Install Conda package management system. Miniconda suffices.

Create if necessary, and activate a Conda environment:

conda create -n gz-ws
conda activate gz-ws

Install prerequisites:

conda install cmake git vcstool colcon-common-extensions ^
tinyxml2 urdfdom pybind11 -channel conda-forge

Getting the sources and building from Source

Be sure to replace <#> with a number value, such as 14 or 15, depending on which version you need.

  1. Getting the sources
mkdir ws\src
cd ws
vcs import src --input https://raw.githubusercontent.com/gazebo-tooling/gazebodistro/master/sdformat<#>.yaml
  1. Build from source

Note: the Gazebo library dependencies are going to be compiled from source with sdformat although it should be possible to install them from conda-forge on stable Gazebo releases using the standard conda install command.

Build the gazebo libraries needed as dependencies (skip testing to speed up the compilation) using the colcon tool:

  colcon build --cmake-args -DBUILD_TESTING=OFF --merge-install --packages-skip sdformat<#>

Build sdformat with its test suite:

  colcon build --cmake-args -DBUILD_TESTING=ON --merge-install --packages-select sdformat<#>

Similar Projects

Discover other similar projects and AI models.

RepositoryHTML
osrf/gazebo_models

Gazebo database of SDF models. This is a predecessor to https://app.gazebosim.org

1.3k
Jul 14, 2024
RepositoryPython
practical-tutorials/project-based-learning

Curated list of project-based tutorials

290.9k
Nov 30, 2026
RepositoryJavaScript
CyC2018/CS-Notes

:books: 技术面试必备基础知识、Leetcode、计算机操作系统、计算机网络、系统设计

186.6k
Nov 27, 2026
RepositoryC++
ClickHouse/ClickHouse

ClickHouse® is a real-time analytics database management system

51.3k
Dec 1, 2026
RepositoryC++
bulletphysics/bullet3

Bullet Physics SDK: real-time collision detection and multi-physics simulation for VR, games, visual effects, robotics, machine learning etc.

14.9k
Oct 9, 2026
RepositoryC++
PetoiCamp/OpenCat-Quadruped-Robot

An open source quadruped robot pet framework for developing Boston Dynamics-style four-legged robots that are perfect for STEM, coding & robotics education, IoT robotics applications, AI-enhanced robotics application services, research, and DIY robotics kit development.

5.6k
Nov 18, 2026
RepositoryC++
cyberbotics/webots

Webots Robot Simulator

4.8k
Dec 1, 2026
RepositoryC++
petercorke/robotics-toolbox-python

Robotics Toolbox for Python

3.6k
Dec 1, 2026
RepositoryC++
gazebosim/gz-sim

Open source robotics simulator. The latest version of Gazebo.

1.6k
Dec 1, 2026