ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
I tested it, it is fairly easy with the ros_gz_bridge:
Start the simulation: gz sim ./tracked_vehicle_simple.sdf
(or ign sim ...
depending on the Gazebo version)
In another terminal, start the bridge:
ros2 run ros_gz_bridge parameter_bridge /model/simple_tracked/cmd_vel@geometry_msgs/msg/Twist]gz.msgs.Twist
Publish Twist messages from your ROS node, or e.g. from the cli:
ros2 topic pub /model/simple_tracked/cmd_vel geometry_msgs/msg/Twist "linear: { x: 1 }"
Note that, depending on your Gazebo version, you might have to write gz.msgs.Twist
in step 2, or ignition.msgs.Twist
as 'ignition' was renamed to 'gz' starting from Gazebo Garden.
Note also that gz topic -l
currently _does not_ list topics to which there is no active publisher. If you're not sure to which topic you should publish, start the simulation with option '-v 4', e.g. gz sim ./tracked_vehicle_simple.sdf -v 4
and typically it will be mentioned in the debug output.