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

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

asked 2019-05-28 06:15:25 -0500

jynhao_low gravatar image

I'm trying to filter the IMU and Odometry for better odometry result with ROS Kinetic robot_localization ekf_localization_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 ekf_localization_node, 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 ekf_localization_node 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 ...
(more)
edit retag flag offensive close merge delete

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

stevemacenski gravatar image stevemacenski  ( 2019-05-28 11:59:38 -0500 )edit

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

jynhao_low gravatar image jynhao_low  ( 2019-05-29 23:08:04 -0500 )edit

Your spec sheet should contain the variances you are looking for

stevemacenski gravatar image stevemacenski  ( 2019-05-30 20:12:33 -0500 )edit

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

jynhao_low gravatar image jynhao_low  ( 2019-05-31 04:14:57 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2019-06-06 01:58:11 -0500

Tom Moore gravatar image

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.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2019-05-28 06:15:25 -0500

Seen: 978 times

Last updated: Jun 06 '19