dual EKF in robot_localization - map drifts quickly in dual EKF, but not single [closed]

asked 2023-01-12 19:29:22 -0500

chased11 gravatar image

I have an EKF configured with wheel odometry, IMU, and a ~3cm accuracy GPS. I am using RTAB-map for mapping, which takes care of my map-> base_link transform when using the single EKF. Parameters for the single EKF is shown below, where the dual ekf would be the same but only odom and imu in the odom-> base_link instance and all three in the map-> base_link EKF.

When I run the dual EKF, my local costmap drifts very quickly from the global/RTAB map. Why would this be happening only when I have the dual EKF running? In the single EKF, there is little drift but an occasional subtle jump. The GPS is very accurate, which might allow me to just settle with the subtle jumps every now and then. I have experimented with setting odom to relative and differential, including RTABmap odometry, modifying covariances, etc. but it happens regardless.

(drift shown in rviz after a few seconds)

Single EKF:
    ekf_se_odom:
  frequency: 50
  sensor_timeout: 0.1
  two_d_mode: true
  transform_time_offset: 0.05
  transform_timeout: 0.0
  print_diagnostics: true
  debug: false

      map_frame: map
      odom_frame: odom
  base_link_frame: base_link
  world_frame: map

# -------------------------------------
# Wheel odometry:

  odom0: /odom
  odom0_config: [true, true, false,
                 false, false, false,
                 true,  true,  false,
                 false, false, true,
                 false, false, false]
  odom0_queue_size: 10
  odom0_nodelay: false
  odom0_differential: true # try to change this
  odom0_relative: true

    # -------------------------------------
    # GPS odometry: change to odometry/gps

  odom1: /odometry/gps
  odom1_config: [true,  true,  false,
                 false, false, false,
                 false, false, false,
                 false, false, false,
                 false, false, false]
  odom1_queue_size: 10
  odom1_nodelay: false
  odom1_differential: false

  odom1_relative: false


  odom2: rtabmap/odom
  odom2_config: [false, false, false,
                    false, false, false,
                    true, true, true,
                    false, false, false,
                    false, false, false]
  odom2_differential: false
  odom2_relative: false
  odom2_queue_size: 10
  odom2_pose_rejection_threshold: 1000
  odom2_twist_rejection_threshold: 1000
  odom2_nodelay: false



# --------------------------------------
# imu configure:
  imu0_config: [false, false, false,
                false,  false,  true,
                false, false, false,
                true,  true,  true,
                true,  true,  true]
  imu0_nodelay: true #changed
  imu0_differential: false
  imu0_relative: false
  imu0_queue_size: 10
  imu0_remove_gravitational_acceleration: true 

  use_control: false

Navsat params:

navsat_transform:
  frequency: 10
  delay: 5.0
  magnetic_declination_radians: 0.011
  yaw_offset: 0
  zero_altitude: true
  broadcast_cartesian_transform: true
  publish_filtered_gps: false
  use_odometry_yaw: false
  wait_for_datum: false
edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by chased11
close date 2023-05-01 11:19:28.757270

Comments

I just realized my navsat_transform is remapped to /odometry/filtered rather than odometry/filtered_map. This is probaby what's causing issues i would assume

chased11 gravatar image chased11  ( 2023-01-12 21:03:14 -0500 )edit

@chased11 did you solve this? If so, can you change your comment to an answer?

Tom Moore gravatar image Tom Moore  ( 2023-05-01 04:43:11 -0500 )edit

That partially solved the problem, but I was never able to figure out how to use dual ekf along with SLAM. When I only used one EKF the GPS odom started ~80 m away from the starting position of the robot. I checked IMU mag and that was fine.

chased11 gravatar image chased11  ( 2023-05-01 09:51:58 -0500 )edit

I will close this question and direct you to another question I asked regarding that here

Thanks for the response.

chased11 gravatar image chased11  ( 2023-05-01 11:19:04 -0500 )edit