Repository navigation
Mapping and Navigation with Turtlebot (ROS1)
Description: This tutorial shows how to use RTAB-Map with Turtlebot for mapping and navigation.
(Originally from this post from RTAB-Map's forum)
This page will show how to use rtabmap with navigation stack on a Turtlebot3.
Requirements:
# Noetic:
sudo apt install ros-noetic-rtabmap-demos ros-noetic-turtlebot3-simulations ros-noetic-turtlebot3-navigation ros-noetic-dwa-local-planner
Usage:
export TURTLEBOT3_MODEL=waffle
roslaunch turtlebot3_gazebo turtlebot3_world.launch
export TURTLEBOT3_MODEL=waffle
roslaunch rtabmap_demos demo_turtlebot3_navigation.launchWhen a map is created (in mapping mode or localization mode), you can then follow the same steps from 2.3.2 of the Autonomous Navigation of a Known Map with TurtleBot tutorial to navigate in the map.
Normally, you only have to "drop" a navigation goal on the map with RVIZ to see the robot moving autonomously to it. Click on "2D Nav Goal" button in RVIZ to set a goal. You should see a planned path (red line) like this to the goal set (green arrow):
The commands sent by move_base:
$ rostopic echo /mobile_base/commands/velocityAfter a mapping session as above, a database is saved here ~/.ros/rtabmap.db. Now restart the demo_turtlebot3_navigation.launch with argument localization:=true:
$ roslaunch rtabmap_demos demo_turtlebot3_navigation.launch localization:=trueMove the robot around until it can relocalize in the previous map, then the 2D map would re-appear again when a loop closure is found.
-
On autonomous navigation, if teleop node is also sending commands on the same topic as
move_baseat the same time, the robot may not move. -
If there are many TF warnings, you can try to increase
robot_state_publisher's publishing frequency inturtlebot_bringup/launch/includes/robot.launch.xmlfrom 5 to 10 Hz. You can also increasewait_for_transform argumentof demo_turtlebot_mapping.launch to0.2. -
If sometimes the robot is planning a straight path through an obstacle, it may be related to this issue. This can be fixed by using
rtabmap_costmap_plugins::StaticLayerinstead ofcostmap_2d::StaticLayerhere.
Next tutorial: Tango ROS Streamer