Robotics StackExchange | Archived questions

Wheel slippery, wrong direction and not straight

Hi,

created a differential drive robot with a ball caster. Tried to set mu1 and mu2 values of the wheels to values >1 and <1 for the caster. But the robot stands still and the wheels are slipping. Sometimes it moves slowly around the caster.

You may find the xacro files here: Robot definition

Thanks for your help and any ideas.

UPDATE: Tried to add a fixed joint with a link of a box with mass of 10. (idea was to get more weight on the wheels - just a stupid idea because of frustration :) ) -> nothing changed. Bot seems to be fixed around the caster and the wheels spin around and are slipping.

Anybody any advise?

UPDATE 2: I just recognized that the wheels are turning backwards when i use the i key in teleop. I changed the wheel separation parameter in the differencial drive plugin for gazebo. Robot now moves a little bit but really strange, it not moves straight forward ihr backward. It slips sidewise. See video. video

BR Marco

Update: Added content of xacro files:

hallrover_v2.xacro

<?xml version="1" ?>
<robot name="hallrover_v2" xmlns:xacro="http://www.ros.org/wiki/xacro">
  <xacro:property name="hallrover_body_width" value="0.20"/>
  <xacro:property name="hallrover_body_length" value="1.50"/>
  <xacro:property name="hallrover_body_heigth" value="0.10"/>
  <xacro:property name="hallrover_frame_heigth" value="0.05"/>
  <xacro:property name="hallrover_frame_width" value="1.34"/>
  <!-- - roller_length*2 + roller_body_space*2 + hallrover_body_width + hallrover_frame_thick*2 -->
  <xacro:property name="hallrover_frame_length" value="1.50"/>
  <xacro:property name="hallrover_frame_thick" value="0.05"/>
  <!-- hallrover_frame_height -->
  <xacro:property name="roller_length" value="0.50"/>
  <xacro:property name="roller_diam" value="0.25"/>
  <xacro:property name="roller_body_space" value="0.02"/>

  <!-- Import all Gazebo-customization elements, including Gazebo colors -->
  <xacro:include filename="$(find hallrover_v2)/urdf/hallrover_v2.gazebo"/>

 <xacro:include filename="$(find hallrover_v2)/urdf/makros.xacro"/>
 <gazebo>
   <material>Gazebo/White</material>
 </gazebo>

  <link name="base_footprint">
   <visual>
      <origin xyz="0 0 0" rpy="0 0 0" />
      <geometry>
        <box size="0.001 0.001 0.001" />
      </geometry>
    </visual>
  </link>
  <joint name="base_joint" type="fixed">
    <parent link="base_footprint"/>
    <child link="base_link"/>
   <origin xyz="0 0 ${roller_diam}" rpy="0 0 0" />
  </joint>

  <gazebo reference="base_footprint">
    <mu1 value="0.01"/>
    <mu2 value="0.01"/>
      <fdir1 value="1 1 0"/>
    <material>Gazebo/White</material>
  </gazebo>

  <link name="base_link">
    <visual>
      <geometry>
        <box size="${hallrover_body_width} ${hallrover_body_length} ${hallrover_body_heigth}"/>
      </geometry>
      <origin xyz="0 0 0"/>
      <material name="white">
        <color rgba="1 1 1 1"/>
      </material>
    </visual>
    <collision>
      <geometry>
        <box size="${hallrover_body_width} ${hallrover_body_length} ${hallrover_body_heigth}"/>
       <!-- TODO change size to hallrover frame -->
      </geometry>
    </collision>
    <!-- <xacro:box_inertia m="10" x="${hallrover_body_width}" y="${hallrover_body_length}" z="${hallrover_body_heigth}"/>-->
    <xacro:box_inertial mass="2" x="${hallrover_body_width}" y="${hallrover_body_length}" z="${hallrover_body_heigth}"/>
  </link>
  <gazebo reference="base_link">
    <mu1 value="0.01"/>
    <mu2 value="0.01"/>
      <fdir1 value="1 1 0"/>
    <material>Gazebo/White</material>
  </gazebo>

 <xacro:include filename="$(find hallrover_v2)/urdf/hallrover_rollers_v2.xacro"/>

hallroverrollersv2.xacro

<?xml version="1" ?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro">

