How to combine slam_toolbox and robot_localization using Nav2?
Setup details: ROS2 foxy on arm architecture CPU with nav2, slam_toolbox and robot_localization installed. My physical robot has an IMU, odometry, GPS and LIDAR sensors.
I'm currently working on the navigation design of the robot. I would like to fuse all data available from sensors to obtain a pose estimation and use it to navigate with Nav2. The map will be created using slam_toolbox and Nav2 tools, with all the data coming from the LIDAR.
I've been following official tutorials of Nav2 (https://navigation.ros.org/setup_guid...) and it recommends to use robot_localization package to fuse sensors data. As I have a GPS available, according to the robot_localization wiki (http://docs.ros.org/en/noetic/api/rob...), the best option is to run two instances of robot_localization:
- One for continuous data, that is, IMU and Odometry. It will publish the
odom->base_link
transform. I guess I could include LIDAR information too, but I'm not sure if it would be useful. - Another instance for both continuous and discrete data, that is, IMU, Odometry and GPS. This ekf instance will use the pose data provided by
navsat_transform_node
, which will receive data from the GPS. It will publish themap->odom
transform.
However, running slam_toolbox simultaneously with this previous setup will create another node publishing the same transform of map->odom
(navsat_transform_node is already publishing it). I guess this will result in an erratic behavior.
What would be the appropriate solution here? Should I configure slam_toolbox to stop publishing the transform? Is there any feasible way to combine functionalities of both nodes? Should I add the pose published by slam_toolbox node into the ekf too?
I'm open to any other suggestions about how to redesign the navigation system.