|Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags.
Simulating the 2dnav StackDescription: This tutorial describes how to simulate a 2d-navigation stack in gazebo.
Tutorial Level: INTERMEDIATE
sudo apt-get install ros-diamondback-pr2
For this tutorial, you need to install the 'pr2all' variant of ROS (see installation instructions). On Ubuntu, this means:
sudo apt-get install ros-cturtle-pr2all
And you will also need to check out the following package:
svn co https://code.ros.org/svn/wg-ros-pkg/stacks/wg_robots_gazebo/trunk/pr2_2dnav_gazebo/
Running with a laser-equipped robot simulated in Gazebo
Assuming you have successfully built wg-ros-pkg package pr2_2dnav_gazebo
rosmake pr2_2dnav_gazeboIf not, see [:Simulator/Installation: simulator installation instructions]
Export ROBOT environment variable
- Launch the pr2_2dnav_gazebo demo by issuing the following commands:
roslaunch pr2_2dnav_gazebo pr2-armless-wg-fake_localization.launch
- or try the amcl version by issuing the following commands:
roslaunch pr2_2dnav_gazebo pr2-wg-amcl.launch
Visualize and Setting Goal Pose with RVIZ
On a separate terminal, you can start rviz by:
rosmake pr2_navigation_global roslaunch pr2_navigation_global rviz_move_base.launch
If you are using rviz_move_base.launch, you need to give rviz an initial pose estimate (see PR2 Navigation Stack Demo for how to do that).