<link name="roller_left">
    <visual>
      <geometry>
        <cylinder length="${roller_length}" radius="${roller_diam /2}"/>
      </geometry>
      <origin rpy="0 ${pi/2} 0" xyz="0 0 0"/>
      <material name="black">
        <color rgba="0 0 0 1"/>
      </material>
    </visual>
    <collision>
      <geometry>
        <cylinder length="${roller_length}" radius="${roller_diam /2}"/>
      </geometry>
      <origin rpy=" 0 ${pi/2}  0" xyz="0 0 0"/>
    </collision>
    <xacro:cylinder_inertial mass="1" radius="${roller_diam /2}" length="${roller_length}"/>
  </link>
  <gazebo reference="roller_left">
    <mu1 value="100000000.0"/>
    <mu2 value="100000000.0"/>
    <kp value="10000000.0"/>
    <kd value="1.0"/>
    <fdir1 value="1 0 0"/>
    <material>Gazebo/Black</material>
  </gazebo>
  <joint name="body_to_roller_left" type="continuous">
    <parent link="base_link"/>
    <child link="roller_left"/>
    <axis rpy="0 0 0" xyz=" 1 0 0"/>
    <origin rpy="0 0 0" xyz="-${roller_body_space + roller_length /2 + hallrover_body_width /2} -${hallrover_body_length / 2 - roller_diam /2}  -${roller_diam / 2 }"/>
    <limit effort="100" velocity="100"/>
    <!-- <joint_properties damping="0.0" friction="0.0"/> -->
  </joint>


<link name="roller_right">
    <visual>
      <geometry>
        <cylinder length="${roller_length}" radius="${roller_diam /2}"/>
      </geometry>
      <origin rpy="0 ${pi/2} 0" xyz="0 0 0"/>
      <material name="black">
        <color rgba="0 0 0 1"/>
      </material>
    </visual>
    <collision>
      <geometry>
        <cylinder length="${roller_length}" radius="${roller_diam /2}"/>
      </geometry>
      <origin rpy="0 ${pi/2} 0" xyz="0 0 0"/>
    </collision>
    <xacro:cylinder_inertial mass="1" radius="${roller_diam /2}" length="${roller_length}"/>
  </link>
  <gazebo reference="roller_right">
    <mu1 value="100000000.0"/>
    <mu2 value="100000000.0"/>
    <kp value="10000000.0"/>
    <kd value="1.0"/>
    <fdir1 value="1 0 0"/>
    <material>Gazebo/Black</material>
  </gazebo>
  <joint name="body_to_roller_right" type="continuous">
    <parent link="base_link"/>
    <child link="roller_right"/>
    <axis rpy="0 0 0" xyz=" 1 0 0"/>
    <origin rpy="0 0 0" xyz="${roller_body_space + roller_length /2 + hallrover_body_width /2} -${hallrover_body_length / 2 - roller_diam /2}  -${roller_diam / 2 }"/>
    <limit effort="100" velocity="100"/>
    <!-- <joint_properties damping="0.0" friction="0.0"/> -->
  </joint>


<link name="front_roller">
      <visual>
        <geometry>
          <sphere radius="${roller_diam /2 }"/>
        </geometry>

        <material name="black">
          <color rgba="0 0 0 1"/>
        </material>
      </visual>
      <collision>
        <geometry>
          <sphere radius="${roller_diam /2 }"/>
        </geometry>
      </collision>
        <xacro:sphere_inertial mass="0.2" radius="${roller_diam /2 }"/>
    </link>
    <joint name="front_roller_to_body" type="fixed">
      <parent link="base_link"/>
      <child link="front_roller"/>
       <origin xyz="0 ${hallrover_body_length /2 - roller_diam /2} -${roller_diam/2}"/>
         <joint_properties damping="0.0" friction="0.0"/>
    </joint>
    <gazebo reference="front_roller">
      <mu1 value="0.01"/>
      <mu2 value="0.01"/>
        <fdir1 value="1 1 0"/>
        <kd value="1.0"/>
      <material>Gazebo/Black</material>
    </gazebo>


</robot>

makros.xacro

