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
Create a frame graph from a sdformat string. |
|
Download a model from the Fuel server. |
|
|
Frustum based intrinsic camera transformation |
|
Get a model file from the Fuel server. |
Fetch a Fuel model's metadata. |
|
|
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.
|
Serialize a SDFormat object to an XML string. |
Returns the version of a SDF string. |
|
|
Convert an XML string into a sdformat.models tree. |
Turn a SDFormat string into an object tree. |
|
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. DOM-style means that the entire document will be read and converted into a tree where each SDFormat element is turned into a node in the tree and the nesting of elements is used to determine the edges of this tree.
The aim of these bindings is to allow scripted manipulation and generation of SDF files. It is also used in other parts of the library, for example to construct the kinematic tree of an environment or to construct the transformation chain of a robot model.
There are currently two styles of parsers: a auto-generated version-specific parser, and a experimental version-agnostic parser. The version-specific parser will load a set of bindings generated from the XSD Schema Files and parse the SDF using that. The version-agnistic parser will load any (valid) SDF; however, not all elements are supported at this stage.
Below you can find an example of a version-specifc parser (for SDF v1.8) as well as the documentation of the version-agnostic parser. If you wish to parse SDF of a different version using the version-specific parser, the procedure is analogous to SDF v1.8.
Version-Agnostic SDF Bindings |
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.