robot_localization odom->base_link generation from encoder, particle filter, imu
Hello.
I'm confused by how to use robot_localization to generate the odom->base_link transformation correctly.
My setup is a 4 wheeled robot, and I have 3D pose (with orientation) from my global localisation particle filter (PF), which generates the map->odom transformation, though with some delay and at a low rate, which is why I want to use robot_localization to generate a continuous/smooth pose using my wheel encoders + imu + maybe my PF pose using the "smooth_lagged_data" setting.
I've tried reading previous discussions and came up with the following robot_localization yaml config which can be found at the bottom of the post [I increased the process noise covariance of the velocity terms as I found my wheel encoder odoms quite accurate]
The issue I'm facing is that the odom->base_link transform that robot_localization is generating is now based off the initial location of the odom, but my odom frame is also moving because it is being updated by my PF. Hence, my map -> base_link frame is moving at twice the actual velocity, as both the map->odom (from PF) and odom->base_link (from robot_localization) transforms move. I would have thought that the odom->base_link transform ought to "reset" to 0 whenever the map->odom tf is updated (along with the pose covariances, which in my current case grow unbounded as I don't take the pose directly but the differential). What am I doing wrong here?
Thank you!
robot_localisation.yaml
frequency: 50
silent_tf_failure: false
sensor_timeout: 0.1
two_d_mode: false
transform_time_offset: 0.0
transform_timeout: 0.0
print_diagnostics: true
debug: false
debug_out_file: /path/to/debug/file.txt
publish_tf: true
publish_acceleration: false
permit_corrected_publication: false
smooth_lagged_data: true
# History length in seconds that must be kept to smooth lagged data
history_length: 3
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
## Generates the transform between odom_frame and base_link_frame in /tf
world_frame: odom # Defaults to the value of odom_frame if unspecified
# Wheel encoder - only gives vx and yaw rate, but I notice vy/vz go crazy sometimes, and they're normally 0 anyway (unless theres a gentle slope/ramp, which I rely on the orientation from pose0 to correct)
odom0: odom
odom0_config: [false, false, false,
false, false, false,
true, true, true,
true, true, true,
false, false, false]
odom0_queue_size: 2
odom0_nodelay: false
odom0_differential: false
odom0_relative: true
odom0_pose_rejection_threshold: 5
odom0_twist_rejection_threshold: 1
# Particle filter pose
pose0: robot/pose
pose0_config: [true, true, true,
true, true, true,
false, false, false,
false, false, false,
false, false, false]
pose0_differential: true
pose0_relative: true
pose0_queue_size: 5
pose0_rejection_threshold: 2 # Note the difference in parameter name
pose0_nodelay: false
imu0: imu
imu0_config: [false, false, false,
true, true, true,
false, false, false,
true, true, true,
true, true, true]
imu0_nodelay: false
imu0_differential: false
imu0_relative: true
imu0_queue_size: 20
imu0_pose_rejection_threshold: 0.8 # Note the difference in parameter names
imu0_twist_rejection_threshold: 0.8 #
imu0_linear_acceleration_rejection_threshold: 0.8 #
imu0_remove_gravitational_acceleration: true
use_control: false
process_noise_covariance: [0.05, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0.05, 0, 0, 0, 0, 0 ...
Please do not link to external sites where the data expires. Instead, edit your description and copy/paste the text yaml file into it, then format the lines with the 101010 button. It's OK if it is long.
Oops sorry, fixed!
What sensor(s) are feeding the global localization particle filter?
Lidar + wheel encoders
I think I know what's happening, but please provide a sample message from every EKF input.
@Tom Moore I've added sample messages in the main question