Skip to content

Odometry drift caused by acceleration drift removal in relative mode #846

@rokusottervanger

Description

@rokusottervanger

The following piece of code (introduced in #753), causes my odometry state to drift due to a nonzero resulting acceleration vector after removing the gravitational acceleration.

if (!relative) {
// curAttitude is the true world-frame attitude of the sensor
rotNorm = trans.getBasis().inverse() * normAcc;
} else {
// curAttitude is relative to the initial pose of the sensor.
// Assumption: IMU sensor is rigidly attached to the base_link
// (but a static rotation is possible).
rotNorm = target_frame_trans.getBasis().inverse() * trans.getBasis().inverse() * normAcc;
}

My r_l configuration is as follows

  frequency: 10.0
  print_diagnostics: true
  base_link_frame: "base_link"
  world_frame: "odom"

  transform_time_offset: 0
  two_d_mode: false
  publish_tf: true
  smooth_lagged_data: true
  history_length: 5

  odom0: encoder_odom
  odom0_nodelay: true
  odom0_config: [false, false, false,   # X,Y,Z,
                false, false, false,  # roll,pitch,yaw,
                true,  true,  true,  # X`,Y`,Z`
                false, false, false,   # roll`,pitch`,yaw`,
                false, false, false]  # X``,Y``,Z``

  imu0: imu/data
  imu0_queue_size: 20
  imu0_remove_gravitational_acceleration: true
  imu0_nodelay: true
  imu0_relative: true
  imu0_config: [false, false, false,  # X,Y,Z,
                true,  true,  true,   # roll,pitch,yaw,
                false, false, false,  # X`,Y`,Z`,
                true,  true,  true,   # roll`,pitch`,yaw`,
                true,  true,  false]   # X``,Y``,Z``

I'm aware that no position data is being fused here, so odom might drift with a random walk, but I'm seeing a significant deterioration (and nonzero mean drift, so not purely random) caused by the referenced code. I'm not sure what the theory behind this piece of code is. Could someone please elaborate? @HaoguangYang maybe?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions