Skip to main content

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 be ros_to_gz, gz_to_ros, or bidirectional.

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 to bridge.yaml in 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

urdf_bridge_builder-0.1.6.tar.gz (15.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

urdf_bridge_builder-0.1.6-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

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

Hashes for urdf_bridge_builder-0.1.6.tar.gz
Algorithm Hash digest
SHA256 3783e1fb83f321a010cf4487b262c384228132c6f643478b2d2006e809bee514
MD5 212a61b8f68cdca8db2877a6b5cdbcfb
BLAKE2b-256 6ede75d7794f0aded07b52ad98bf0c448372dfd360591f71addf11cde410927f

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file urdf_bridge_builder-0.1.6-py3-none-any.whl.

File metadata

File hashes

Hashes for urdf_bridge_builder-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 c412139983fd50fc7bf9d2e022188e23402709a85ca00589d87e312aa1511779
MD5 8892a203baaa7c30e4d535440561043d
BLAKE2b-256 3aff8432e5a30ddb7ef3d9449bbe43102c2870eb2a4da87f705a825bf2a7861d

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page