Ask Your Question

Gazebo Diff drive can make the robot stay immobile

asked 2020-06-18 08:05:51 -0600

jGany gravatar image

Hi, I'm trying to build a robot in gazebo9 with Ros2-dashing. I'm using the libgazebo_ros_diff_drive plugin to control the wheels and give instructions to the robot.

The controls work greats and I can move the robot around in the virtual world, but when I don't give cmd_vel (or 0 in all directions) diff drive make the wheels turn slowly, moving the robot. I am almost certain that's diff drive who does the moving, as it won't happen if I remove the plugin (The robot don't slide otherwise ).

<plugin name="robot_diff_drive" filename="">



  <!-- wheels -->

  <!-- kinematics -->

  <!-- limits -->


  <!-- output -->




Here the config of the diff drive, they are mostly the same as the turtlebot3. And the wheels :

    <xacro:macro name="origin_wheel">
        <origin rpy="${rpy}" xyz="${xyz}"/>

    <link name="wheel_${name}_link">
            <xacro:origin_base />
            <mass value="${wheel_mass}" />
            <inertia ixx="0.0016" ixy="0" ixz="0" iyy="0.0016" iyz="0" izz="0.003" /><!-- Good value of inertia -->

            <xacro:origin_base />
                <cylinder radius="${wheel_radius}" length="${wheel_length}"/>

            <xacro:origin_base />
                    <cylinder radius="${wheel_radius}" length="${wheel_length}"/>
            <material name="green"/>
    <gazebo reference="wheel_${name}_link">
        <kp value="${kp}" />
        <kd value="${kd}" />
        <material>Gazebo/Gold </material>

    <joint name="wheel_${name}_joint" type="continuous">
        <parent link="reverse_footprint_link"/>
        <child link="wheel_${name}_link"/>
        <xacro:origin_wheel />
        <axis xyz="0 0 1"/>

Does anyone know where I can look to found a solution, or what to do to make it work as I need? (Also, I don't know if it's a question better suited to ros answers or gazebo answers :/ )

Thank :)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-06-18 14:31:14 -0600

Weasfas gravatar image

Hi @jGany,

I am sure this is not a problem of the plugin but you Gazebo contacts. The wheel contacts parameters need to be properly adjusted for Gazebo to produce consistent contact and friction values. Have you checked this tutorials? this and this.

To be more precisse: mu1 and mu2 values are too high. As stated in the SDF specification, those parameters are ratios, hence their values are in between [0,1]. Furthemore, the values kp and kd are used to calculate the ODE inner params called ERP and CFM used to balance the inestability of the simulation. Since I do not know what values are you passing to the the xacro macro I will say try to be consistent with those values. You can learn more about that here.

Usually, you can leave all these values as the defaullt ones, try a simulation iteration and then adjusted them as you may see fit.

Hope that can help you to solve the problem.


edit flag offensive delete link more


Hi, You were right, when putting back defaults value this problem seems to disappear :) I thought I had tried with this before, but I shifted all the value a lot because of problems at every step, I may not have checked again with this version :/

Anyway, thank you for your help :D

jGany gravatar image jGany  ( 2020-06-19 02:33:06 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2020-06-18 08:05:51 -0600

Seen: 435 times

Last updated: Jun 18 '20