Skip to content

DiffDrive

Gazebo

gazebo diff drive plugin
<plugin name="gz::sim::systems::DiffDrive" filename="gz-sim-diff-drive-system">

    <left_joint>wheel_left_joint</left_joint>
    <right_joint>wheel_right_joint</right_joint>
    <wheel_separation>${wheel_separation}</wheel_separation>
    <wheel_radius>0.033</wheel_radius>


    <max_linear_acceleration>0.33</max_linear_acceleration>

    <topic>cmd_vel</topic>


    <frame_id>odom</frame_id>
    <child_frame_id>base_link</child_frame_id>
    <odom_topic>odom</odom_topic>
    <odom_publisher_frequency>30</odom_publisher_frequency>

    <tf_topic>/tf</tf_topic>

  </plugin>

ROS

bridge file

bridge.yaml
# gz topic published by DiffDrive plugin
- ros_topic_name: "odom"
  gz_topic_name: "odom"
  ros_type_name: "nav_msgs/msg/Odometry"
  gz_type_name: "gz.msgs.Odometry"
  direction: GZ_TO_ROS

# gz topic published by DiffDrive plugin
- ros_topic_name: "tf"
  gz_topic_name: "tf"
  ros_type_name: "tf2_msgs/msg/TFMessage"
  gz_type_name: "gz.msgs.Pose_V"
  direction: GZ_TO_ROS

# gz topic subscribed to by DiffDrive plugin
- ros_topic_name: "cmd_vel"
  gz_topic_name: "cmd_vel"
  ros_type_name: "geometry_msgs/msg/Twist"
  gz_type_name: "gz.msgs.Twist"
  direction: ROS_TO_GZ