Robotics StackExchange | Archived questions

Robot moves but wheels are not Rotating

I am building a four wheeled mecanum robot with ROS interface. In order to do the simulation I used gazebo and the I used planar plugin to provide the inverse kinematics to the wheels. But, when I publish the velocity commands to the robot, I found that only the robot is moving without rotating the wheels. It seems that the the base of the the robot just slides without rotating the wheels.I am using gazebo version 9

Is there any solutions to fix it...

Here you can find the URDF of my file,

 <robot name="ROSBOT">

<gazebo>
    <plugin name="mecanum_drive" filename="libgazebo_ros_planar_move.so">
      <commandTopic>cmd_vel</commandTopic>
      <odometryTopic>odom</odometryTopic>
      <odometryFrame>odom</odometryFrame>
      <odometryRate>50.0</odometryRate>
      <robotBaseFrame>base_footprint</robotBaseFrame>
      <publishTF>true</publishTF>
      <publishOdomTF>true</publishOdomTF>
    </plugin>
 </gazebo>

<gazebo reference="laser">
    <sensor type="ray" name="rp_lidar_sensor">
      <pose>
        <x>0.0</x>
        <y>0.0</y>
        <z>0.0</z>
        <r>0.0</r>
        <p>0.0</p>
        <y>0.0</y>
      </pose>
      <visualize>false</visualize>
      <update_rate>50</update_rate>
      <ray>
        <scan>
          <horizontal>
            <samples>360</samples>
            <resolution>1</resolution>
            <min_angle>0.0</min_angle>
            <max_angle>6.28319</max_angle>
          </horizontal>
        </scan>
        <range>
          <min>0.120</min>
          <max>3.5</max>
          <resolution>0.015</resolution>
        </range>
        <noise>
          <type>gaussian</type>
          <mean>0.0</mean>
          <stddev>0.01</stddev>
        </noise>
      </ray>
      <plugin name="gazebo_ros_lds_lfcd_controller" filename="libgazebo_ros_laser.so">
        <topicName>scan</topicName>
        <frameName>laser</frameName>
      </plugin>
    </sensor>
  </gazebo>
<gazebo reference="base_link">
    <material>Gazebo/Yellow</material>
</gazebo>

<gazebo reference="front_right_wheel_link">
    <material>Gazebo/Green</material>
    <mu1 value="0.1"/>
    <mu2 value="0."/>
    <kp value="50000.0" />
    <kd value="10.0" />
    <fdir1 value="1 0 0"/>
    <minDepth>0.001</minDepth>
    <maxVel>0.1</maxVel>  
</gazebo>

<gazebo reference="front_left_wheel_link">
    <material>Gazebo/Green</material>
    <mu1 value="0.1"/>
    <mu2 value="0."/>
    <kp value="50000.0" />
    <kd value="10.0" />
    <fdir1 value="1 0 0"/>
    <minDepth>0.001</minDepth>
    <maxVel>0.1</maxVel>  
</gazebo>

<gazebo reference="back_right_wheel_link">
    <material>Gazebo/Green</material>
    <mu1 value="0.1"/>
    <mu2 value="0."/>
    <kp value="50000.0" />
    <kd value="10.0" />
    <fdir1 value="1 0 0"/>
    <minDepth>0.001</minDepth>
    <maxVel>0.1</maxVel>  
</gazebo>

<gazebo reference="back_left_wheel_link">
    <material>Gazebo/Green</material>
    <mu1 value="0.1"/>
    <mu2 value="0."/>
    <kp value="50000.0" />
    <kd value="10.0" />
    <fdir1 value="1 0 0"/>
    <minDepth>0.001</minDepth>
    <maxVel>0.1</maxVel>  
