Ask Your Question

how to prevent wheel drift happening by fusing IMU and Odometry

asked 2022-03-30 11:57:38 -0500

Maven Cheong gravatar image

updated 2022-03-30 12:00:01 -0500

Hi, I'm currently trying to use robot_localization package to help me solve the wheel drifting issue for my mobile robot. Currently i'm trying to fuse IMU and Odometry from diff_drive_controller package using the robot_localization package.

I tried to follow this video.

However after fuse, the new filtered odom still showing the robot moving forward or backward even the real robot itself is not moving (i make the robot floating). The rotation seem working fine, just the forward and backward is not working.

How to I configure it so that the odom is not moving when the actual robot is not moving from it position?

these are my configuration for the robot_localization

frequency: 10
two_d_mode: true
publish_tf: true
odom_frame: odom
base_link_frame: base_footprint
world_frame: odom
map_frame: map

    odom0: /diff_drive_controller/odom
    odom0_config: [false, false, false,
                   false, false, false,
                   true,  true,  false,
                   false, false, true,
                   false, false, false,]
    odom0_differential: false

    imu0: /imu/data
    imu0_config: [false, false, false,
                  false, false, false,
                  false, false, false,
                  false, false, true,
                  true,  false, false,]
    imu0_differential: false
edit retag flag offensive close merge delete


Did you figured out a way to fix this? I've watched the same video and tried a lot of configurations, those are my configs:

frequency: 30 two_d_mode: true print_diagnostics: true publish_tf: true

map_frame: map
odom_frame: odom
base_link_frame: base_link world_frame: odom

odom0: /odom odom0_config: [false, false, false, false, false, true, true, true, false, false, false, true, false, false, false] odom0_differential: false

imu0: /imu_data imu0: /imu_data imu0_config: [false, false, false, #pose x y z false, false, true, #row pitch yaw true, true, false, #vel x y z false, false, true, #vel row pitch yaw true, false, false] #acc x y z imu0_differential: true

Sometimes it cant hold the wheel drift, but the odometry looks pretty good right now!

kaioerg gravatar image kaioerg  ( 2022-05-12 12:30:29 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2022-05-15 10:25:51 -0500

Maven Cheong gravatar image

nope, still didn't work for me. I belive if due to my odom issue. I'm using diff_drive_controller but could the the motor encoder values that i provide to the library having wrong calculations.

However, i change my setup , instead of using Motor Encoder to get the position, instead, i'm adding additional two rotary encoder instead.

Meaning two motor with encoder buildin and two rotary encoder.

The motor encoder are purely for controlling the motor speed, no longer use for calculating position. While rotary encoder are purely for calculating position instead.

With these setup, it kind of solving the drift issue.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2022-03-30 11:57:38 -0500

Seen: 80 times

Last updated: May 15