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.4k stars 896 forks source link

UKF position data closely match slam absolute pose regard wheel odometry. #839

Closed spectra543 closed 1 year ago

spectra543 commented 1 year ago

Hello, I have a specific question related to a robot localization package. I've been trying to get an answer on the Robot Stack Exchange for quite some time now, but I haven't received a response. I'm wondering if you could please take a moment to review my situation.

I'm using the Unscented Kalman Filter (UKF) in the package to fuse the absolute pose from SLAM with the linear velocity from wheel odometry. However, I've noticed that the position output of the Kalman filter appears to closely match the SLAM absolute pose, especially in terms of the position data provided by the wheel odometry and the covariance matrix values.

My question is whether this behavior is expected or if I might have made an error in my configuration. Additionally, I've observed that even when the SLAM data is cut off, the filter output continues to update based on data from the wheel odometry.

configuration file `frequency: 30

sensor_timeout: 0.1

two_d_mode: true

transform_time_offset: 0.0

transform_timeout: 0.0

print_diagnostics: true

debug: false

debug_out_file: /path/to/debug/file.txt

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: /odom_cov_ukf # wheel odometry odom0_config: [false, false, false, false, false,false, true, true, false, false, false, false, false, false, true] odom0_differential: false odom0_relative: true odom0_queue_size: 3

odom1_pose_rejection_threshold: 0.01

odom1_twist_rejection_threshold: 0.2

odom0_nodelay: false

odom1: /cam_aru_odom odom1_config: [false,false, false, false, false,false, true, true, false, false, false, false, false, false, true] odom1_differential: false odom1_relative: false odom1_queue_size: 3

odom1_pose_rejection_threshold: 0.01

odom1_twist_rejection_threshold: 0.2

odom1_nodelay: false

pose0: /vo_ukf_cov #slam pose pose0_config: [true, true, false, false, false, true, false, false, false, false, false, false, false, false, false] pose0_differential: false pose0_relative: fasle pose0_queue_size: 1

pose0_rejection_threshold: 2 # Note the difference in parameter name

pose0_nodelay: false

imu0: /imu_cov_data_ukf imu0_config: [false, false, false, false, false, false, false, false, false, false, false, true, false, false,false] imu0_nodelay: false imu0_differential: false imu0_relative: fasle imu0_queue_size: 5

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: false

use_control: true

stamped_control: false

control_timeout: 0.2

control_config: [true, false, false, false, false, true]

acceleration_limits: [1.3, 0.0, 0.0, 0.0, 0.0, 3.4]

deceleration_limits: [1.3, 0.0, 0.0, 0.0, 0.0, 4.5]

acceleration_gains: [0.8, 0.0, 0.0, 0.0, 0.0, 0.9]

deceleration_gains: [1.0, 0.0, 0.0, 0.0, 0.0, 1.0]

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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.06, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.03, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.03, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.06, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.025, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.025, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.04, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.01, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.01, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.01, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.01, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.015]

initial_estimate_covariance: [1e-9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1e-9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1e-9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1e-9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1e-9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1e-9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1e-9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1e-9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1e-9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1e-9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1e-9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1e-9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1e-9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1e-9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1e-9]

alpha: 0.001

kappa: 0

beta: 2` ......................................................................................... and here's the sensor message slam

header: seq: 72 stamp: secs: 1698497751 nsecs: 449593067 frame_id: "camera" pose: pose: position: x: 0.000905927071149 y: 0.000373678404359 z: 0.00112596100876 orientation: x: 0.000162643538105 y: 0.000183301626754 z: 7.84188956183e-06 w: 0.999999970198 covariance: [1.8743429340134814e-08, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.4518905529907774e-08, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 8.392338064793856e-08, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 9.542607486213591e-09, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.4376012734276177e-08, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0359938729265474e-09] ...................................................................................................... here's wheel odometry message header: seq: 100 stamp: secs: 1698497806 nsecs: 247585945 frame_id: "odom" child_frame_id: "base_link" pose: pose: position: x: 0.0 y: 0.0 z: 0.0 orientation: x: 0.0 y: 0.0 z: 6.08298869338e-05 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: 0.0 y: 0.0 z: 0.0 angular: x: 0.0 y: 0.0 z: 0.00142620096449 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, 6.862781704086771e-06] ...................................................................................................................... here's the picture to show you what's confuse me this picture show the position in x axis in straight run collected from my robot the red graph is from slam, green is wheel odometry, blue is from the robot_localzation. The Kalman filter seem to always follow the slam position output is this normal behavior? thank you so much for looking into my question. position x axis

ayrton04 commented 1 year ago

Please ask questions on robotics.stackexchange.com

spectra543 commented 1 year ago

Please ask questions on robotics.stackexchange.com

Alright thanks already done https://robotics.stackexchange.com/questions/105045/ukf-position-data-closely-match-slam-absolute-pose-regard-wheel-odometry

spectra543 commented 1 year ago

Please ask questions on robotics.stackexchange.com

I already edit the code in stack exchange to be readable my apologies i'm quite new to it

ayrton04 commented 1 year ago

Great, thanks. I'd ask for your patience, in that case.