ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Gazebo Diff Drive Plugin Drift

asked 2023-04-24 07:48:12 -0500

themightwarrior gravatar image

I am facing issue using the gazebo differential drive controller. The robot moves however it doesn't exactly move in a straight line when I issue /cmd_vel x="0.05". The robot will start to drift gradually. Appreciate any help thanks. I have tried increasing the mass and also ensuring the inertia is not tilted. Also, when I check the /joint_states topic each of the wheel joint has slightly different position.

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

<xacro:include filename="$(find alphabot_description)/urdf/materials.xacro" />
<xacro:include filename="$(find alphabot_description)/urdf/alphabot.trans" />
<xacro:include filename="$(find alphabot_description)/urdf/alphabot.gazebo" />
<link name="base_link">
  <inertial>
    <origin xyz="3.9964129120210354e-17 -1.949783532853795e-05 0.014547668321607015" rpy="0 0 0"/>
    <mass value="0.2"/>
    <inertia ixx="0.000125" iyy="0.000266" izz="0.000389" ixy="-0.0" iyz="-0.0" ixz="0.0"/>
  </inertial>
  <visual>
    <origin xyz="0 0 0" rpy="0 0 0"/>
    <geometry>
      <mesh filename="package://alphabot_description/meshes/base_link.stl" scale="0.001 0.001 0.001"/>
    </geometry>
    <material name="blue"/>
  </visual>
  <collision>
    <origin xyz="0 0 0" rpy="0 0 0"/>
    <geometry>
      <mesh filename="package://alphabot_description/meshes/base_link.stl" scale="0.001 0.001 0.001"/>
    </geometry>
  </collision>
</link>

<link name="spacer_1_1">
  <inertial>
    <origin xyz="-8.554354349876725e-08 -2.7824964554667986e-15 0.020056162439080906" rpy="0 0 0"/>
    <mass value="0.05"/>
    <inertia ixx="1e-06" iyy="1e-06" izz="0.0" ixy="-0.0" iyz="0.0" ixz="-0.0"/>
  </inertial>
  <visual>
    <origin xyz="-0.028948 -0.04191 -0.017048" rpy="0 0 0"/>
    <geometry>
      <mesh filename="package://alphabot_description/meshes/spacer_1_1.stl" scale="0.001 0.001 0.001"/>
    </geometry>
    <material name="gold"/>
  </visual>
  <collision>
    <origin xyz="-0.028948 -0.04191 -0.017048" rpy="0 0 0"/>
    <geometry>
      <mesh filename="package://alphabot_description/meshes/spacer_1_1.stl" scale="0.001 0.001 0.001"/>
    </geometry>
  </collision>
</link>

<link name="spacer_1_2">
  <inertial>
    <origin xyz="-8.554354354040061e-08 -2.7755575615628914e-15 0.020056162439080906" rpy="0 0 0"/>
    <mass value="0.05"/>
    <inertia ixx="1e-06" iyy="1e-06" izz="0.0" ixy="-0.0" iyz="0.0" ixz="-0.0"/>
  </inertial>
  <visual>
    <origin xyz="-0.028948 0.04191 -0.017048" rpy="0 0 0"/>
    <geometry>
      <mesh filename="package://alphabot_description/meshes/spacer_1_2.stl" scale="0.001 0.001 0.001"/>
    </geometry>
    <material name="gold"/>
  </visual>
  <collision>
    <origin xyz="-0.028948 0.04191 -0.017048" rpy="0 0 0"/>
    <geometry>
      <mesh filename="package://alphabot_description/meshes/spacer_1_2.stl" scale="0.001 0.001 0.001"/>
    </geometry>
  </collision>
</link>

<link name="spacer_1_3">
  <inertial>
    <origin xyz="8.554362094723156e-08 -2.7824964554667986e-15 0.02005616243908087" rpy="0 0 0"/>
    <mass value="0.05"/>
    <inertia ixx="1e-06" iyy="1e-06" izz="0.0" ixy="-0.0" iyz="0.0 ...
(more)
edit retag flag offensive close merge delete

Comments

Could you modify this robot model so we can see it e.g. in this URDF viewer or in Foxglove Web? Maybe it will be easier to check its correctness

ljaniec gravatar image ljaniec  ( 2023-04-25 08:59:19 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2023-04-25 08:33:02 -0500

Mike Scheutzow gravatar image

There are a bunch of problems in your setup - too many for me to list them. My advice is to start with a complete, modern, working simulation that you download using apt, like the turtlebot3 one. Start here:

http://wiki.ros.org/turtlebot3_simula...

The e-Manual has step-by-step instructions for running the simulation. Then checkout the source packages and begin customizing it one step at a time, making sure each change still works.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2023-04-24 07:48:12 -0500

Seen: 175 times

Last updated: Apr 25 '23