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

In this link you will find how to use many gazebo plugins for ROS2 including diff_drive.

Here is an example of how to use diff_drive in ROS2 that worked for me (I assume that you have a valid URDF):

<gazebo>
  <plugin name="diff_drive" filename="libgazebo_ros_diff_drive.so">
            <ros>
                <!--<namespace>/</namespace>-->
            </ros>

            <update_rate>30</update_rate>

            <!-- wheels -->
            <left_joint>wheel_left_joint</left_joint>
            <right_joint>wheel_right_joint</right_joint>

            <!-- kinematics -->
            <wheel_separation>0.6855600</wheel_separation>
            <wheel_diameter>0.4064000</wheel_diameter>

            <!-- limits -->
            <max_wheel_torque>20</max_wheel_torque>
            <max_wheel_acceleration>1.0</max_wheel_acceleration>

            <command_topic>cmd_vel</command_topic>

            <!-- output -->
            <publish_odom>true</publish_odom>
            <publish_odom_tf>true</publish_odom_tf>
            <publish_wheel_tf>true</publish_wheel_tf>

            <odometry_topic>odom</odometry_topic>
            <odometry_frame>odom</odometry_frame>
            <robot_base_frame>base_footprint</robot_base_frame>
        </plugin>
        </gazebo>