skbot.ignition

Interface with Ignitionrobotics libraries.

Note

To use skbot.ignition, you have to install the latest version of Ignition. In addition, you have to install additional dependencies via

pip install -e .[ignition]

skbot.ignition is a collection of functions to ease interfacing with the Ignition software stack. Ignition is a collection of libraries that, when combined, produce a general purpose simulator for robotic applications called Ignition Gazebo. Ignition Gazebo superseeds Gazebo and, among many other improvements, it is written as a simulation library instead of being a stand-alone application. This allows for dynamic control of all aspects of the simulation as well as full introspection.

Note that this module does not contain python bindings for ignition (and it does not aim to do so). If you are looking for bindings check out ScenarIO, which is a part of gym-ignition.

Functions

General

skbot.ignition.create_frame_graph(sdf)

Create a frame graph from a sdformat string.

skbot.ignition.download_fuel_model(url)

Download a model from the Fuel server.

skbot.ignition.FrustumProjection(hfov, ...)

Frustum based intrinsic camera transformation

skbot.ignition.get_fuel_model(url, *[, ...])

Get a model file from the Fuel server.

skbot.ignition.get_fuel_model_info(url)

Fetch a Fuel model's metadata.

skbot.ignition.Subscriber(topic, *[, parser])

Subscribe and listen to Ignition messages.

SDFormat Specific

Note

Scikit-bot will automatically select the correct version when using skbot.ignition.sdformat.loads(); however, it is imporant that you are mindful of the version you are using, since SDFormat doesn’t use SemVer and availability of elements may differ slightly across versions.

skbot.ignition.sdformat.dumps(root_element, *)

Serialize a SDFormat object to an XML string.

skbot.ignition.sdformat.get_version(sdf)

Returns the version of a SDF string.

skbot.ignition.sdformat.loads(sdf, *[, ...])

Convert an XML string into a sdformat.models tree.

skbot.ignition.sdformat.loads_generic(sdf)

Turn a SDFormat string into an object tree.

skbot.ignition.sdformat.to_frame_graph(sdf, *)

Create a frame graph from a sdformat string.

SDFormat XML

Note

You can find more documentation aboud SDFormat in the official spec.

XSD Schema Files

Warning

The XSD bindings are (slightly) oppinionated and promote some optional elements to required elements with a default value. Check the content of this section for details.

Scikit-bot comes with XSD1.1 schema files that describe SDFormat. You can find their latest versions inside the skbot/ignition/sdformat folder. You can view them on GitHub and a copy can be found in your local version, too. Contrary to the official SDFormat, schemas are provided for all SDF versions.

The XSD bindings are (slightly) oppinionated. If a SDF element is optional (the spec denotes this as required=0 or required=*) but specifies a default value, the schema promotes this to a required element with a default value. This is done to allow the python bindings to provide you with auto-populated defaults where possible.

SDF Bindings

Scikit-bot features a DOM-style parser and serializer for SDFormat XML. You can load all SDFormat versions and scikit-bot will construct a class tree out of it. Similarily, you can construct objects that represent SDF elements and scikit-bot can serialize them into SDF.

The API used here mimics the API used by the familiar JSON parser or YAML parser. The main difference is that this module returns an object tree of dataclass objects, whilst JSON and YAML return dictionaries.

While the parser is imported together with skbot.ignition, the individual models are imported on demand. This is done to keep import times low. To use the bindings explicitly you must import them explicitly. Check the individual bindings for documentation on how to do this:

skbot.ignition.sdformat.bindings.v18

skbot.ignition.sdformat.bindings.v17

skbot.ignition.sdformat.bindings.v16

skbot.ignition.sdformat.bindings.v15

skbot.ignition.sdformat.bindings.v14

skbot.ignition.sdformat.bindings.v13

skbot.ignition.sdformat.bindings.v12

skbot.ignition.sdformat.bindings.v10

Ignition Messages

Scikit-bot provides python bindings to all Ignition messages. Messages are build from the protocol buffer templates found in Ign-Msgs. This allows you to decode messages sent by the subscriber.

To build the bindings yourself, run

git clone https://github.com/ignitionrobotics/ign-msgs.git
mkdir ign-bindings
protoc -I ign-msgs/proto/ --python_betterproto_out=ign-bindings ign-msgs/proto/ignition/msgs/*

This will produce a file called ignition/msgs.py in the chosen output location which can be used to decode messages.

Members of skbot.ignition.messages are not documented here (the class is fully auto-generated). Instead, an overview can be found in the Ignition documentation.