Ask Your Question
0

robot_localization and gmapping - gps has offset

asked 2017-08-09 00:42:35 -0500

Ago gravatar image

Trying to use robot_localization with gps to improve the accuracy. Currently, gmapping is responsible for map->odom transform. So, I have tried the following configuration. We use base_footprint instead of base_link. Otherwise we have tried to follow REP-105.

launch file (for robot_localization):

<launch>
  <rosparam command="load" file="$(find loc)/params/rk_localization.yaml" />

  <node pkg="robot_localization" type="ekf_localization_node" name="ekf_all" clear_params="true">
    <remap from="imu/data" to="/imu"/>
  </node>


  <node pkg="robot_localization" type="navsat_transform_node" name="navsat_transform" clear_params="true" output="screen">

      <!-- Placeholders for input remapping. Set your topic names as the "to" values.  -->
      <remap from="imu/data" to="/imu"/>
      <remap from="gps/fix" to="/gps"/>
      <remap from="odometry/filtered" to="/odom" />

  </node>
</launch>

yaml:

ekf_all:
  frequency: 30
  sensor_timeout: 0.1
  two_d_mode: false
  transform_time_offset: 0.0
  transform_timeout: 0.0
  print_diagnostics: true
  debug: false
  publish_tf: true

  map_frame: map
  odom_frame: odom
  base_link_frame: base_footprint
  world_frame: odom

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

  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: true
  odom1_differential: false
  odom1_relative: false

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

  use_control: false

  process_noise_covariance: [1e-3, 0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                             0,    1e-3, 0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                             0,    0,    1e-3, 0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                             0,    0,    0,    0.3,  0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                             0,    0,    0,    0,    0.3,  0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                             0,    0,    0,    0,    0,    0.01, 0,     0,     0,    0,    0,    0,    0,    0,    0,
                             0,    0,    0,    0,    0,    0,    0.5,   0,     0,    0,    0,    0,    0,    0,    0,
                             0,    0,    0,    0,    0,    0,    0,     0.5,   0,    0,    0,    0,    0,    0,    0,
                             0,    0,    0,    0,    0,    0,    0,     0,     0.1,  0,    0,    0,    0,    0,    0,
                             0,    0,    0,    0,    0,    0,    0,     0,     0,    0.3,  0,    0,    0,    0,    0,
                             0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0.3,  0,    0,    0,    0,
                             0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0.3,  0,    0,    0,
                             0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0.3,  0,    0,
                             0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0.3,  0,
                             0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0.3]

  initial_estimate_covariance: [1e-9, 0,    0,    0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
                                0,    1e-9, 0,    0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
                                0,    0,    1e-9, 0,    0,    0,    0 ...
(more)
edit retag flag offensive close merge delete

Comments

What frame_id do you use in your gps "fix" message?

Humpelstilzchen gravatar image Humpelstilzchen  ( 2017-08-09 06:24:57 -0500 )edit

frame_id = earth. Then we have static transform between earth and map at 0, 0.

Ago gravatar image Ago  ( 2017-08-09 16:06:29 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-08-10 00:11:11 -0500

Humpelstilzchen gravatar image

According to the documentation of sensor_msgs/NavSatFix the frame_id should be set to the "frame of reference reported by the receiver, usually the location of the antenna". So as far as I understood it a frame_id of "base_footprint" will probably work for most people, or frame_id "gps" with a static transform to the base_link.

It looks like it will transform your gps coordinates from your global frame to "base_footprint" if you set the frame_id of your "fix"-message to your global frame, as written here: https://answers.ros.org/question/1981...

edit flag offensive delete link more

Comments

Thanks! So obvious, totally missed that.

Ago gravatar image Ago  ( 2017-08-10 01:46:14 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2017-08-09 00:42:35 -0500

Seen: 442 times

Last updated: Aug 10 '17