ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I tested it, it is fairly easy with the ros_gz_bridge:

  1. Start the simulation: gz sim ./tracked_vehicle_simple.sdf (or ign sim ... depending on the Gazebo version)

  2. 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


  3. 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.