## For instruction on writing tutorials ## http://www.ros.org/wiki/WritingTutorials #################################### ##FILL ME IN #################################### ## for a custom note with links: ## note = ## for the canned note of "This tutorial assumes that you have completed the previous tutorials:" just add the links ## note.0= [[http://wiki.ros.org/rtabmap_ros/Tutorials/HandHeldMapping|RGB-D Hand-Held Mapping With a Kinect]] ## note.1= [[http://wiki.ros.org/rtabmap_ros/Tutorials/SetupOnYourRobot|Setup RTAB-Map on Your Robot!]] ## descriptive title for the tutorial ## title = Mapping and Navigation with Turtlebot ## multi-line description to be displayed in search ## description = This tutorial shows how to use RTAB-Map with Turtlebot for mapping and navigation. ## the next tutorial description (optional) ## next = ## links to next tutorial (optional) ## next.0.link= [[http://wiki.ros.org/rtabmap_ros/Tutorials/StereoOutdoorMapping|Stereo Outdoor Mapping]] ## next.1.link= ## what level user is this tutorial for ## level= IntermediateCategory ## keywords = #################################### <> ## AUTOGENERATED DO NOT DELETE ## TutorialCategory ## FILL IN THE STACK TUTORIAL CATEGORY HERE <> == Introduction == (Originally from [[http://official-rtab-map-forum.67519.x6.nabble.com/Demo-RTAB-Map-on-Turtlebot-td439.html|this post from RTAB-Map's forum]]) This page will show how to use rtabmap with navigation stack on a Turtlebot3. {{attachment:overview_tf_rtabmap.png|Overview|width="700"}} Requirements: {{{ # Noetic: sudo apt install ros-noetic-rtabmap-demos ros-noetic-turtlebot3-simulations ros-noetic-turtlebot3-navigation ros-noetic-dwa-local-planner }}} {{attachment:turtlebot_mapping.png|Turtlebot mapping with rtabmap}} Usage: {{{ export TURTLEBOT3_MODEL=waffle roslaunch turtlebot3_gazebo turtlebot3_world.launch export TURTLEBOT3_MODEL=waffle roslaunch rtabmap_demos demo_turtlebot3_navigation.launch }}} == Autonomous Navigation == When a map is created (in mapping mode or localization mode), you can then follow the same steps from 2.3.2 of the [[http://wiki.ros.org/turtlebot_navigation/Tutorials/Autonomously%20navigate%20in%20a%20known%20map#Teleoperation|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): {{attachment:turtlebot_navigation.png|Turtlebot navigation with rtabmap}} The commands sent by [[move_base]]: {{{ $ rostopic echo /mobile_base/commands/velocity }}} == Localization mode == After 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:=true }}} Move 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. == Issues == * On autonomous navigation, if teleop node is also sending commands on the same topic as `move_base` at 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 in `turtlebot_bringup/launch/includes/robot.launch.xml` from 5 to 10 Hz. You can also increase `wait_for_transform argument` of [[https://github.com/introlab/rtabmap_ros/blob/master/rtabmap_demos/launch/demo_turtlebot_mapping.launch|demo_turtlebot_mapping.launch]] to `0.2`. * If sometimes the robot is planning a straight path through an obstacle, it may be related to this [[https://github.com/ros-planning/navigation/issues/320|issue]]. This can be fixed by using `rtabmap_costmap_plugins::StaticLayer` instead of `costmap_2d::StaticLayer` [[https://github.com/turtlebot/turtlebot_apps/blob/indigo/turtlebot_navigation/param/global_costmap_params.yaml#L9|here]].