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

robot_localization map to odom transform seems to be incorrect

asked 2017-02-21 03:12:58 -0600

Jasmin gravatar image

updated 2017-04-14 06:59:56 -0600

I'm using two robot_localization nodes, one for continuous data (wheels' odom + imu) and the other including gps for pose correction. For instance ekf_localization and gps_ekf_localization are giving the exact same output seen from the odom frame which is normal, but when looking at their output in the map frame I am supposed to see a drift between them but they are still the same and the whole trajectory has the same form with a slight deformation and it's rotated with an important angle and also translated. This is an example of the published transforms:

    x: 1.62237404993
    y: -1.66250429176
    z: 0.0
    x: 0.0
    y: 0.0
    z: 0.864963620982
    w: 0.501834568736

This made me think that the map to odom transform is wrong for some reason, also made me question: is the gps data really used for pose correction? With the same configuration, I eliminated the gps data and still have the same output. The weird thing is that every thing seem to be working some times, the robot maintain its trajectory and seems to be very aware of its position and orientation. But with a more complex trajectory and in some different areas I'm getting the same behavior as the one described in this paper when fusing only odom and imu.

The launch file I'm using is a way too similar to the one provided as answer for the following question. Does this have something to do with the imu parameters ? I've been reading the documentation and almost every published issue and question about the package but I still have so many questions bothering me in my head since I'm new to all this magic. I will try to provide some bag files as soon as possible. But hopefully this little description will make you able to give me some points to check or to correct. Thank you in advance.

EDIT in response to Tom's comment:

This is the launch file I'm using:

    <param name="/use_sim_time" value="false"/>
   <node pkg="tf2_ros" type="static_transform_publisher" name="bf_bl" args="0 0 0.3 0 0 0 1 base_footprint    base_link" />
    <node pkg="tf2_ros" type="static_transform_publisher" name="bl_gps" args="0.448 0 0.358 0 0 0 1 base_link gps" />
    <node pkg="tf2_ros" type="static_transform_publisher" name="bl_imu" args="0.448 0 0.358 0 0 3,14159 1 base_link imu_link" />
    <node pkg="robot_localization" type="ekf_localization_node" name="ekf_localization" output= "screen" clear_params="true">
      <param name="frequency" value="10"/>
      <param name="sensor_timeout" value="0.1"/>
      <param name="two_d_mode" value="true"/>
      <param name="map_frame" value="map_gps"/>
      <param name="odom_frame" value="/odometry/filtered"/>
      <param name="base_link_frame" value="base_footprint"/>
      <param name="world_frame" value="/odometry/filtered"/>

      <remap from="/odom_wheels" to="/odom"/>
      <param name="transform_time_offset" value="0.0"/>
      <param name="odom0" value="odom"/>
      <param name="imu0" value="imu/data"/>

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

      <rosparam param="imu0_config">[false, false, false,
                                     true,  true ...
edit retag flag offensive close merge delete


This seems to indicate that your GPS data is not being fused at all. Please post your full launch/configuration and sample messages for each input.

Tom Moore gravatar image Tom Moore  ( 2017-04-11 05:06:03 -0600 )edit

Thank you for your comment Tom, I edited my question and added the launch file , I will add a bag file or some data messages as soon as possible, I don't have the robot with me right now , so I have to go back to the bag files that I've got and post some filtered data.

Jasmin gravatar image Jasmin  ( 2017-04-13 12:19:47 -0600 )edit

I added the bag file, and I would be grateful if you help me!

Jasmin gravatar image Jasmin  ( 2017-04-14 07:01:15 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2017-06-26 07:32:43 -0600

Tom Moore gravatar image

when looking at their output in the map frame I am supposed to see a drift between them but they are still the same

That's not necessarily true. rviz is using the map->odom transform too, so if you visualize your odom-frame data in the map frame, it will line up perfectly with the map-frame data. This is a sign that the map->odom transform is correct.

In other words, rviz transforms the nav_msgs/Odometry messages to rviz's "Fixed Frame" before it displays it. You therefore won't be able to see drift between your two state estimates without a tool for plotting raw data. I would try something like PlotJuggler. If they still line up when you use that tool, let me know.

edit flag offensive delete link more


Thanks Tom, This tool seems great, I was working on a python code enabling me to plot the data from files containg the topics data without rviz . But this tool will surely make my life much easier. I 'll try to check it out as soon as possible and give you my feedback.

Jasmin gravatar image Jasmin  ( 2017-07-07 12:56:06 -0600 )edit

Question Tools

1 follower


Asked: 2017-02-21 03:05:48 -0600

Seen: 2,112 times

Last updated: Jun 26 '17