ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

robot_localization with GPS map frame won't stay fixed

asked 2019-04-14 23:43:19 -0500

agurman gravatar image

updated 2019-04-15 02:55:28 -0500

Hey guys,

I'm running a dual ekf setup of robot_localization to fuse GPS alongside navsat_transform_node which provideds the map->utm transform. I have been trying to figure this out for days now but i can't get this map frame's orientation to stay aligned with the odom frame?

I am running a gnss heading receiver which provides the true earth referenced heading which i fuse in both state estimation nodes as a pose message. My understanding is, since the only source of orientation is coming from this one message for both nodes, they should both always have the same rotation? The map frame initially is the same as odom but after some driving around and turning the robot it goes wild and very inaccurate. My gps is an RTK GPS setup i have confirmed that accuracy down to 5mm and a heading accuracy of 0.1 degree, so i know there is no issue with my GPS.

Below is my robot_localization configuration:

ekf_se_odom:
  frequency: 20
  two_d_mode: true
  sensor_timeout: 0.15
  transform_time_offset: 0.0
  transform_timeout: 0.0
  print_diagnostics: true
  debug: false

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

  odom0: /warthog_velocity_controller/odom
  odom0_config: [false, false, false,
                 false, false, false,
                 true, true, false,
                 false, false, true,
                 false, false, false]
  odom0_queue_size: 10
  odom0_nodelay: true
  odom0_differential: false
  odom0_relative: false

  pose0: /gps/odometry
  pose0_config: [false, false, false,
                 false, false, true,
                 false, false, false,
                 false, false, false,
                 false, false, false]
  pose0_queue_size: 10
  pose0_nodelay: true
  pose0_differential: false
  pose0_relative: false

  imu0: /mcu_imu/data
  imu0_config: [false, false, false,
                false, false, false,
                false, false, false,
                false, false, true,
                true, true, false]
  imu0_differential: false
  imu0_nodelay: false
  imu0_relative: false
  imu0_queue_size: 10

  use_control: false

ekf_se_map:
  frequency: 20
  sensor_timeout: 0.15
  two_d_mode: true
  transform_time_offset: 0.0
  transform_timeout: 0.0
  print_diagnostics: true
  debug: false
  debug_out_file: "/home/alec/debug_ekf.txt"

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

  odom0: /warthog_velocity_controller/odom
  odom0_config: [false, false, false,
                 false, false, false,
                 true, true, false,
                 false, false, true,
                 false, false, false]
  odom0_queue_size: 10
  odom0_nodelay: true
  odom0_differential: false
  odom0_relative: false

  pose0: /gps/odometry
  pose0_config: [false, false, false,
                 false, false, true,
                 false, false, false,
                 false, false, false,
                 false, false, false]
  pose0_queue_size: 10
  pose0_nodelay: true
  pose0_differential: false
  pose0_relative: false

  odom2: /bunkbot_localization/odometry/gps
  odom2_config: [true,  true,  false,
                 false, false, false,
                 false, false, false,
                 false, false, false,
                 false, false, false]
  odom2_queue_size: 10
  odom2_nodelay: true
  odom2_differential: false
  odom2_relative: false

  imu0: /mcu_imu/data
  imu0_config: [false, false, false,
                false, false, false,
                false, false, false,
                false, false, true,
                true, true, false]
  imu0_differential: false
  imu0_nodelay: true
  imu0_relative: false
  imu0_queue_size: 10

  use_control: false

Below is my navsat_transform_node configuration:

navsat_transform:
  broadcast_utm_transform: true
  delay: 3.0
  frequency: 20
  magnetic_declination_radians: 0.0 # Set this depdending on origin location in the world
  publish_filtered_gps: true
  use_odometry_yaw: true
  wait_for_datum: false
  yaw_offset: 0.0 
  zero_altitude: true

I set the use_odometry_yaw to true as my heading is fused into the odometry and not from the IMU, i also set yaw_offset to 0 as the heading is 0 when facing east.

Here are some GIF's of the current behaviour:

image description

image description

And below is a GIF of my ... (more)

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2019-04-16 01:37:57 -0500

agurman gravatar image

updated 2019-04-16 01:51:43 -0500

I believe i have solved this issue by duplicating my gnss heading pose message, one for the first ekf node and one for the second ekf node, and setting the frame_id of each message to be respective of the node, eg. odom or map.

The map frame now stays right on top of the odom frame and retains the same orientation. I am not exactly sure why this works, if anyone could elaborate that would be great.

edit flag offensive delete link more

Comments

Hello, We have a similar problem but we can not solve it with your proposal. Did you find the reason it worked changing the frame_id of the heading pose message? Thanks in advance!

tseco gravatar image tseco  ( 2020-03-24 05:40:41 -0500 )edit
0

answered 2021-02-01 16:01:09 -0500

Narton gravatar image

updated 2021-02-01 16:02:11 -0500

I had a similar problem and solved it by switching the input of navsat transform from 'ekf_odom' (local below) to 'ekf_map' (global below). I found the solution by noticing my nodes were not connected the same way as the illustration in the docs and by carefully going through the example launch files in the repo (suggested here: https://answers.ros.org/question/2002...).

Integrating GPS Image from robot_localization docs

edit flag offensive delete link more

Question Tools

3 followers

Stats

Asked: 2019-04-14 23:43:19 -0500

Seen: 1,267 times

Last updated: Feb 01 '21