'Gazebo 4 Wheeled Robot does not move

I made a URDF-File for a 4-wheeled Robot. I would like to test it in Gazebo. I have it working so far. I have 4 wheels, they also turn. I confirmed this by turning on View -> Wireframe. I am using the skid_steer_drive_controller and rosrun teleop_twist_keyboard teleop_twist_keyboard.py. I can see the wheels turning but the Robot does not move.

I am using an offset for my base_footprint, otherwise my robot collapses and starts jiggeling. I also took this offset in the z-Axis in account for the wheels.

I took this urdf as basis, here so i did not declare friction:

This is my URDF:


<?xml version="1.0" ?>
 <robot name="explorer">
  <link name="world">
  </link>
<!-- -->
  <link name="base_footprint">
    <visual>
      <origin xyz="0 0 0.046"/>
      <geometry>
          <box size="0.235 0.094 0.049"/>
      </geometry>
      <material name="gray">
        <color rgba=".2 .2 .2 1" />
      </material>
    </visual>
    <inertial>
      <origin xyz="0 0 0.046"/>
        <mass value="0.6174" />
          <inertia ixx="2.84523645e-3" ixy="0.0" ixz="0" iyy="3.1763172e-3" iyz="0" izz="5.7814365e-4" />
    </inertial>
      <collision>
        <origin xyz="0 0 0.046"/>
        <geometry>
          <box size="0.235 0.094 0.049"/>
        </geometry>
      </collision>
  </link>
  <joint name="dummy_joint" type="fixed">
    <parent link="world"/>
    <child link="base_footprint"/>
  </joint>
 
 <!-- -->
 <link name="wheel_rf">
  <inertial>
    <mass value="0.036" />
    <inertia ixx="9.2562e-5" ixy="0.0" ixz="0" iyy="9.2562e-5" iyz="0" izz="2.9124e-5" />
  </inertial>
  <visual>
    <geometry>
        <cylinder radius="0.033" length="0.026"/>
    </geometry>
    <material name="white">
      <color rgba="1 1 1 1"/>
    </material>
  </visual>
  <collision>
    <geometry>
        <cylinder radius="0.033" length="0.026"/>
    </geometry>
  </collision>
</link>
<joint name="wheel_rf_joint" type="continuous">
  <origin xyz="0.04 0.063 0.033" rpy="1.57  0.0 0.0"/>
  <parent link="base_footprint"/>
  <child link="wheel_rf"/>
     <axis xyz="0.0 0.0 1.0"/> 
</joint>

<link name="wheel_lf">
  <inertial>
    <mass value="0.036" />
    <inertia ixx="9.2562e-5" ixy="0.0" ixz="0" iyy="9.2562e-5" iyz="0" izz="2.9124e-5" />
  </inertial>
  <visual>
    <geometry>
        <cylinder radius="0.033" length="0.026"/>
    </geometry>
    <material name="white">
      <color rgba="1 1 1 1"/>
    </material>
  </visual>
  <collision>
    <geometry>
        <cylinder radius="0.033" length="0.026"/>
    </geometry>
     </collision>
</link>

<joint name="wheel_lf_joint" type="continuous">
  <origin xyz="0.04 -0.063 0.033" rpy="1.57 0.0 0.0"/>
  <parent link="base_footprint"/>
  <child link="wheel_lf"/>
     <axis xyz="0.0 0.0 1.0"/>

</joint>
<!-- -->
 <link name="wheel_rb">
  <inertial>
    <mass value="0.036" />
    <inertia ixx="9.2562e-5" ixy="0.0" ixz="0" iyy="9.2562e-5" iyz="0" izz="2.9124e-5" />
  </inertial>
  <visual>
    <geometry>
        <cylinder radius="0.033" length="0.026"/>
    </geometry>
    <material name="white">
      <color rgba="1 1 1 1"/>
    </material>
  </visual>
  <collision>
    <geometry>
        <cylinder radius="0.033" length="0.026"/>
    </geometry>
  </collision>
</link>

<joint name="wheel_rb_joint" type="continuous">
  <origin xyz="-0.04 0.063 0.033" rpy="1.57 0.0 0.0"/>
  <parent link="base_footprint"/>
  <child link="wheel_rb"/>
     <axis xyz="0.0 0.0 1.0"/>

</joint>
<!-- -->
<link name="wheel_lb">
<inertial>
  <mass value="0.036" />
  <inertia ixx="9.2562e-5" ixy="0.0" ixz="0" iyy="9.2562e-5" iyz="0" izz="2.9124e-5" />
</inertial>
<visual>
  <geometry>
      <cylinder radius="0.033" length="0.026"/>
  </geometry>
  <material name="white">
    <color rgba="1 1 1 1"/>
  </material>
</visual>
<collision>
  <geometry>
      <cylinder radius="0.033" length="0.026"/>
  </geometry>
</collision>
</link>

<joint name="wheel_lb_joint" type="continuous">
<origin xyz="-0.04 -0.063 0.033" rpy="1.57 0.0 0.0"/>
<parent link="base_footprint"/>
<child link="wheel_lb"/>
   <axis xyz="0.0 0.0 1.0"/>

</joint>

<!-- Gazebo colors to links as upper defined colors are only visible in RVIZ-->

<gazebo reference="base_footprint">
<material>Gazebo/Black</material>
</gazebo>
<gazebo reference="wheel_rf">
<material>Gazebo/Orange</material>
</gazebo>
<gazebo reference="wheel_lf">
<material>Gazebo/Orange</material>
</gazebo>
<gazebo reference="wheel_rb">
<material>Gazebo/Orange</material>
</gazebo>
<gazebo reference="wheel_lb">
<material>Gazebo/Orange</material>
</gazebo>

<!-- DIFFENERNTIAL DRIVEEEEEEEEEEEEE -->
<gazebo>
  <plugin name="skid_steer_drive_controller" filename="libgazebo_ros_skid_steer_drive.so">
    <updateRate>100.0</updateRate>
    <robotNamespace>/</robotNamespace>
    <leftFrontJoint>wheel_lf_joint</leftFrontJoint>
    <rightFrontJoint>wheel_rf_joint</rightFrontJoint>
    <leftRearJoint>wheel_lb_joint</leftRearJoint>
    <rightRearJoint>wheel_rb_joint</rightRearJoint>
    <wheelSeparation>0.08</wheelSeparation>
    <wheelDiameter>0.066</wheelDiameter>
    <robotBaseFrame>base_footprint</robotBaseFrame>
    <torque>20</torque>
    <topicName>cmd_vel</topicName>
    <broadcastTF>false</broadcastTF>
  </plugin>
  </gazebo>
    
</robot>



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source