Differential drive wheels slipping

asked 2020-03-07 10:18:49 -0500

doekaschi gravatar image

updated 2022-06-05 11:36:21 -0500

lucasw gravatar image

I am trying to model a Robot with two wheels (differential drive) and two caster wheels in the front. I used this tutorial as a reference for my robot. However, I have the problem that when I publish the following values on the /cmd_vel topic, the left wheel of my robot slips away and it does not turn at all (to be clear: no movement at all except for the wheel itself is visible).

linear: x:0 y:0 z:0 angular: x:0 y:0 z:1

However, when I publish the following message on /cmd_vel, the robot moves forward (as expected).

linear: x:1 y:0 z:0 angular x:0 y:0 z:0

I also attached the code for my .xacro model, I hope someone knows the answer to this solution, it is really frustrating.

<?xml version="1.0"?>

<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="a">
<xacro:property name="mesh_file" value="$(find mowro_description)/meshes/mowro.dae" />
<xacro:property name="scale" value="1.0" />
    <static>false</static>

    <!-- <gazebo>
        <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
            <robotNamespace>/mowro</robotNamespace>
        </plugin>
    </gazebo> -->

    <!-- Base Link-->

    <link name="base_link">
        <visual>
            <origin xyz="0 0 0"/>
            <geometry>
                <mesh filename="file://${mesh_file}" scale="${scale} ${scale} ${scale}"/>
            </geometry>
        </visual>
        <inertial>
            <mass value="5.0"/>
            <inertia ixx="1" ixy="0.0" ixz="0.0" iyy="1" iyz="0.0" izz="1"/>
        </inertial>
        <collision>
            <origin xyz="0 0 0.5"/>
            <geometry>
                <box size="1.9 0.5 0.8"/>
            </geometry>
        </collision>
        <collision>
            <origin xyz="0.5 0 0.2"/>
            <geometry>
                <box size="1 1 0.3"/>
            </geometry>
        </collision>
    </link>

    <!-- Left Tire-->

    <link name="left_tire">
        <collision>
            <!-- <origin xyz="-0.58 0.4 0.2" rpy="1.5708 0.0 0.0"/> -->
            <geometry>
                <cylinder radius="0.2" length="0.2"/>
            </geometry>
            <surface>
                <friction>
                    <ode>
                        <mu>0.8</mu>
                        <mu2>0.8</mu2>
                        <slip1>0.0</slip1>
                        <slip2>0.0</slip2>
                    </ode>
                </friction>
            </surface>
        </collision>

        <inertial>
            <mass value="1.0"/>
            <inertia ixx="1" ixy="0.0" ixz="0.0" iyy="1" iyz="0.0" izz="1"/>
        </inertial>
    </link>

    <joint name="base_to_left_tire" type="continuous">
        <parent link="base_link"/>
        <child link="left_tire"/>
        <axis xyz="0.0 0.0 1.0"/>
        <origin xyz="-0.58 0.4 0.2" rpy="1.5708 0.0 0.0"/>
    </joint>

    <!-- Right Tire-->

    <link name="right_tire">
        <collision>
            <!-- <origin xyz="-0.58 -0.4 0.2" rpy="1.5708 0.0 0.0"/> -->
            <geometry>
                <cylinder radius="0.2" length="0.2"/>
            </geometry>
            <surface>
                <friction>
                    <ode>
                        <mu>0.8</mu>
                        <mu2>0.8</mu2>
                        <slip1>0.0</slip1>
                        <slip2>0.0</slip2>
                    </ode>
                </friction>
            </surface>
        </collision>

        <inertial>
            <mass value="1.0"/>
            <inertia ixx="1" ixy="0.0" ixz="0.0" iyy="1" iyz="0 ...
(more)
edit retag flag offensive close merge delete

Comments

Just a quick comment: unless I'm misunderstanding what you're trying to do, odom is not a topic you use to control your robot with. It's a state reporting topic. It only carries messages which describe the current state of your robot (ie: how far has it moved, what is the velocity in the local frame, etc).

gvdhoorn gravatar image gvdhoorn  ( 2020-03-08 06:21:06 -0500 )edit

@gvdhoom Yes you are completely right. I did not mean to write /odom but /cmd_vel. I corrected in the question. Do you have any idea about the question itself?

doekaschi gravatar image doekaschi  ( 2020-03-08 09:39:19 -0500 )edit