Robotics StackExchange | Archived questions

initial_state in robot_localization does not change the odometry/filtered initial pose

Hello,

I am working with the robot_localization, filtering two odometry data.

Both of them start at (0,0,0), but I would like to start at (x,y,0).

I am using the initial_state parameter, but the topic keeps publishing the starting pose in (0,0,0).

Which are the possible problems?

I am setting the parameter on my yaml file only:

frequency: 30

sensor_timeout: 0.1
two_d_mode: true  
transform_time_offset: 0.0
transform_timeout: 0.0
print_diagnostics: true
debug: true
debug_out_file: $(env HOME)/.ros/log/ekf.log

publish_tf: true
smooth_lagged_data: false 

dynamic_process_noise_covariance: true
publish_acceleration: false

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: robot/odom0
odom0_config: [true,  true,  false,
               false, false, false,
               true, true, false,
               false, false, false,
               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.0


odom1: robot/odom1
odom1_config: [true, true, false,
               true, true, true,
               true, true, false,
               true, true, true,
               false, false, false]
odom1_differential: false
odom1_relative: true
odom1_queue_size: 2
odom1_pose_rejection_threshold: 2
odom1_twist_rejection_threshold: 1.0
odom1_nodelay: false

use_control: true
stamped_control: false
control_timeout: 0.2

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

acceleration_limits: [1.3, 1.3, 0.0, 0.0, 0.0, 3.4]
deceleration_limits: [1.3, 1.3, 0.0, 0.0, 0.0, 4.5]
acceleration_gains: [0.8, 0.8, 0.0, 0.0, 0.0, 0.9]
deceleration_gains: [1.0, 1.0, 0.0, 0.0, 0.0, 1.0]

initial_state: [20.0, 20.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]

Asked by Lucas Marins on 2019-09-04 14:26:04 UTC

Comments

Answers

You should include a sample message from every sensor input, but if I had to guess, you are probably getting a message from the robot/odom0 topic that is providing all 0s for the measurement. You're fusing absolute X and Y from that sensor, so it's going to update your pose estimate.

Asked by Tom Moore on 2019-11-04 05:00:26 UTC

Comments

I am setting both sensors as relative. Do I always need an absolute sensor to work with "initial_state" parameter?

Asked by Lucas Marins on 2019-11-11 14:20:11 UTC

Relative mode is relative to the sensor, not the state. So we retain the first measurement from the sensor forever, and all future measurements from that sensor are multiplied by the inverse of that first measurement, and then fed to the filter as an absolute pose. Try using differential mode instead.

Asked by Tom Moore on 2019-11-28 04:47:05 UTC