## 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=[[turtlebot_simulator/Tutorials/hydro/Explore the Gazebo world|Explore the Gazebo world]] ## descriptive title for the tutorial ## title = Make a map and navigate with it ## multi-line description to be displayed in search ## description = Use the navigation stack to create a map of the Gazebo world and start navigation based on it. ## the next tutorial description (optional) ## next = ## links to next tutorial (optional) ## next.0.link= ## next.1.link= ## what level user is this tutorial for ## level= IntermediateCategory ## keywords = simulation, gazebo, map building, navigation #################################### <> <> == Overview == In this tutorial we will create a map of a virtual world and then use it to navigate around. Basically we will reproduce [[http://wiki.ros.osuosl.org/turtlebot_navigation/Tutorials/Build%20a%20map%20with%20SLAM|build a map]] and [[http://wiki.ros.osuosl.org/turtlebot_navigation/Tutorials/Autonomously%20navigate%20in%20a%20known%20map|navigate a map]] !TurtleBot tutorials in a simulated world. So if you have doubts about using the navigation stack with !TurtleBot those tutorials will probably help you. == Make a map == First, bring up the TurtleBot simulation as described in the [[turtlebot_simulator#Quick Start|Quick Start Guide]], but this time we will load a slightly funnier world: {{{ $ source /opt/ros/hydro/setup.bash $ roslaunch turtlebot_gazebo turtlebot_playground.launch }}} The playground world with a !TurtleBot2 looks like this: {{attachment:turtlebot_playground.png||width=760}} {{{#!wiki tip '''Tip: ''' of course you can also make your own world! With Gazebo it's not difficult, but is beyond the scope of this tutorial. }}} You can customize your simulated !TurtleBot by setting TURTLEBOT_XXX environment variables; for example: {{{ $ export TURTLEBOT_BASE=create $ export TURTLEBOT_STACKS=circles $ export TURTLEBOT_3D_SENSOR=asus_xtion_pro $ roslaunch turtlebot_gazebo turtlebot_playground.launch }}} will simulate a !TurtleBot 1 with an Asus Xtion Pro camera. {{{#!wiki caution '''Caution: ''' Gazebo plugins for Create and Roomba bases don't work perfectly on Hydro, so expect strange behaviors when using them. }}} To start map building, type: {{{ roslaunch turtlebot_gazebo gmapping_demo.launch }}} Use RViz to visualize the map building process: {{{ $ roslaunch turtlebot_rviz_launchers view_navigation.launch }}} Then, as explained in the [[turtlebot_simulator/Tutorials/hydro/Explore the Gazebo world|previous tutorial]], use your favorite teleoperation tool to drive the TurtleBot around the world, until you get satisfied with your map. This capture shows the mapping process after turning 360 degrees. {{attachment:turtlebot_playground_rviz.png||width=760}} Finally, save the map to disk: {{{ $ rosrun map_server map_saver -f }}} == Navigate the playground == To be sure that all will run as expected, kill all you launched in the previous section and repeat all steps except the map building. Instead, type: {{{ roslaunch turtlebot_gazebo amcl_demo.launch map_file:= }}} Or if you prefer to use an already created map, just omit the map_file argument. Now you can send the robot anywhere in the playground with RViz, same way as explained on [[http://wiki.ros.osuosl.org/turtlebot_navigation/Tutorials/Autonomously%20navigate%20in%20a%20known%20map|navigate a map]] tutorial. ## AUTOGENERATED DO NOT DELETE ## TutorialCategory ## FILL IN THE STACK TUTORIAL CATEGORY HERE