A Python package to generate ROS Gazebo bridge YAML from URDF files.
Project description
Robot Bridge Manager Python Package
Overview
This Python package automatically generates a .yaml file specifying a ROS Gazebo bridge.
It does so by parsing a URDF (XML) file and looking for custom <bridge> tags within it.
Installation
pip install .
Usage
Defining Bridge Components in URDF
To use this tool, you need to embed <bridge> tags within your URDF file.
Each <bridge> tag should define a single ROS-Gazebo bridge.
Example <bridge> tag:
<bridge
ros_topic="/my_robot/cmd_vel"
gz_topic="/model/my_robot/cmd_vel"
ros_type="geometry_msgs/msg/Twist"
gz_type="gz.msgs.Twist"
direction="ros_to_gz"
/>
Attributes:
ros_topic: The ROS 2 topic name.gz_topic: The Gazebo topic name.ros_type: The ROS 2 message type (e.g.,geometry_msgs/msg/Twist).gz_type: The Gazebo message type.direction: The direction of the bridge. Can beros_to_gz,gz_to_ros, orbidirectional.
Generating the Bridge YAML
Once your URDF file contains the necessary <bridge> tags, you can use the urdf-bridge-builder command-line tool to generate the bridge.yaml file.
urdf-bridge-builder generate path/to/your_robot.urdf --output bridge.yaml
path/to/your_robot.urdf: The path to your URDF file.--output bridge.yaml(optional): Specifies the output file name for the generated YAML. If not provided, it defaults tobridge.yamlin the current directory.
Example:
If my_robot.urdf contains:
<robot name="my_robot">
<link name="base_link"/>
<bridge ros_topic="/joint_states" gz_topic="/model/my_robot/joint_states" ros_type="sensor_msgs/msg/JointState" gz_type="gz.msgs.Model" direction="gz_to_ros"/>
<bridge ros_topic="/cmd_vel" gz_topic="/model/my_robot/cmd_vel" ros_type="geometry_msgs/msg/Twist" gz_type="gz.msgs.Twist" direction="ros_to_gz"/>
</robot>
Running urdf-bridge-builder generate my_robot.urdf will create bridge.yaml:
- ros_topic: /joint_states
gz_topic: /model/my_robot/joint_states
ros_type: sensor_msgs/msg/JointState
gz_type: gz.msgs.Model
direction: gz_to_ros
- ros_topic: /cmd_vel
gz_topic: /model/my_robot/cmd_vel
ros_type: geometry_msgs/msg/Twist
gz_type: gz.msgs.Twist
direction: ros_to_gz
This bridge.yaml file can then be used with ros_gz_bridge.
Development
Running Tests
To run the unit tests, ensure you have pytest installed and run it from the project root:
pip install pytest
pytest urdf-bridge-builder/src/tests/
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file urdf_bridge_builder-0.1.6.tar.gz.
File metadata
- Download URL: urdf_bridge_builder-0.1.6.tar.gz
- Upload date:
- Size: 15.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3783e1fb83f321a010cf4487b262c384228132c6f643478b2d2006e809bee514
|
|
| MD5 |
212a61b8f68cdca8db2877a6b5cdbcfb
|
|
| BLAKE2b-256 |
6ede75d7794f0aded07b52ad98bf0c448372dfd360591f71addf11cde410927f
|
Provenance
The following attestation bundles were made for urdf_bridge_builder-0.1.6.tar.gz:
Publisher:
python-publish.yml on seantfish/urdf-bridge-builder
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
urdf_bridge_builder-0.1.6.tar.gz -
Subject digest:
3783e1fb83f321a010cf4487b262c384228132c6f643478b2d2006e809bee514 - Sigstore transparency entry: 1100455899
- Sigstore integration time:
-
Permalink:
seantfish/urdf-bridge-builder@7ab4af02c3cc0d409243adf57f870a2a1e6fc382 -
Branch / Tag:
refs/tags/v0.1.6 - Owner: https://github.com/seantfish
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@7ab4af02c3cc0d409243adf57f870a2a1e6fc382 -
Trigger Event:
release
-
Statement type:
File details
Details for the file urdf_bridge_builder-0.1.6-py3-none-any.whl.
File metadata
- Download URL: urdf_bridge_builder-0.1.6-py3-none-any.whl
- Upload date:
- Size: 17.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c412139983fd50fc7bf9d2e022188e23402709a85ca00589d87e312aa1511779
|
|
| MD5 |
8892a203baaa7c30e4d535440561043d
|
|
| BLAKE2b-256 |
3aff8432e5a30ddb7ef3d9449bbe43102c2870eb2a4da87f705a825bf2a7861d
|
Provenance
The following attestation bundles were made for urdf_bridge_builder-0.1.6-py3-none-any.whl:
Publisher:
python-publish.yml on seantfish/urdf-bridge-builder
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
urdf_bridge_builder-0.1.6-py3-none-any.whl -
Subject digest:
c412139983fd50fc7bf9d2e022188e23402709a85ca00589d87e312aa1511779 - Sigstore transparency entry: 1100455955
- Sigstore integration time:
-
Permalink:
seantfish/urdf-bridge-builder@7ab4af02c3cc0d409243adf57f870a2a1e6fc382 -
Branch / Tag:
refs/tags/v0.1.6 - Owner: https://github.com/seantfish
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@7ab4af02c3cc0d409243adf57f870a2a1e6fc382 -
Trigger Event:
release
-
Statement type: