I am trying to fuse IMU and GPS with the help of robot_localization pkg. I might also fuse encoder data in the future. I get this weird jumping in odometry in rviz. I get that GPS is published every second and it "corrects" odometry. But why the huge drift in the first place.
Here's config for fusion:
frequency: 20.0
sensor_timeout: 0.01
two_d_mode: true
publish_acceleration: true
publish_tf: true
map_frame: map # Defaults to "map" if unspecified
odom_frame: odom # Defaults to "odom" if unspecified
base_link_frame: base_link # Defaults to "base_link" if unspecified
world_frame: odom # Defaults to the value of odom_frame if unspecified
odom0: odometry/gps
odom0_config: [ true, true, true, # [x, y, z]
false, false, false, # [roll, pitch, yaw]
false, false, false, # [x_vel, y_vel, z_vel]
false, false, false, # [roll_vel, pitch_vel, yaw_vel]
false, false, false] # [x_accel, y_accel, z_accel]
odom0_differential: false
odom0_queue_size: 5
imu0: imu/data
imu0_config: [false, false, false, # [x, y, z]
true, true, true, # [roll, pitch, yaw]
false, false, false, # [x_vel, y_vel, z_vel]
false, false, true, # [roll_vel, pitch_vel, yaw_vel]
true, true, false] # [x_accel, y_accel, z_accel]
imu0_differential: false
imu0_queue_size: 5
imu0_remove_gravitational_acceleration: true
It's not on gif repeat it is actually jumping back every second.