cra-ros-pkg / robot_localization

robot_localization is a package of nonlinear state estimation nodes. The package was developed by Charles River Analytics, Inc. Please ask questions on answers.ros.org.
http://www.cra.com
Other
1.31k stars 863 forks source link

Discrepancy between setting first value of covariance to -1 and disabling orientation parameters in IMU configuration #860

Open mjpc13 opened 6 months ago

mjpc13 commented 6 months ago

I have observed a discrepancy between two approaches in configuring robot_localization. When setting the first value of the covariance of a sensor_msgs/Imu message to -1 (which should neglect the orientation measurement), and alternatively, when disabling the orientation parameters in the configuration file.

From my understanding, shouldn't these two approaches be equal?

my launch file (with covariance having the -1):

imu0: "/imu_corrected" 

imu0_config:
  [
    false, #x
    false, #y
    false, #z
    true, #roll
    true, #pitch
    true, #yaw
    false, #velocity x
    false, #velocity y
    false, #velocity z
    false, #velocity roll
    false, #velocity pitch
    false, #velocity yaw
    true, #acceleration x
    false, #acceleration y
    true #acceleration z
  ] 

imu0_differential: false
imu0_relative: false
imu0_remove_gravitational_acceleration: true

odom0: "/odometry/icp/back"
#The order of the values is x, y, z, roll, pitch, yaw, vx, vy, vz, vroll, vpitch, vyaw, ax, ay, az.
odom0_config:
  [
    false,
    false,
    false,
    false,
    false,
    false,
    true,
    true,
    true,
    true,
    true,
    true,
    false,
    false,
    false
  ]

odom0_differential: true
odom0_relative: false

my launch file (with non -1 covariances):

imu0: "/imu_raw" 

imu0_config:
  [
    false, #x
    false, #y
    false, #z
    false, #roll
    false, #pitch
    false, #yaw
    false, #velocity x
    false, #velocity y
    false, #velocity z
    false, #velocity roll
    false, #velocity pitch
    false, #velocity yaw
    true, #acceleration x
    false, #acceleration y
    true #acceleration z
  ] 

imu0_differential: false
imu0_relative: false
imu0_remove_gravitational_acceleration: true

[...]

I am running ROS noetic.

ayrton04 commented 6 months ago

Can you explain what discrepancy you are observing? You said the approaches are not equal, but didn't provide an example of what makes you say so.

mjpc13 commented 6 months ago

Results from evo tool

Setting the first covariance value to -1: rl_covariance_-1

Setting the orientations in the config to false: rl_orientation_false

My question is, why is there a difference between the 2 results? Neither configuration should use the orientations, right?

Perhaps one configuration utilizes orientations to remove the gravity vector, while the other does not?

davidbsp commented 5 months ago

Hi @ayrton04, would you expect there to be a difference by design in these 2 situations?

ayrton04 commented 5 months ago

I would expect them to behave the same, but I don't have the cycles to investigate why they're not. We'll soon be deprecating this package in favour of fuse, so while I will accept a PR to correct any errant behaviour, I won't be addressing issues unless they are severe.