Differential drive robot on ROS Indigo slipping
Dear all,
For the last couple of days, I have been trying to create a URDF model of a simple (or that is what I thought) differential drive robot (libgazebo_ros_diff_drive and libgazebo_ros_joint_state_publisher plugins) with a laser sensor (libgazebo_ros_laser) mounted on it and simulate it using gazebo (using ROS indigo).
The laser readings are just fine, the problem comes when sending twist commands to the robot: it doesn't move. Activating the option View->Wireframe in gazebo's gui makes it easy to see that the wheels are actually spinning, but the robot does not move. It feels like it is stuck to the ground or slipping on ice.
I am sure that I am missing something, but I can't figure out what. After days of looking at other examples that work, I am totally lost. Any help would be greatly appreciated.
Here is the URDF file:
<?xml version="1.0"?>
<robot name="cleaning_robot">
<!--
<link name="base_footprint"/>
-->
<link name="base_link">
<visual>
<geometry>
<cylinder length="0.25" radius="0.26"/>
</geometry>
<material name="gray">
<color rgba="0.8 0.8 0.8 0.7"/>
</material>
</visual>
<collision>
<geometry>
<cylinder length="0.3" radius="0.32"/>
</geometry>
</collision>
<inertial>
<origin xyz="0.01 0 0" rpy="0 0 0"/>
<mass value="10.0"/>
<inertia
ixx="0.074" ixy="0.0" ixz="0.0"
iyy="0.12" iyz="0.0"
izz="0.15"/>
</inertial>
</link>
<gazebo reference="base_link">
<material value="Gazebo/White"/>
</gazebo>
<link name="left_wheel_link">
<visual>
<geometry>
<cylinder length="0.04" radius="0.145"/>
</geometry>
<origin xyz="0 0 0" rpy="1.57075 0 0"/>
<material name="blue">
<color rgba="0 0 .8 1"/>
</material>
</visual>
<collision>
<geometry>
<cylinder length="0.04" radius="0.145"/>
</geometry>
<origin xyz="0 0 0" rpy="1.57075 0 0"/>
</collision>
<inertial>
<origin xyz="0 0 0" rpy="0 0 0"/>
<mass value="0.01"/>
<inertia
ixx="0.01" ixy="0.0" ixz="0.0"
iyy="0.01" iyz="0.0"
izz="0.01"/>
</inertial>
</link>
<gazebo reference="left_wheel_link">
<mu1>1.0</mu1>
<mu2>1.0</mu2>
<kp>1000000.0</kp>
<kd>100.0</kd>
<minDepth>0.001</minDepth>
<maxVel>1.0</maxVel>
</gazebo>
<joint name="base_to_left_wheel" type="continuous">
<parent link="base_link"/>
<child link="left_wheel_link"/>
<origin xyz="0 0.3 0" rpy="0 0 0"/>
<axis xyz="0 1 0"/>
</joint>
<link name="right_wheel_link">
<visual>
<geometry>
<cylinder length="0.04" radius="0.145"/>
</geometry>
<origin xyz="0 0 0" rpy="1.57075 0 0"/>
<material name="blue"/>
</visual>
<collision>
<geometry>
<cylinder length="0.04" radius="0.145"/>
</geometry>
<origin xyz="0 0 0" rpy="1.57075 0 0"/>
</collision>
<inertial>
<origin xyz="0 0 0" rpy="0 0 0"/>
<mass value="0.01"/>
<inertia
ixx="0.01" ixy="0.0" ixz="0.0"
iyy="0.01" iyz="0.0"
izz="0.01"/>
</inertial>
</link>
<gazebo reference="right_wheel_link">
<mu1>1.0</mu1>
<mu2>1.0</mu2>
<kp>1000000.0</kp>
<kd>100.0</kd>
<minDepth>0.001</minDepth>
<maxVel>1.0</maxVel>
</gazebo>
<joint name="base_to_right_wheel" type ...
Can we have a look at the TF tree to see if anything is wrong there? You can check it by running "rosrun tf view_frames" while everything is running. This will create a PDF you can view by "evince frames.pdf". Also, you can try playing with the friction properties. I don't know much about them but you could try 100 for mu1 and mu2 instead of 1.0. Also I usually see kd set to 1.0, but again, I don't know much about what they mean.