0
$\begingroup$

Rosanswers logo

Hello,

I'm trying to configure a robot with GPS for outdoor navigation. For that I'm using robot_localization package with the navSat transform and I want to fuse hectorMapping for pathPlanning and obsctacle avoindance. I've seen this package I tried to replicate for my purposes, so I have this localization.yaml file:

# For parameter descriptions, please refer to the template parameter files for each node.

ekf_se_odom: # Used only for broadcasting odom to base_link transforms
  frequency: 30
  sensor_timeout: 0.1
  two_d_mode: true
  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

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

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

# -------------------------------------
# Laser scanmatching odometry:

  odom1: scanmatch_odom
  odom1_config: [false, false, false,
                 false, false, false,
                 true,  true,  true,
                 false, false, true,
                 false, false, false]
  odom1_queue_size: 10
  odom1_nodelay: true
  odom1_differential: false
  odom1_relative: false

# --------------------------------------
# imu configure:

  imu0: /imu/data
  imu0_config: [false, false, false,
                true,  true,  false,
                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: [--- ]
  initial_estimate_covariance: [  ----]

ekf_se_map: # Used only for broadcasting MAP to ODOM transforms
  frequency: 30
  sensor_timeout: 0.1
  two_d_mode: true
  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: map

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

  odom0: /husky_velocity_controller/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

# -------------------------------------
# GPS odometry:

  odom1: /gps/rtkfix
  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

# -------------------------------------
# Laser scanmatching odometry:

  odom2: scanmatch_odom
  odom2_config: [false, false, false,
                 false, false, false,
                 true,  true,  true,
                false, false, true,
                false, false, false]
  odom2_queue_size: 10
  odom2_nodelay: true
  odom2_differential: false
  odom2_relative: false

# --------------------------------------
# imu configure: (IMU is too noisy for this)

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

  use_control: false

  process_noise_covariance: [...]
   initial_estimate_covariance: [...]

My launch file for localization:

<?xml version="1.0"?>
<launch>

  <rosparam command="load" file="$(find agrob_gps_nav_stack)/params/localization.yaml" />
  <rosparam command="load" file="$(find agrob_gps_nav_stack)/params/navsat.yaml" />
  
  <node pkg="robot_localization" type="ekf_localization_node" name="ekf_se_odom" clear_params="true"/>

  <node pkg="robot_localization" type="ekf_localization_node" name="ekf_se_map" clear_params="true">
    <remap from="odometry/filtered" to="odometry/filtered_map"/>
  </node>

  <node pkg="robot_localization" type="navsat_transform_node" name="navsat_transform" clear_params="true" > <!-- output="screen" -->
      <remap from="odometry/filtered" to="odometry/filtered_map"/>
      <remap from="gps/fix" to="gps/fix"/>
      <remap from="imu/data" to="/imu_um7/data"/>
  </node>
    
</launch>

Here's the rviz image with the result after a rotation with the robot. The laser drifts from the map. Such thing does not happen if I use hector map to publish the tf between map and odom (but I don't do that because I want to use GPS)

rviz_image https://imgur.com/a/w8TCBZJ

EDIT 1:

Can I fuse hector map localization here? I found the problem is that i'm only using wheel odometry data (the laser odometry is not working) Can use hector map localization instead and fuse it with gps data?


Originally posted by billyDong on ROS Answers with karma: 48 on 2018-08-20

Post score: 0


Original comments

Comment by Choco93 on 2018-08-21:
the values, true and false, how are you choosing them? Or are you copying them from some other package and using those?

Comment by billyDong on 2018-08-21:
@Choco93 the values are copied from this package which is okay because i'm using the husky platform too.. in their solution they have commented the hector_map and switched for gmapping, but I want to use the hector map

Comment by billyDong on 2018-08-21:
@Choco93 with the exception of IMU on map->odom transform, it's too noisy so I decided to not fuse any data from the IMU

Comment by Choco93 on 2018-08-21:
that's what I was thinking that it is probably from IMU, i usually just use yaw, you can try without angular velocities

Comment by billyDong on 2018-08-21:
@Choco93 the IMU is problematic, I set everything to false because it was to noisy. Even with just the yaw. Please see the edit on the question

Comment by Choco93 on 2018-08-21:
there is just angular drift, right? No linear drift?

Comment by billyDong on 2018-08-21:
@Choco93 no, theres linear and angular drift.. https://imgur.com/a/Rqxxcrz

Comment by Choco93 on 2018-08-23:
My best guess is that it's due to IMU, you can remove linear accelerations from IMU and then check, and as for angular drift check if you have madgwick filter running and if the output is meaningful.

Comment by billyDong on 2018-08-23:
Madgwick wasn't running but that was not main problem. In order to completely solve this I had to use the laser odometry from hector mapping, I will put an answer with the localization parameters. Thank you

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

in order to solve this I activated the laser odometry of hector map, and used the madgwick filter for IMU. If someone is trying to do something similar the first thing to do is to read this entire guide: http://docs.ros.org/jade/api/robot_localization/html/state_estimation_nodes.html

Theres thing you should pay attention like, if your odometry data has linear velocity and position, you should fuse the linear position. If you have two or more sensors with the same data you should fuse the most reliable one or activate the differential mode. Robot localization considers an IMU with a common position so check if your acceleration in Z is 9.81 and not -9.81.. Turn the robot counterclock wise and check if the yaw increases and the angular velocity is positive...

After all of this, I'm going to leave here my localization.yaml file, and the launch for hector map and um7 IMU.

UM7_launch

hector_launch

localization


Originally posted by billyDong with karma: 48 on 2018-08-23

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

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