https://github.com/ami-iit/rod
The ultimate Python tool for RObot Descriptions processing.
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (10.4%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
The ultimate Python tool for RObot Descriptions processing.
Basic Info
- Host: GitHub
- Owner: ami-iit
- License: bsd-3-clause
- Language: Python
- Default Branch: main
- Homepage: https://pypi.org/project/rod/
- Size: 234 KB
Statistics
- Stars: 17
- Watchers: 10
- Forks: 3
- Open Issues: 9
- Releases: 9
Topics
Metadata Files
README.md
RObot Description processor
The ultimate Python tool for RObot Descriptions processing.
ROD is yet another library to operate on robot descriptions based on the SDFormat specification.
Why SDFormat?
Among the many existing robot description formats, SDFormat provides a well-defined and maintained versioned specification that controls the available fields and their content.
Open Robotics already provides the C++ library gazebosim/sdformat with initial support of Python bindings.
However, C++ dependencies in pure-Python projects are typically quite complicated to handle and maintain.
Here ROD comes to rescue.
URDF, thanks to native ROS support, is historically the most popular robot description used by the community. The main problem of URDF is that it is not a specification, and developers of URDF descriptions might produce models and parsers that do not comply to any standard. Luckily, URDF models can be easily converted to SDF[^urdftosdf]. If the URDF model is not compliant, the process errors with clear messages. Furthermore, modern versions of the converter produce a SDF description with standardized pose semantics, that greatly simplifies the life of downstream developers that do not have to guess the reference frame or pose elements. Last but not least, the pose semantics also makes SDF aware of the concept of frame that URDF is missing.
Features
- Out-of-the-box support for SDFormat specifications ≥ 1.10.
- Serialization and deserialization support for SDF files.
- In-memory layout based on
dataclasses. - Syntax highlighting and auto-completion.
- Programmatic creation of SDF files from Python APIs.
- Transitive support for URDF through conversion to SDF.
- Type validation of elements and attributes.
- Automatic check of missing required elements.
- High-performance serialization and deserialization using
Fatal1ty/mashumaro. - Export in-memory model description to URDF.
[^urdftosdf]: Conversion can be done using the gz sdf command included in Gazebo Sim starting from Garden.
Installation
[!TIP] ROD does not support out-of-the-box URDF files. URDF support is obtained by converting URDF files to SDF using the
gz sdfcommand provided by sdformat and gz-tools. Ensure these tools are installed on your system if URDF support is needed (more information below).
Using conda (recommended)
Installing ROD using `conda` is the recommended way to obtain a complete installation with out-of-the-box support for both URDF and SDF descriptions: ```bash conda install rod -c conda-forge ``` This will automatically install `sdformat` and `gz-tools`.Using pixi
[`pixi`](https://pixi.sh) definetly provides the quickest way to start using ROD. You can run the tests by executing: ```bash pixi run test ``` or install the default dependencies with: ```bash pixi install ``` check out the [pyproject.toml](./pyproject.toml) file for the list of all available features and read the [`pixi`](https://pixi.sh) documentation for more information.Using pip
You can install ROD from PyPI with [`pypa/pip`][pip], preferably in a [virtual environment][venv]: ```bash pip install rod[all] ``` If you need URDF support, follow the [official instructions][gazebo_sim_docs] to install Gazebo Sim on your operating system, making sure to obtain `sdformat ≥ 13.0` and `gz-tools ≥ 2.0`. You don't need to install the entire Gazebo Sim suite. For example, on Ubuntu, you can only install the `libsdformat13 gz-tools2` packages.Examples
Serialize and deserialize SDF files
```python import pathlib from rod import Sdf # Supported SDF resources sdf_resource_1 = "/path/to/file.sdf" sdf_resource_2 = pathlib.Path(sdf_resource_1) sdf_resource_3 = sdf_resource_2.read_text() # Deserialize SDF resources sdf_1 = Sdf.load(sdf=sdf_resource_1) sdf_2 = Sdf.load(sdf=sdf_resource_2) sdf_3 = Sdf.load(sdf=sdf_resource_3) # Serialize in-memory Sdf object print(sdf_3.serialize(pretty=True)) ```Create SDF models programmatically
```python from rod import Axis, Inertia, Inertial, Joint, Limit, Link, Model, Sdf, Xyz sdf = Sdf( version="1.7", model=Model( name="my_model", link=[ Link(name="base_link", inertial=Inertial(mass=1.0, inertia=Inertia())), Link(name="my_link", inertial=Inertial(mass=0.5, inertia=Inertia())), ], joint=Joint( name="base_to_my_link", type="revolute", parent="base_link", child="my_link", axis=Axis(xyz=Xyz(xyz=[0, 0, 1]), limit=Limit(lower=-3.13, upper=3.14)), ), ), ) print(sdf.serialize(pretty=True)) ``` ```xmlExporting SDF to URDF
```python # Generate first the 'sdf' object with the collapsed code # of the section 'Create SDF models programmatically'. from rod.urdf.exporter import UrdfExporter urdf_string = UrdfExporter(pretty=True, gazebo_preserve_fixed_joints=True).to_urdf_string( sdf=sdf ) print(urdf_string) ``` ```xmlCommand Line Interface
ROD provides a command line interface (CLI) for processing robot description files. You can use the CLI to display file attributes or convert files between URDF and SDF formats.
Usage
- Display the attributes of an SDF file:
sh
rod --file /path/to/file.sdf --show
- Convert an SDF file to URDF:
sh
rod --file /path/to/file.sdf -o /path/to/file.urdf
Similar projects
- https://github.com/gazebosim/sdformat
- https://github.com/mmatl/urdfpy
- https://github.com/clemense/yourdfpy
- https://github.com/ros/urdfparserpy
- https://github.com/FirefoxMetzger/python-sdformat/
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
People
Author
|
| @diegoferigo |
|:---------------------------------------------------------------:|:------------------:|
Maintainers
|
| @flferretti |
| @CarlottaSartore |
|:---------------------------------------------------------------:|:------------------:|:---------------------------------------------------------------:|:------------------:|
License
Owner
- Name: Artificial and Mechanical Intelligence
- Login: ami-iit
- Kind: organization
- Location: Italy
- Website: https://ami.iit.it/
- Repositories: 111
- Profile: https://github.com/ami-iit
GitHub Events
Total
- Create event: 17
- Release event: 1
- Issues event: 9
- Watch event: 3
- Delete event: 11
- Member event: 2
- Issue comment event: 36
- Push event: 41
- Pull request review comment event: 14
- Pull request review event: 35
- Pull request event: 30
Last Year
- Create event: 17
- Release event: 1
- Issues event: 9
- Watch event: 3
- Delete event: 11
- Member event: 2
- Issue comment event: 36
- Push event: 41
- Pull request review comment event: 14
- Pull request review event: 35
- Pull request event: 30
Committers
Last synced: 8 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| diegoferigo | d****o@i****t | 124 |
| Filippo Luca Ferretti | f****i@o****m | 51 |
| Lorenzo Conti | l****i@i****t | 20 |
| pre-commit-ci[bot] | 6****] | 2 |
| Silvio Traversaro | s****o@t****t | 2 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 16
- Total pull requests: 61
- Average time to close issues: 4 months
- Average time to close pull requests: 7 days
- Total issue authors: 7
- Total pull request authors: 5
- Average comments per issue: 4.44
- Average comments per pull request: 0.92
- Merged pull requests: 53
- Bot issues: 0
- Bot pull requests: 4
Past Year
- Issues: 6
- Pull requests: 32
- Average time to close issues: about 1 month
- Average time to close pull requests: 5 days
- Issue authors: 4
- Pull request authors: 4
- Average comments per issue: 4.0
- Average comments per pull request: 0.31
- Merged pull requests: 24
- Bot issues: 0
- Bot pull requests: 4
Top Authors
Issue Authors
- diegoferigo (6)
- xela-95 (3)
- traversaro (2)
- flferretti (2)
- stephane-caron (1)
- CarlottaSartore (1)
- evelyd (1)
Pull Request Authors
- diegoferigo (38)
- flferretti (32)
- lorycontixd (4)
- pre-commit-ci[bot] (4)
- traversaro (3)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 3,681 last-month
- Total dependent packages: 1
- Total dependent repositories: 2
- Total versions: 55
- Total maintainers: 2
pypi.org: rod
The ultimate Python tool for RObot Descriptions processing.
- Documentation: https://rod.readthedocs.io/
- License: BSD 3-Clause License Copyright (c) 2022, Artificial and Mechanical Intelligence All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
Latest release: 0.150430.2
published almost 11 years ago
Rankings
Maintainers (2)
Dependencies
- actions/checkout v3 composite
- actions/download-artifact v3 composite
- actions/setup-python v4 composite
- actions/upload-artifact v3 composite
- pypa/gh-action-pypi-publish release/v1 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- isort/isort-action master composite
- psf/black stable composite