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

How to combine slam_toolbox and robot_localization using Nav2?

asked 2023-03-24 05:18:29 -0500

Cferreira gravatar image

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 the map->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.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
4

answered 2023-03-24 17:25:56 -0500

I think your description of the problems are accurate to what it is you're trying to accomplish. There's more than one potential answer but you're asking the right questions.

Disabling TF publication in SLAM Toolbox or redirecting it to other frames to use for fusion with GPS is certainly possible. You're right to think you shouldn't publish from both R_L and SLAM Toolbox over the same frames or else it will cause erratic behavior. This is totally feasible to fuse the output pose of SLAM Toolbox into a filter with GPS to combine them.

edit flag offensive delete link more

Comments

I have the exact same configuration as Cferreira, and although just disabling the frame publishing in SLAM_toolbox works, would you mind explaining how you would extract the information from SLAM toolbox without it interfering with the ekf instance that publish map->odom ?

Timothée gravatar image Timothée  ( 2023-05-11 03:55:16 -0500 )edit

Question Tools

3 followers

Stats

Asked: 2023-03-24 05:18:29 -0500

Seen: 656 times

Last updated: Mar 24 '23