unable to turn robot skid steer drive?

asked 2021-04-28 09:50:01 -0500

harish556 gravatar image

updated 2021-04-29 11:29:13 -0500

I am using skid_steer_drive and I am able to move forward and backward without any problem but when coming to left or right it stuck or rotates 90 degrees and stops.

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

   <!-- Define used colors -->
  <material name="black">
    <color rgba="0.0 0.0 0.0 1.0"/>
  </material>
  <material name="blue">
    <color rgba="0.203125 0.23828125 0.28515625 1.0"/>
  </material>
  <material name="green">
    <color rgba="0.0 0.8 0.0 1.0"/>
  </material>
  <material name="grey">
    <color rgba="0.2 0.2 0.2 1.0"/>
  </material>
  <material name="orange">
    <color rgba="1.0 0.423529411765 0.0392156862745 1.0"/>
  </material>
  <material name="brown">
    <color rgba="0.870588235294 0.811764705882 0.764705882353 1.0"/>
  </material>
  <material name="red">
    <color rgba="0.80078125 0.12890625 0.1328125 1.0"/>
  </material>
  <material name="white">
    <color rgba="1.0 1.0 1.0 1.0"/>
  </material>  


  <!-- Define color for robot parts -->
  <gazebo reference="link_chassis">
    <material>Gazebo/Orange</material>
  </gazebo>
  <gazebo reference="link_left_wheel">
    <material>Gazebo/Blue</material>
  </gazebo>
  <gazebo reference="link_right_wheel">
    <material>Gazebo/Blue</material>
  </gazebo>

     <gazebo>
        <plugin name="skid_steer_drive_controller" filename="libgazebo_ros_skid_steer_drive.so">
            <updateRate>100.0</updateRate>
            <robotNamespace>/</robotNamespace>
            <leftFrontJoint>joint_front_left_wheel</leftFrontJoint>
            <rightFrontJoint>joint_front_right_wheel</rightFrontJoint>
            <leftRearJoint>joint_rear_left_wheel</leftRearJoint>
            <rightRearJoint>joint_rear_right_wheel</rightRearJoint>
            <wheelSeparation>0.4</wheelSeparation>
            <wheelDiameter>0.2</wheelDiameter>
            <robotBaseFrame>link_chassis</robotBaseFrame>
            <torque>150</torque>
            <topicName>cmd_vel</topicName>
            <broadcastTF>false</broadcastTF>
            <commandTopic>cmd_vel</commandTopic>
            <odometryTopic>odm</odometryTopic>
            <odometryFrame>odm</odometryFrame>
            <covariance_x>0.000100</covariance_x>
            <covariance_y>0.000100</covariance_y>
            <covariance_yaw>0.010000</covariance_yaw>
        </plugin>

     </gazebo>

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

  <link name="link_chassis">
    <!-- pose and inertial -->
    <pose>0 0 0.1 0 0 0</pose>
    <inertial>
      <mass value="20"/>
      <origin rpy="0 0 0" xyz="0 0 0.1"/>
      <inertia ixx="0.0395416666667" ixy="0" ixz="0" iyy="0.106208333333" iyz="0" izz="0.106208333333"/>
    </inertial>
    <!-- body -->
    <collision name="collision_chassis">
      <geometry>
        <box size="0.6 0.4 0.07"/>
      </geometry>
    </collision>
    <visual>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <geometry>
        <box size="0.6 0.4 0.07"/>
      </geometry>
      <material name="blue"/>
    </visual>
  </link>

<!-- rear right wheel -->
  <link name="link_rear_right_wheel">
    <inertial>
      <mass value="0.2"/>
      <origin rpy="0 1.5707 1.5707" xyz="0 0 0"/>
      <inertia ixx="0.000526666666667" ixy="0" ixz="0" iyy="0.000526666666667" iyz="0" izz="0.001"/>
    </inertial>
    <collision name="link_rear_right_wheel_collision">
      <origin rpy="0 1.5707 1.5707" xyz="0 0 0"/>
      <geometry>
        <cylinder length="0.04" radius="0.1"/>
      </geometry>

    </collision>
    <visual name="link_rear_right_wheel_visual">
      <origin rpy="0 1.5707 1.5707" xyz="0 0 0"/>
      <geometry>
        <cylinder length="0.04" radius="0.1"/>
      </geometry> ...
(more)
edit retag flag offensive close merge delete