Gazebo bridge
The bridge allows you to connect ROS 2 topics with Gazebo Harmonic topics so you can:
- Control simulation objects from ROS 2 (e.g., publish velocity commands).
- Get data from simulation (e.g., sensor readings, /clock).
- Sync time between ROS 2 and Gazebo.
Tip
Tip
- @ : a bidirectional bridge,
- [ : a bridge from Gazebo to ROS,
- ] : a bridge from ROS to Gazebo.
bridge yaml config
github config yaml and message type mapping table
Clock
- Gazebo publishes a simulation clock internally.
- To share it with ROS, you need a bridge between Gazebo’s
gz.msgs.Clock
and ROS 2’srosgraph_msgs/msg/Clock
.
Demo
Simulate using bridge, send message from side to side (no need to run gz sim for this check)
send string message from gz to ros and from ros to gz using cli
- Run bridge
- Pub from GZ echo in ROS
- Pub from ROS echo in GZ
pub data from gz to ros
Terminal2: ros subscribe | |
---|---|
Terminal3: gz pub | |
---|---|
pub data from ros to gz
Terminal2: ros pub | |
---|---|
Terminal3: gz sub | |
---|---|