How to fix bad odometry

asked 2020-12-04 09:19:42 -0500

lslabon gravatar image

updated 2022-05-23 09:18:42 -0500

lucasw gravatar image

Hello,

I followed the steps on the ros wiki page to check my odometry and realized when rotating the robot it is really bad.

When rotating the scans don't match at all. So I tried to figure out where my problem is... but I could not find the paramters to change..

I am working with turtlebot3 and modified the wheel width. I think I got all paramters right, so they do fit to my robot. I changed paramters for turtlebot3 core in Arduino and the URDF model. My odometry still ist kind of bad... even when I change them to something obviously wrong the odometry still looks the same. So I must be missing something.

Where do I have to change parameters that affect my odometry?

Besides: I will try to simulate my model and look whether the paramters do fit there and my odometry looks right. As soon as I understood the gazebo thing I will give an update on that, but maybe somebody can help me so far?

I am really frustrated now cause I need to get things work by time.

Thank you! Laura

Here are my codes:

robot.urdf.xacro:

    <?xml version="1.0" ?>
<robot name="turtlebot3_waffle_pi" xmlns:xacro="http://ros.org/wiki/xacro">
  <xacro:include filename="$(find turtlebot3_description)/urdf/common_properties.xacro"/>
  <xacro:include filename="$(find turtlebot3_description)/urdf/turtlebot3_waffle_pi.gazebo.xacro"/>

  <link name="base_footprint"/>

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

  <link name="base_link">
    <visual>
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <geometry>
        <box size="0.52 0.50 1.20"/>
      </geometry>
      <material name="light_black"/>
    </visual>

    <collision>
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <geometry>
        <box size="0.52 0.50 1.20"/>
      </geometry>
    </collision>

    <inertial>
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <mass value="20.00e+00"/>
      <inertia ixx="3" ixy="0" ixz="0"
               iyy="2.82" iyz="0"
               izz="0.83" />
    </inertial>
  </link>

  <joint name="sonar_bottom_right_joint" type="fixed">
    <parent link="base_link" />
    <child link="sonar_bottom_right_link" />
    <origin xyz="0.26 -0.16 -0.51" rpy="0 0 0" />
  </joint>

  <link name="sonar_bottom_right_link">
    <visual>
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <geometry>
        <box size="0.005 0.05 0.05"/>
      </geometry>
      <material name="blue"/>
    </visual>

    <collision>
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <geometry>
        <box size="0.005 0.05 0.05"/>
      </geometry>
    </collision>

    <inertial>
      <origin xyz="0 0 0" />
      <mass value="1.8498940e-02" />
      <inertia ixx="0.1175580e-05" ixy="-3.2369783e-11" ixz="-4.9381719e-09"
               iyy="0.1192413e-05" iyz="-0.4400107e-11"
               izz="0.0712558e-05" />
      </inertial>
  </link>

  <joint name="sonar_bottom_left_joint" type="fixed">
    <parent link="base_link" />
    <child link="sonar_bottom_left_link" />
    <origin xyz="0.26 0.16 -0 ...
(more)
edit retag flag offensive close merge delete

Comments

Could you please share the link to the wiki page you mention, describe what nodes you launch and share the relevant launch and config files? Do so by editing your question and paste the code as text, using the preformatted text button (101010). Thanks

mgruhler gravatar image mgruhler  ( 2020-12-04 09:31:39 -0500 )edit

I do not see "wheel width" in your file. Which parameter did you change? "Wheel width" could refer to the width of a single wheel or to the spacing between wheels. The former doesn't affect odometry, but the latter does--assuming a differential drive, which a TurtleBot3 has.

tryan gravatar image tryan  ( 2020-12-04 11:36:54 -0500 )edit

I did change the Wheel width in arduino... I think it did not make anything better, but I will try by setting it to something stupid tomorrow

lslabon gravatar image lslabon  ( 2020-12-07 05:01:23 -0500 )edit

I realized odometry isn't the problem.. When I compare odometry topic output with teleoperation I realized there is no difference..

lslabon gravatar image lslabon  ( 2020-12-12 06:51:07 -0500 )edit