robot_localization drift when using simulated roll and pitch
I am seeing a large drift in the position output (from local pose) of the robot when using a setup with a simulated imu and wheel encoder. I am using the robot_localization package to generate the local pose. In this same setup, if I set two_d_mode
provided by robot_localization, I do not see this drift anymore. I would like to not zero out the roll and pitch by setting it to 2d mode. Any advice on how to fix this will be of great help to me. I have added the information corresponding to my setup below.
This is my robot_localization EKF config
map_frame: map
odom_frame: odom
base_link_frame: base_footprint
world_frame: odom
debug: true
debug_out_file: localization_log.txt
reset_on_time_jump: true
dynamic_process_noise_covariance: true
print_diagnostics: true
publish_acceleration: false
transform_timeout: 0.0
two_d_mode: false
publish_tf: true
frequency: 30
predict_to_current_time: true
transform_time_offset: 0.1
odom0: $(arg wheel_odom_topic)
odom0_config: [false, false, true, # X, Y, Z
false, false, false, # roll, pitch, yaw
true, true, false, # X_dot, Y_dot, Z_dot
false, false, false, # roll_dot, pitch_dot, yaw_dot
false, false, false] # X_ddot, Y_ddot, Z_ddot
odom0_relative: false
odom0_nodelay: true
imu0: /$(arg robot_name)/filter_kvh_imu
imu0_config: [false, false, false, # X, Y, Z
true, true, true, # roll, pitch, yaw
false, false, false, # X_dot, Y_dot, Z_dot
false, false, false, # roll_dot, pitch_dot, yaw_dot
false, false, false] # X_ddot, Y_ddot, Z_ddot
imu0_nodelay: true
imu0_relative: true
imu0_differential: false
imu0_remove_gravitational_acceleration: true
Example IMU message
header:
seq: 765
stamp:
secs: 18
nsecs: 100000000
frame_id: "recbot0/imu_link"
orientation:
x: 0.000235189927955
y: 0.00639060403184
z: 2.23457272268e-06
w: 0.999979552221
orientation_covariance: [1.0412328196584754e-10, 0.0, 0.0, 0.0, 1.0412328196584754e-10, 0.0, 0.0, 0.0, 1e-08]
angular_velocity:
x: 0.0
y: 0.0
z: 0.0
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.125464739637
y: 0.0044842163957
z: 9.79935998913
linear_acceleration_covariance: [1e-08, 0.0, 0.0, 0.0, 1e-08, 0.0, 0.0, 0.0, 1e-08]
Example wheel odom message
header:
seq: 2086
stamp:
secs: 114
nsecs: 234000000
frame_id: "recbot0/base_footprint"
child_frame_id: "recbot0/base_footprint"
pose:
pose:
position:
x: 0.0
y: 0.0
z: 0.0
orientation:
x: 0.0
y: 0.0
z: 0.0
w: 1.0
covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
twist:
twist:
linear:
x: 1.49129708582e-10
y: 0.0
z: 0.0
angular:
x: 0.0
y: 0.0
z: 0.0
covariance: [0.001, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ...
why do you even want to include roll and pitch? Does your robot drive on an uneven surface?
Other than that you are only giving data to roll and pitch from the imu and no other sensor. If you want to have roll and pitch in there i would assume that you need at least two sensors to measure the same. Then you could use the differential option so you can remove the noise.
I have never done this myself but i would probably mount two imu's in opposite orientations and map them to apply to rep 105 afterwards. This could help you with removing mounting errors like a crooked base plate.