robot_localization /map /odom drift

asked 2022-11-08 07:48:19 -0500

Hello everyone,

I use ROS2 Foxy along with robot_localization. I have a differential wheeled robot with odometry and 2 GPS rtk for position and heading.

The sensors work properly independently. I have a clean odometry track and the heading is working fine. The problem occurs when I merge them using robot_localization, with two ekf_localisation_node (local and global) and one navsat_transform_node. I observe a shift/drift between /map and /odom frames and I have my odometry track which is getting disturbed.

Under mapviz, using /map as fixed and target frame :

  • red and orange tracks are similar (/odom and /odometry/filtered/local)
  • yellow track is /odometry/gps
  • blue track is tf_frame with /odom frame (which has /map as a direct parent)
  • black track is /odometry/filtered/global

The blue track can become completely crazy : image description

Here are the parameters used in localization.yaml

navsat_transform:
  ros__parameters:
    magnetic_declination_radians: 0.0387 
    yaw_offset: 0.0 
    zero_altitude: true # True if operating in 2D
    publish_filtered_gps: true
    use_odometry_yaw: true
    wait_for_datum: false
    use_local_cartesian: false
    frequency: 30.0 # Hz
    delay: 0.0 # Seconds
    transform_timeout: 0.0
    broadcast_utm_transform: false
    broadcast_utm_transform_as_parent_frame: false

ekf_local:
  ros__parameters:
    frequency: 30.0 # Hz
    sensor_timeout: 0.1 # Seconds
    two_d_mode: true # No 3D information will be used (zero_altitude already set to true)
    publish_acceleration: false
    publish_tf: true
    reset_on_time_jump: false
    map_frame: map # Defaults to "map" if unspecified
    odom_frame: odom # Defaults to "odom" if unspecified
    base_link_frame: base_footprint # Defaults to "base_link" if unspecified
    world_frame: odom # Defaults to the value of odom_frame if unspecified

    odom0: odom # Wheel odometry
    odom0_config: [true, true, false, # [x, y, z]
                false, false, true, # [roll, pitch, yaw]
                false, false, false, # [x_vel, y_vel, z_vel]
                false, false, false, # [roll_vel, pitch_vel, yaw_vel]
                false, false, false] # [x_accel, y_accel, z_accel]
    odom0_nodelay: true
    odom0_differential: false
    odom0_relative: false
    odom0_queue_size: 30

ekf_global:
  ros__parameters:
    frequency: 30.0 # Hz
    sensor_timeout: 0.1 # Seconds
    two_d_mode: true # No 3D information will be used (zero_altitude already set to true)
    publish_acceleration: false
    publish_tf: true
    reset_on_time_jump: false
    map_frame: map # Defaults to "map" if unspecified
    odom_frame: odom # Defaults to "odom" if unspecified
    base_link_frame: base_footprint # Defaults to "base_link" if unspecified
    world_frame: map # Defaults to the value of odom_frame if unspecified

    odom0: odometry/gps # navsat_transform_node output
    odom0_config: [true, true, false, # [x, y, z]
                false, false, false, # [roll, pitch, yaw]
                false, false, false, # [x_vel, y_vel, z_vel]
                false, false, false, # [roll_vel, pitch_vel, yaw_vel]
                false, false, false] # [x_accel, y_accel, z_accel]
    odom0_nodelay: true
    odom0_differential: false
    odom0_relative: false
    odom0_queue_size: 30

    odom1: odom # Wheel odometry
    odom1_config: [true, true, false, # [x, y, z]
                false, false, false, # [roll, pitch, yaw]
                false, false, false, # [x_vel, y_vel, z_vel]
                false, false, false, # [roll_vel, pitch_vel, yaw_vel]
                false, false, false] # [x_accel, y_accel, z_accel]
    odom1_nodelay: true
    odom1_differential: false
    odom1_relative: false
    odom1_queue_size: 30

    imu0: gps_heading
    imu0_config: [false, false, false, # [x, y, z]
                false, false, true, # [roll, pitch, yaw]
                false, false, false, # [x_vel, y_vel, z_vel]
                false, false, false, # [roll_vel, pitch_vel, yaw_vel]
                false, false, false] # [x_accel, y_accel, z_accel]
    imu0_nodelay: false
    imu0_differential: false
    imu0_relative: false
    imu0_queue_size: 30

Do you have any idea what is causing this behavior ?

Many thanks

edit retag flag offensive close merge delete