robot localization 2d model gets worse after adding imu yaw rate

asked 2022-08-31 20:46:07 -0500

jay91214 gravatar image

updated 2022-09-21 03:37:44 -0500

Hi all,

I have been struggling with improving the localization of my mecanum-driven AGV with wheel encoder and imu using robot_localization package. The background is that I have already been aware that the wheel encoder is quite accurate at least for a short period of time and I want to make it more reliable by adding the imu yaw rate data. The problem is when only fusing wheel encoder odometry gets reasonable result, but if I add the imu yaw rate into the filter, the topic /odometry/filtered/position/y starts to drift very quickly which is totally unacceptable.

I have done some experiments which makes AGV start from a specific location and reset the encoder in order to align the odom frame and base_link frame, and then move according to a pre-planed route with the aid of AMCL. In this way, I can start the filter with zero initial state, at least I think so.

In addition, I did some IMU calibration by rotating the IMU through N full rotations in y axis, manually integrate the velocities, and calculate the final error, and then back out the values from that, like Tom proposed

BTW, the imu frame has the y-axis transformed into z-axis on base_link frame, here is the transformation

At time 0.000
- Translation: [0.524, 0.012, 0.374]
- Rotation: in Quaternion [-0.500, 0.500, -0.500, 0.500]
        in RPY (radian) [-1.571, -0.000, -1.571]
        in RPY (degree) [-90.000, -0.000, -90.000]

The data from the calibrated IMU shows here: https://drive.google.com/file/d/1tIsG...

If there are any suggestions for the improvement of my task, I would be very appreciative. Thanks in advance.

Here is the result of fusing only encoder https://drive.google.com/file/d/1jXOp...

Here is the result of adding imu yaw rate https://drive.google.com/file/d/1ka3N...

Here is my ekf_template.yaml

frequency: 40
silent_tf_failure: false
silent_tf_failure: false
sensor_timeout: 0.1
two_d_mode: true
transform_time_offset: 0.0
transform_timeout: 0.0
print_diagnostics: true
debug: false
publish_tf: false
publish_acceleration: false
permit_corrected_publication: false


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

odom0: /odom
odom0_config: [false,false,false,
              false,false,true,
              true,true,false,
              false,false,false,
              false,false,false]
odom0_queue_size: 10
odom0_nodelay: false
odom0_differential: false
odom0_relative: false

imu0: /d435_front/imu_cov
imu0_config: [false, false, false,
              false,false,false,
              false,false,false,
              false,true,false,
              false,false,false]      
imu0_nodelay: false
imu0_differential: false
imu0_relative: false
imu0_queue_size: 2
imu0_remove_gravitational_acceleration: true

use_control: false
stamped_control: false
control_timeout: 0.2
control_config: [true, false, false, false, false, true]
acceleration_limits: [1.3, 0.0, 0.0, 0.0, 0.0, 3.4]
deceleration_limits: [1.3, 0.0, 0.0, 0.0, 0.0, 4.5]
acceleration_gains: [0.8, 0.0, 0.0, 0.0, 0.0, 0.9]
deceleration_gains: [1.0, 0.0, 0.0, 0.0, 0.0, 1.0]


initial_state: [0.0, 0.0, 0.0,
                0.0, 0.0, 0.0,
                0.0, 0.0, 0.0,
                0.0, 0 ...
(more)
edit retag flag offensive close merge delete

Comments

Can you try running the robot in only x direction and record data. Then running in only y direction and record data and then at 45 degree and record data. Then we would want to find if there is any pattern to this covaiance growth

tomarRobin gravatar image tomarRobin  ( 2022-09-21 01:14:31 -0500 )edit

Hello Tomar, thanks for replying my question, but I don't get the point. Do you mean record the odometry/filtered and check the covariance_x, covariance_y growth pattern? Can you explain a little bit to me what pattern can I tell from the covariance and what it means wrt the motion?

jay91214 gravatar image jay91214  ( 2022-09-21 03:31:02 -0500 )edit

You mentioned your y position starts to drift, I wanted to clarify that does this happens all the time

  1. When robot is stationary
  2. When moving along x only
  3. When moving along y only
tomarRobin gravatar image tomarRobin  ( 2022-09-21 09:04:55 -0500 )edit