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

robot_localization: erroneous filtered GPS output

asked 2015-10-04 21:34:28 -0500

jll gravatar image

updated 2015-10-11 01:20:20 -0500


I am quite new to the robot_localization package and am facing a number of difficulties in using it. I am currently trying to fuse data taken from an Android device's GPS and IMU using this node. To achieve this, I have extracted the GPS and IMU log data and have read it into a bag file, which I then play back to the ekf_localization_node and navsat_transform_node to try to fuse the data.

I have a few difficulties. My GPS doesn't have altitude information, so I estimated the altitude at around 240 and set the field to that value. I notice that while the altitude stays quite constant for maybe 15-20 seconds, its value starts exploding and becoming erratic soon after.

Also, I have input a value of around -79 degrees in the longitude field. However, the filtered GPS topic inexplicably maintains the longitude field in the range of 179-180 degrees instead. I'm not sure what's going on here, and have attached the launch file I am using as well as the bag file I am reading from below.

Would greatly appreciate some feedback on what I am currently doing wrong! Thanks in advance!


Launch file:

UPDATE: I have downloaded and tried out the latest version of robot_localization, and it does indeed resolve all issues with the GPS output from the navsat_transform node.

I have also tried to follow up on Porti's suggestion that my frames are not correct, but as far as I can tell this is not the case. I am using the IMU on an Android-powered camera, and have followed the developer's API to process the data coming from the camera. As far as I can tell, I am taking the accelerometer values and inputting them so that x is forward (direction of motion of base_link), y is to the left when facing forward, and z is upward. I understand this to be the standard required by REP 103.

I have also tried exchanging the x and y axes and attempting to zero out any effects of gravity (from the possibility that the camera is skewed). However, all these attempts yield only paths similar to what Porti has plotted. I have enclosed MATLAB graphs of the path output by the node for the various cases listed above. All these graphs have the same jagged, discontinuous shapes as Porti's graph for IMU data. Would anyone be able to suggest any possible causes for this phenomenon?

Thank you in advance for your help!

MATLAB graphs:

edit retag flag offensive close merge delete


I'll have to look at the bag files. Your IMU does have a compass, correct? It could be trouble with acceleration biases.

Tom Moore gravatar image Tom Moore  ( 2015-10-16 07:22:39 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2015-10-07 20:33:50 -0500

Tom Moore gravatar image

Hi jll,

The issue with the longitude being way off was actually a regression that I've just fixed. Would you mind grabbing the latest source and trying again? Thanks!

edit flag offensive delete link more

answered 2015-10-05 03:53:00 -0500

Porti77 gravatar image

updated 2015-10-05 03:57:50 -0500

The problems are in the data of imu, you are fusing this data of sensor with gps, you need know if the imu data are corrected, I paint your rute and have the next image description green is the path filtered and rose is the position gps, i created a tools for visualization. The imu has follow the rep 103, try if the frame of imu is corrected, launch only the imu and test it. The x axis of the base_link frame should point in the direction of advance of the robot. The angular_velocity and lineal acceleration of imu not is consistent with vehicle movement

I changed your .launch


    <node pkg="rosbag" type="play" name="rosbag_play" output="screen" args="--clock /home/jorge_j/catkin_ulises/src/pruebas/covar_2015-10-05-10-02-06.bag -d 3"/>
    <!-- <node pkg="rosbag" type="play" name="rosbag_play" output="screen" args="clock /home/Downloads/filtered.bag -d 3"/> -->
    <node pkg="tf2_ros" type="static_transform_publisher" name="bl_imu" args="0 0 0 0 0 0 1 base_link imu_link" />

 <param name="odom0_queue_size" value="10"/> -->

    <!-- Global (map) instance -->
    <node pkg="robot_localization" type="ekf_localization_node" name="ekf_localization_global" clear_params="true">
      <param name="frequency" value="30"/>
      <param name="sensor_timeout" value="0.1"/>
      <param name="two_d_mode" value="true"/>

      <param name="map_frame" value="map"/>
      <param name="odom_frame" value="odom"/>
      <param name="base_link_frame" value="base_link"/>
      <param name="world_frame" value="odom"/>

      <param name="transform_time_offset" value="0.0"/>

      <!-- <param name="odom0" value="/jackal_velocity_controller/odom"/> -->
      <param name="odom0" value="/odometry/gps"/>
      <param name="imu0" value="/imu/data"/>

      <!-- <rosparam param="odom0_config">[false, false, false,
                                      false, false, false,
                                      true, true, true,
                                      false, false, true,
                                      false, false, false]</rosparam> -->

      <rosparam param="odom0_config">[true, true, false,
                                      false, false, false,
                                      false, false, false,
                                      false, false, false,
                                      false, false, false]</rosparam>

      <rosparam param="imu0_config">[false, false, false,
                                     true,  true,  true,
                                     false, false, false,
                                     true,  true,  true,
                                     true,  true,  true]</rosparam>

      <!-- <param name="odom0_differential" value="false"/> -->
      <param name="odom0_differential" value="false"/>
      <param name="imu0_differential" value="false"/>

      <!-- <param name="odom0_relative" value="false"/> -->
      <param name="odom0_relative" value="false"/>
      <param name="imu0_relative" value="false"/>

      <param name="imu0_remove_gravitational_acceleration" value="true"/>
      <param name="print_diagnostics" value="true"/>

      <!-- <param name="odom0_queue_size" value="10"/> -->
      <param name="odom0_queue_size" value="10"/>
      <param name="imu0_queue_size" value="10"/>

      <param name="debug"           value="false"/>
      <param name="debug_out_file"  value="debug_ekf_localization.txt"/>

      <remap from="/odometry/filtered" to="/odometry/filtered/global"/>

   <!-- navsat_transform -->
   <node pkg="robot_localization" type="navsat_transform_node" name="navsat_transform" respawn="true" output="screen">
      <param name="frequency" value="30"/>
      <param name="delay" value="3"/>
      <param name="magnetic_declination_radians" value="0.190240888"/>
      <!-- <param name="magnetic_declination_radians" value="-0.161617489"/> -->
      <!-- <param name="yaw_offset" value="1.570796327"/> -->
      <param name="yaw_offset" value="1.570796327"/>
      <param name="zero_altitude" value="false"/>
      <param name="broadcast_utm_transform" value="true"/>
      <param name="publish_filtered_gps" value="true"/>
      <param name="use_odometry_yaw" value="true"/>
      <param name="wait_for_datum" value="false"/>

      <remap from="/odometry/filtered" to="/odometry/filtered/global"/>
      <!-- <remap from="/gps/fix" to="/navsat/fix"/> -->

edit flag offensive delete link more


hi, dear @Porti77 , how to make a tool to visual the gps position? can you share with me? thank you very much.

asimay_y gravatar image asimay_y  ( 2016-06-14 09:54:41 -0500 )edit

Hi, i did a plugin for rviz which can plot a Odometry like a path, so you plot odometry/gps Download this , compile in your workspace and then you can plot this msg in rviz. If you was think in plot the GPS (NavSatFix) you have to convert it

Porti77 gravatar image Porti77  ( 2016-06-15 04:57:54 -0500 )edit

Question Tools

1 follower


Asked: 2015-10-04 21:34:28 -0500

Seen: 1,333 times

Last updated: Oct 11 '15