robot_localization tf tree changes from odom -> base to map -> base when using a custom particle filter
Hello,
I have robot_localization setup to fuse IMU data from a flight controller with pose data from ORB-SLAM. I am also using gmapping to generate a 2D map. When I run my robot_localization node, my tf tree becomes odom -> base_link -> camera_link, which I think is what I'm supposed to get because right now I'm assuming that my camera is my base. However, I'm also trying to incorporate a particle filter into this setup. And when I try to run my particle filter, my tf tree changes to map -> base_link and I'm not sure why. I've been trying to find answers but I feel like a lot is going over my head.
In any case, here are the steps I did when I was using robot_localization and also use the particle filter:
- Go to a known fixed position (initial point).
- Run camera, ORB, robot_localization node, and gmapping. (At this point, my tf tree is odom -> base_link)
- Start mapping around and return to initial point when done.
- Save the map using map_server.
- Close gmapping.
- Launch the particle filter and range finders. (This is where my tf tree changes to map -> base_link while my odom frame seems to just float and is unconnected to anything).
Also here is the config file I use for my robot_localization node:
frequency: 50
sensor_timeout: 0.1
two_d_mode: true
transform_time_offset: 0.0
transform_timeout: 0.0
print_diagnostics: true
debug: false
publish_tf: 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
pose0: /orb/pose
pose0_config: [true, true, true, # Position
true, true, true, # Orientation
false, false, false, # Linear Velocity
false, false, false, # Angular Velocity
false, false, false] # Linear Acceleration
pose0_queue_size: 2
pose0_nodelay: false
pose0_differential: false
pose0_relative: false
imu0: /mavros/imu/data
imu0_config: [true, true, true, # Position
true, true, true, # Orientation
false, false, false, # Linear Velocity
true, true, true, # Angular Velocity
true, true, true] # Linear Acceleration
imu0_nodelay: false
imu0_differential: true
imu0_relative: false
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, 1.0, 0.0, 0.0, 0.0, 3.4]
deceleration_limits: [1.3, 1.0, 0.0, 0.0, 0.0, 4.5]
acceleration_gains: [0.8, 0.5, 0.0, 0.0, 0.0, 1.5]
deceleration_gains: [1.0, 0.7, 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 ...