[Documentation] [TitleIndex] [WordIndex

Note: This tutorial assumes that you have completed the previous tutorials: PR2/StartRobot.
(!) 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.

Build and Bringup of the Navigation Stack

Description: This tutorial provides a step-by-step guide to building and running the navigation stack on a PR2 robot. Before you begin this tutorial, please make sure that you follow the PR2/StartRobot. We assume that you successfully brought up everything from that step.

Tutorial Level: BEGINNER

For our purposes, we'll refer to the robot being used as prg, you can just replace the g with the appropriate letter for the robot you want.


Build everything we need for the navigation stack:

ssh prg2
rosmake 2dnav_pr2

You'll need to make sure that the robot has the same version (svn revision) of both the 2dnav_pr2 and the nav_view. If not, a message saying the md5sum doesn't match will appear.

If you have your own map

If you have your own map to use, you'll need to complete the following step. If you want to use the willow map, or no map at all, just follow the instructions below.

ssh prg2
cd "the directory where your map is stored"
rosrun map_server map_server  "map_file" "map_resolution"


If you wish to run the navigation stack with a global map, see the Launch with Localization section. Otherwise, if you just want to run the robot in a local coordinate frame with no map and no localization see the Launch without Localization section.

Launch with Localization

The nav stack is now up and ready to run

Continue to the Manually giving goals section.

Launch without Localization

Tucking the arms

In order for the navigation stack to operate safely, it is important to tuck the arms within the footprint of the robot. To do this, we'll run one of the following invocations of the tuckarm.py script depending on if our robot has a left, right, or both arms.

First, make sure pr2_tuckarm is made:

rosmake pr2_tuckarm

For a robot with a right arm run:

rosrun pr2_tuckarm tuckarm.py r

For a robot with a left arm run:

rosrun pr2_tuckarm tuckarm.py l

For a robot with both arms run:

rosrun pr2_tuckarm tuckarm.py b

Manually giving goals

You can set goals manually via nav_view or rviz:

Further Learning

If you're interested in sending the navigation stack goals to follow from code rather than from rviz or nav_view, you should check out the Sending Simple Goals tutorial in the navigation stack documentation. It will show, step-by-step, how to write a simple ROS node to send goals to the PR2.

2018-12-08 12:13