Ask Your Question

Fusing IMU and GPS to the map frame using robot_localization

asked 2021-03-24 17:25:11 -0500

ClintQ gravatar image

updated 2021-03-24 17:26:30 -0500

Similar to the question asked here with respect to fusing GPS and IMU sensor data when those are the only two sensors available. My question is with respect to creating the odom and map frames. Based on the dual_ekf_navsat_example, an ekf_localization_node1 fuses odom and IMU data inputs and generates an output odometry/filtered and creates the odom->base_link transform. The second ekf_localization_node2 takes the IMU, odom, and odometry/gps inputs and generates an output odometry/filtered_map and creates the odom->map transform. Finally, the navsat_transform_node takes the gps, imu, and odometry/filtered_map inputs and generates an output odometry/gps.

If I don't have an odometry source for the ekf_localization_node1 what is best practice to provide that node with odometry. Also, should the output from ekf_localization_node1 be an input to ekf_localization_node2?

Once this is set up properly, what is the correct output to use for estimating my robot's current position in the map frame?

Thank you for the help!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2021-03-31 04:56:25 -0500

xaru8145 gravatar image

updated 2021-03-31 05:05:22 -0500

The approach you are describing consists of running two instances of an EKF. One with odometry and GPS (ekf_localization_node2) and one only with odometry (ekf_localization_node1). This is done because the GPS data is subject to discrete discontinuities (jumps) and it is likely to be unfit for use by navigation modules. Therefore, we would use odometry/filtered for navigation and odometry/filtered_map for localization.

If you are operating the robot manually with a remote and you do not need navigation, you can only use one instance. The odom and map frames are fix frames. Typically, the map frame is fixed at a specific location and the odom frame starts wherever you start robot localization. If you are not navigating autonomously, you can provide a static transform between map to odom and you can have the EKF2 publishing odom->base_link. For example:

<node pkg="tf2_ros" type="static_transform_publisher" name="map_odom" args="0 0 0 0 0 0 map odom" />

You will have to bear in mind that this can have jumps and it is not desirable to have a transform that can jump around. But for instance, if you have RTK GPS with high precision, maybe this is not as problematic.

As for your specific questions: (1) Depending on the robot you have but you can add wheel odometry or visual odometry. (2) No, you should provide the odometry inputs separately for both EKF instances.

edit flag offensive delete link more


Thank you for the answer. My application is marine, so neither visual nor wheel odometry are reliable. I will be using this for navigation as well as other tasks that require the vessel to have fairly accurate localization.

ClintQ gravatar image ClintQ  ( 2021-04-13 15:09:48 -0500 )edit

If you do some research on odometry applied to underwater/vessel robots there is an extensive use of stereo cameras that perform visual odometry extracting landmarks in image sequences. It also depends on how close to the floor you navigate, where it will be easier to extract features. If you will be navigating, it is then recommended to use the 2 EKF implementations. For navigation purposes, you would use the output from ekf_localization_node1. To obtain a precise localization for other purposes you would use the output from ekf_localization_node2. I do not know the exact implementation of your robot and the application, but if you do not need a super robust control and precise trajectory, you might try using just EKF2 and use this ouput that includes GPS for navigation.

xaru8145 gravatar image xaru8145  ( 2021-04-15 05:32:58 -0500 )edit

Hi, I am trying to fuse odometry, imu and RTK GPS (data freq: 1Hz) to obtain a continuous GPS coordinates, is it necessary to have two ekf nodes?

SimonSong gravatar image SimonSong  ( 2021-06-25 02:18:42 -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



Asked: 2021-03-24 17:25:11 -0500

Seen: 195 times

Last updated: Mar 31