Robotics StackExchange | Archived questions

ekf_localization_node : Wheel odometry and IMU filter output /odometry/filtered result worst than only wheel odometry

I'm trying to filter the IMU and Odometry for better odometry result with ROS Kinetic robotlocalization ekflocalization_node. The result from topic /odometry/filtered looks even worst than the only wheel odometry result.

  1. The result of the odometry and the odometry/filtered result is shows below, the green line is the odometry/filtered result filter by ekflocalizationnode, the blue line is the robot wheel encoder odometry. I control the robot go one round, and the odometry/filtered result drift a lot. How to configure it for a better odometry/filtered

https://ibb.co/vm6HHMB

2. The ekf_localization node give me this warning

[ WARN] [1559037541.564209301]: Transform from imu to base_link was unavailable for the time requested. Using latest instead.

These are my ekflocalizationnode launch file, IMU topic, odometry topic and my ekf_localization configuration

ODOM TOPIC : /odom

header: 
  seq: 36880
  stamp: 
    secs: 1559041171
    nsecs: 825065674
  frame_id: "odom"
child_frame_id: "base_link"
pose: 
  pose: 
    position: 
      x: -11.4829724863
      y: 1.05053742504
      z: 0.0
    orientation: 
      x: -0.0
      y: 0.0
      z: 0.763262843766
      w: -0.646088098735
  covariance: [0.01, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.01, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.01, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.01, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.01, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.01]
twist: 
  twist: 
    linear: 
      x: 0.0
      y: 0.0
      z: 0.0
    angular: 
      x: 0.0
      y: 0.0
      z: 0.0
  covariance: [0.01, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.01, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.01, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.01, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.01, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.01]

imu topic : /imu_data

header: 
      seq: 79151
      stamp: 
        secs: 1559041431
        nsecs: 174880504
      frame_id: "imu"
    orientation: 
      x: -0.0113399562479
      y: 0.00536445058446
      z: 0.525673082796
      w: -0.850594167677
    orientation_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
    angular_velocity: 
      x: 1.11133271904e-83
      y: 1.4868652577e-183
      z: -1.13872042843e-82
    angular_velocity_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
    linear_acceleration: 
      x: -0.0335302734375
      y: 0.24908203125
      z: 9.87706054688
    linear_acceleration_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]

Configuration

frequency: 30
sensor_timeout: 1
two_d_mode: true
transform_time_offset: 0.3
transform_timeout: 0.0
print_diagnostics: true
debug: false
debug_out_file: /path/to/debug/file.txt
publish_tf: true
publish_acceleration: false

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

odom0: /odom

odom0_config: [false,  false,  false,
               false, false, false,
               true, true, false,
               false, false, true,
               false, false, false]

odom0_queue_size: 2
odom0_nodelay: false
odom0_differential: false
odom0_relative: false



imu0: /imu_data
imu0_config: [false, false, false,
              false, false,  true,
              false, false, false,
              false, false,  true,
              true,  false,  false]

imu0_nodelay: false
imu0_differential: false
imu0_relative: false
imu0_queue_size: 5

imu0_remove_gravitational_acceleration: true


process_noise_covariance: [0.05, 0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                           0,    0.05, 0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                           0,    0,    0.06, 0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                           0,    0,    0,    0.03, 0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                           0,    0,    0,    0,    0.03, 0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                           0,    0,    0,    0,    0,    0.06, 0,     0,     0,    0,    0,    0,    0,    0,    0,
                           0,    0,    0,    0,    0,    0,    0.025, 0,     0,    0,    0,    0,    0,    0,    0,
                           0,    0,    0,    0,    0,    0,    0,     0.025, 0,    0,    0,    0,    0,    0,    0,
                           0,    0,    0,    0,    0,    0,    0,     0,     0.04, 0,    0,    0,    0,    0,    0,
                           0,    0,    0,    0,    0,    0,    0,     0,     0,    0.01, 0,    0,    0,    0,    0,
                           0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0.01, 0,    0,    0,    0,
                           0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0.02, 0,    0,    0,
                           0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0.01, 0,    0,
                           0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0.01, 0,
                           0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0.015]


initial_estimate_covariance: [1e-9, 0,    0,    0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
                              0,    1e-9, 0,    0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
                              0,    0,    1e-9, 0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
                              0,    0,    0,    1e-9, 0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
                              0,    0,    0,    0,    1e-9, 0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
                              0,    0,    0,    0,    0,    1e-9, 0,    0,    0,    0,     0,     0,     0,    0,    0,
                              0,    0,    0,    0,    0,    0,    1e-9, 0,    0,    0,     0,     0,     0,    0,    0,
                              0,    0,    0,    0,    0,    0,    0,    1e-9, 0,    0,     0,     0,     0,    0,    0,
                              0,    0,    0,    0,    0,    0,    0,    0,    1e-9, 0,     0,     0,     0,    0,    0,
                              0,    0,    0,    0,    0,    0,    0,    0,    0,    1e-9,  0,     0,     0,    0,    0,
                              0,    0,    0,    0,    0,    0,    0,    0,    0,    0,     1e-9,  0,     0,    0,    0,
                              0,    0,    0,    0,    0,    0,    0,    0,    0,    0,     0,     1e-9,  0,    0,    0,
                              0,    0,    0,    0,    0,    0,    0,    0,    0,    0,     0,     0,     1e-9, 0,    0,
                              0,    0,    0,    0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    1e-9, 0,
                              0,    0,    0,    0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    1e-9]

Asked by jynhao_low on 2019-05-28 06:15:25 UTC

Comments

A couple things I notice off the bat (not sure any given one will fix your issue)

  • Your IMU message has no covariances, you need those.

  • If its not able to transform a static TF, you probably need to increase your robot state publisher by quite a bit until that goes away

Asked by stevemacenski on 2019-05-28 11:59:38 UTC

stevemacenski Thank you for your reply, I'm not sure about how to calculate covariances for IMU, is that any hints for that?

Asked by jynhao_low on 2019-05-29 23:08:04 UTC

Your spec sheet should contain the variances you are looking for

Asked by stevemacenski on 2019-05-30 20:12:33 UTC

My IMU is JY901B, it does provided data sheet, but I didn't see any information related to covariances.

Asked by jynhao_low on 2019-05-31 04:14:57 UTC

Answers

The first thing to check is that your IMU is actually being fused. Your IMU data is in the imu frame. Are you providing a transform somewhere from base_link->imu?

Also, try turning off yaw in your IMU config. You're fusing absolute yaw, which comes from a magnetometer, and magnetometers are notoriously erroneous.

Finally, try adjusting the process noise vs. the measurement covariance for the state variables you're fusing. Lower covariance in the measurement and higher process noise will mean that the filter trusts your sensors more. Otherwise, the filter will prefer to stick with its predictions, and, as we don't model angular acceleration, you can lose accuracy when the robot turns.

Asked by Tom Moore on 2019-06-06 01:58:11 UTC

Comments