<?xml version="1" ?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro">

  <!-- see https://secure.wikimedia.org/wikipedia/en/wiki/List_of_moment_of_inertia_tensors -->

  <!-- #################### versions without origin #################### -->
  <xacro:macro name="sphere_inertial" params="radius mass">
    <inertial>
      <mass value="${mass}" />
      <origin xyz="0 0 0" />
      <inertia ixx="${0.4 * mass * radius * radius}" ixy="0.0" ixz="0.0"
        iyy="${0.4 * mass * radius * radius}" iyz="0.0"
        izz="${0.4 * mass * radius * radius}" />
    </inertial>
  </xacro:macro>

  <xacro:macro name="cylinder_inertial" params="radius length mass">
    <inertial>
      <mass value="${mass}" />
      <origin xyz="0 0 0" />
      <inertia ixx="${0.0833333 * mass * (3 * radius * radius + length * length)}" ixy="0.0" ixz="0.0"
        iyy="${0.0833333 * mass * (3 * radius * radius + length * length)}" iyz="0.0"
        izz="${0.5 * mass * radius * radius}" />
    </inertial>
  </xacro:macro>

  <xacro:macro name="box_inertial" params="x y z mass">
    <inertial>
      <mass value="${mass}" />
      <origin xyz="0 0 0" />
      <inertia ixx="${0.0833333 * mass * (y*y + z*z)}" ixy="0.0" ixz="0.0"
        iyy="${0.0833333 * mass * (x*x + z*z)}" iyz="0.0"
        izz="${0.0833333 * mass * (x*x + y*y)}" />
    </inertial>
  </xacro:macro>

</robot>

hallrover_v2.gazebo

<?xml version="1.0"?>
<robot>

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

<gazebo>
  <plugin name="differential_drive_controller" filename="libgazebo_ros_diff_drive.so">
    <alwaysOn>true</alwaysOn>
      <legacyMode>false</legacyMode>
    <updateRate>100.0</updateRate>
    <leftJoint>body_to_roller_left</leftJoint>
    <rightJoint>body_to_roller_right</rightJoint>
    <wheelSeparation>${roller_body_space*2+hallrover_body_width}</wheelSeparation>
    <wheelDiameter>${roller_diam}</wheelDiameter>
    <torque>20</torque>
    <commandTopic>cmd_vel</commandTopic>
    <odometryTopic>odom</odometryTopic>
    <odometryFrame>odom</odometryFrame>
    <robotBaseFrame>base_footprint</robotBaseFrame>
    <wheelAcceleration>1.8</wheelAcceleration>
    <broadcastTF>1</broadcastTF>
    <publishTf>1</publishTf>
  </plugin>
</gazebo>

</robot>

launch file - hallroverv2gazebo.launch

<?xml version="1.0" ?>
<!-- roslaunch  hallrover_v2 hallrover_v2_gazebo.launch -->
<!-- rosrun teleop_twist_keyboard teleop_twist_keyboard.py -->

<launch>
    <include file="$(find gazebo_ros)/launch/empty_world.launch">
    <arg default="false" name="paused"/>
    <arg default="true" name="use_sim_time"/>
    <arg default="true" name="gui"/>
    <arg default="false" name="headless"/>
    <arg default="false" name="debug"/>
  </include>

    <arg name="model" />
    <arg name="gui" default="False" />
    <!-- <param name="robot_description" textfile="$(arg model)" /> -->
    <param name="robot_description" command="$(find xacro)/xacro.py '$(find hallrover_v2)/urdf/hallrover_v2.xacro'" />
    <param name="use_gui" value="$(arg gui)" />

    <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" ></node>
    <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" />
    <node name="rviz" pkg="rviz" type="rviz" args="-d $(find hallrover_v2)/urdf.rviz" />

    <!-- Spawn a robot into Gazebo -->
    <node args="-param robot_description -urdf -model hallrover_v2" name="spawn_urdf" pkg="gazebo_ros" type="spawn_model"/>


</launch>

Asked by Boregard on 2018-02-21 15:25:27 UTC

Comments

Could you please update your question with the contents of the xacro files? That way the question will be self-contained (should your files disappear from your Dropbox) and currently we have to download your files to view them.

Asked by jayess on 2018-02-21 16:02:36 UTC

Sure, thanks for advise. File content was added. BR Marco

Asked by Boregard on 2018-02-21 16:10:45 UTC

@jayess @Boregard Did you find the fix for the robot moving backward rather than forward on "i" key press of teleop_twist_keyboard ?

Asked by the3kr on 2019-03-18 04:28:26 UTC

Answers