0
$\begingroup$

Rosanswers logo

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,    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,    1.0,  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,    1.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,    1.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,     1.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,     1.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,    1.0]



navsat_transform:
  frequency: 30
  delay: 3.0
  magnetic_declination_radians: 0.23003
  yaw_offset: 0 #1.570796327  # IMU reads 0 facing magnetic north, not east
  zero_altitude: false
  broadcast_utm_transform: false
  publish_filtered_gps: true
  use_odometry_yaw: true
  wait_for_datum: false

The result I see in RViz: http://imgur.com/a/BP6IU

The yellow is the original odometry. The light blue is the gps odometry, the pink is filtered odometry. The problem seems to be that the gps odometry has offset by the transform of odom->base_footprint. And then filtered odometry tries to fuse is all and then moves further away and then the offset for gps also grows. In the given situation it starts moving off the further I move.

Can it all be fused in one node? What have I missed in the configuration?


Originally posted by Ago on ROS Answers with karma: 23 on 2017-08-09

Post score: 0


Original comments

Comment by Humpelstilzchen on 2017-08-09:
What frame_id do you use in your gps "fix" message?

Comment by Ago on 2017-08-09:
frame_id = earth. Then we have static transform between earth and map at 0, 0.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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/198196/gps-coordinates-to-map-coordinates/


Originally posted by Humpelstilzchen with karma: 1504 on 2017-08-10

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by Ago on 2017-08-10:
Thanks! So obvious, totally missed that.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.