</gazebo>

    <!--<link name="map"/>



    <joint name="map_odom" type="fixed">
        <origin xyz="0 0 0" rpy="0 0 0"/>
        <parent link="map"/>
        <child link="odom"/>
    </joint>

    <joint name="odom_base_footprint" type="fixed">
        <origin xyz="0 0 0" rpy="0 0 0"/>
        <parent link="odom"/>
        <child link="base_footprint"/>
    </joint>-->
    <!--<link name="odom"/>
    <joint name="odom_base_footprint" type="fixed">
        <origin xyz="0 0 0" rpy="0 0 0"/>
        <parent link="odom"/>
        <child link="base_footprint"/>
    </joint>-->

    <link name="base_footprint"/>

    <material name="yellow">
        <color rgba="0 1 1 1"/>
    </material>

    <material name="green">
        <color rgba="0 1 0 1"/>
    </material>

    <link name="base_link">
        <visual>
            <origin xyz="0 0 0" rpy="0 0 0"/>
            <geometry>
                <box size="0.45 0.30 0.05"/>
            </geometry>
            <material name="yellow"/>
        </visual>
        <collision>
            <origin xyz="0 0 0" rpy="0 0 0"/>
            <geometry>
                <box size="0.45 0.30 0.05"/>
            </geometry>
        </collision>
        <inertial>
            <origin xyz="0 0 0" rpy="0 0 0"/>
            <mass value="2.6"/>
            <inertia ixx="0.020041666666666666" ixy="0.0" ixz="0.0" iyy="0.04441666666666667" iyz="0.0" izz="0.063375" />
        </inertial>
    </link>

    <joint name="base_footprint_base_link_joint" type="fixed">
        <origin xyz="0 0 0.05" rpy="0 0 0"/>
        <parent link="base_footprint"/>
        <child link="base_link"/>
    </joint>

    <link name="front_left_wheel_link">
        <visual>
            <origin xyz="0 0 0" rpy="1.5707963267948966 0 0"/>
            <geometry>
                <cylinder radius="0.05" length="0.05"/>
            </geometry>
            <material name="green"/>
        </visual>
        <collision>
            <origin xyz="0 0 0" rpy="1.5707963267948966 0 0"/>
            <geometry>
                <cylinder radius="0.05" length="0.05"/>
            </geometry>
        </collision>
        <inertial>
            <origin xyz="0 0 0" rpy="1.5707963267948966 0 0"/>
            <mass value="0.4"/>
            <inertia ixx="0.00033333333333333343" ixy="0.0" ixz="0.0" iyy="0.00033333333333333343" iyz="0.0" izz="0.0005000000000000001"/>
        </inertial>
    </link>

    <joint name="front_left_wheel_base_link_joint" type="continuous">
        <origin xyz="0.185 0.190 0.0" rpy="0 0 0"/>
        <parent link="base_link"/>
        <child link="front_left_wheel_link"/>
        <axis xyz="0 1 0"/>
        <limit effort="30.0" velocity="10.0"/>
    </joint>



    <link name="front_right_wheel_link">
        <visual>
            <origin xyz="0 0 0" rpy="1.5707963267948966 0 0"/>
            <geometry>
                <cylinder radius="0.05" length="0.05"/>
            </geometry>
            <material name="green"/>
        </visual>
        <collision>
            <origin xyz="0 0 0" rpy="1.5707963267948966 0 0"/>
            <geometry>
                <cylinder radius="0.05" length="0.05"/>
            </geometry>
        </collision>
        <inertial>
            <origin xyz="0 0 0" rpy="1.5707963267948966 0 0"/>
            <mass value="0.4"/>
            <inertia ixx="0.00033333333333333343" ixy="0.0" ixz="0.0" iyy="0.00033333333333333343" iyz="0.0" izz="0.0005000000000000001"/>
        </inertial>
    </link>

    <joint name="front_right_wheel_base_link_joint" type="continuous">
        <origin xyz="0.185 -0.190 0.0" rpy="0 0 0"/>
        <parent link="base_link"/>
        <child link="front_right_wheel_link"/>
        <axis xyz="0 1 0"/>
        <limit effort="30.0" velocity="10.0"/>
    </joint>



    <link name="back_right_wheel_link">
        <visual>
            <origin xyz="0 0 0" rpy="1.5707963267948966 0 0"/>
            <geometry>
                <cylinder radius="0.05" length="0.05"/>
            </geometry>
            <material name="green"/>
        </visual>
        <collision>
            <origin xyz="0 0 0" rpy="1.5707963267948966 0 0"/>
            <geometry>
                <cylinder radius="0.05" length="0.05"/>
            </geometry>
        </collision>
        <inertial>
            <origin xyz="0 0 0" rpy="1.5707963267948966 0 0"/>
            <mass value="0.4"/>
            <inertia ixx="0.00033333333333333343" ixy="0.0" ixz="0.0" iyy="0.00033333333333333343" iyz="0.0" izz="0.0005000000000000001"/>
        </inertial>
    </link>

    <joint name="back_right_wheel_base_link_joint" type="continuous">
        <origin xyz="-0.185 -0.190 0.0" rpy="0 0 0"/>
        <parent link="base_link"/>
        <child link="back_right_wheel_link"/>
        <axis xyz="0 1 0"/>
        <limit effort="30.0" velocity="10.0"/>
    </joint>



    <link name="back_left_wheel_link">
        <visual>
            <origin xyz="0 0 0" rpy="1.5707963267948966 0 0"/>
            <geometry>
                <cylinder radius="0.05" length="0.05"/>
            </geometry>
            <material name="green"/>
        </visual>
        <collision>
            <origin xyz="0 0 0" rpy="1.5707963267948966 0 0"/>
            <geometry>
                <cylinder radius="0.05" length="0.05"/>
            </geometry>
        </collision>
        <inertial>
            <origin xyz="0 0 0" rpy="1.5707963267948966 0 0"/>
            <mass value="0.4"/>
            <inertia ixx="0.00033333333333333343" ixy="0.0" ixz="0.0" iyy="0.00033333333333333343" iyz="0.0" izz="0.0005000000000000001"/>
        </inertial>
    </link>

    <joint name="back_left_wheel_base_link_joint" type="continuous">
        <origin xyz="-0.185 0.190 0.0" rpy="0 0 0"/>
        <parent link="base_link"/>
        <child link="back_left_wheel_link"/>
        <axis xyz="0 1 0"/>
        <limit effort="30.0" velocity="10.0"/>
    </joint>



    <link name="laser">
        <visual>
            <origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/>
            <geometry>
                <mesh filename="package://my_urdf_tutorial/meshes/lidar.dae"/>
            </geometry>
            <material name="white">
                <color rgba="1 1 1 1"/>
            </material>
        </visual>
        <collision>
            <origin xyz="0 0 0" rpy="0 0 0"/>
            <geometry>
                <mesh filename="package://my_urdf_tutorial/meshes/lidar.dae"/>
            </geometry>
        </collision>
        <inertial>
            <origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/>
            <mass value="0.25"/>
            <inertia ixx="0.00017916666666666667" ixy="0.0" ixz="0.0" iyy="0.00017916666666666667" iyz="0.0" izz="0.000225"/>
        </inertial>
    </link>

    <joint name="laser_sensor_base_link_joint" type="fixed">
        <origin xyz="0.175 0.0 0.045" rpy="0 0 0"/>
        <parent link="base_link"/>
        <child link="laser"/>
    </joint>

</robot>

Asked by Irudhaya on 2019-11-17 11:27:07 UTC

Comments

Hi, were you able to solve this? I am facing the same issue.

Asked by cygnus on 2022-01-11 14:09:53 UTC

Answers