Pr2 Manual r306
Pr2 Manual r306
Pr2 Manual r306
Willow Garage
1 Introduction 7
1.1 Before you start . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2 Safety 9
2.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.2 Design Features . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.3 General Usage Guidelines . . . . . . . . . . . . . . . . . . . . 10
2.4 Safety Program . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3 PR2 hardware 17
3.1 What’s in the box . . . . . . . . . . . . . . . . . . . . . . . . 17
3.1.1 PR2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.1.2 Accessory kit . . . . . . . . . . . . . . . . . . . . . . . 17
3.1.3 Large calibration target . . . . . . . . . . . . . . . . . 21
3.1.4 Toolkit . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.1.5 Base-station computer . . . . . . . . . . . . . . . . . . 21
3.2 Mechanism . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.2.1 Terminology . . . . . . . . . . . . . . . . . . . . . . . 22
3.2.2 Links and Joints . . . . . . . . . . . . . . . . . . . . . 24
3.2.3 Drivetrains . . . . . . . . . . . . . . . . . . . . . . . . 27
3.2.4 Motion control . . . . . . . . . . . . . . . . . . . . . . 30
3.2.5 Mechanical specs . . . . . . . . . . . . . . . . . . . . . 32
3.3 Sensors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.3.1 Base Laser . . . . . . . . . . . . . . . . . . . . . . . . 36
3.3.2 Tilting Laser . . . . . . . . . . . . . . . . . . . . . . . 36
3.3.3 Head Cameras . . . . . . . . . . . . . . . . . . . . . . 37
3.3.4 Forearm cameras . . . . . . . . . . . . . . . . . . . . . 37
3.3.5 Gripper Sensors . . . . . . . . . . . . . . . . . . . . . . 38
3.3.6 Inertial measurement unit . . . . . . . . . . . . . . . . 38
3
4 CONTENTS
3.3.7 Speaker . . . . . . . . . . . . . . . . . . . . . . . . . . 38
3.4 Power system . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.4.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.4.2 Power Busses . . . . . . . . . . . . . . . . . . . . . . . 39
3.4.3 Batteries . . . . . . . . . . . . . . . . . . . . . . . . . 40
3.4.4 Power Board . . . . . . . . . . . . . . . . . . . . . . . 40
3.4.5 Run/Stop controls . . . . . . . . . . . . . . . . . . . . 43
3.4.6 Power for sensors . . . . . . . . . . . . . . . . . . . . . 44
4 PR2 Computers 45
4.1 Computer hardware . . . . . . . . . . . . . . . . . . . . . . . 45
4.1.1 Computer 1 (c1) . . . . . . . . . . . . . . . . . . . . . 45
4.1.2 Computer 2 (c2) . . . . . . . . . . . . . . . . . . . . . 46
4.1.3 Basestation . . . . . . . . . . . . . . . . . . . . . . . . 46
4.2 Networking . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
4.2.1 Network segments . . . . . . . . . . . . . . . . . . . . 47
4.2.2 Network Explanation . . . . . . . . . . . . . . . . . . . 48
4.2.3 Service Port . . . . . . . . . . . . . . . . . . . . . . . . 50
4.2.4 WAN port . . . . . . . . . . . . . . . . . . . . . . . . . 50
4.2.5 Wireless access point . . . . . . . . . . . . . . . . . . . 50
4.2.6 Wireless router . . . . . . . . . . . . . . . . . . . . . . 50
4.3 Computer Configuration . . . . . . . . . . . . . . . . . . . . . 50
4.3.1 BIOS . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
4.3.2 Networking . . . . . . . . . . . . . . . . . . . . . . . . 51
4.3.3 NFS and Unionfs . . . . . . . . . . . . . . . . . . . . . 52
4.3.4 autofs . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
4.3.5 Home directories . . . . . . . . . . . . . . . . . . . . . 53
4.3.6 Kernel . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
4.3.7 Storage . . . . . . . . . . . . . . . . . . . . . . . . . . 53
4.3.8 Default user account . . . . . . . . . . . . . . . . . . . 55
4.3.9 Creating user accounts . . . . . . . . . . . . . . . . . . 55
4.3.10 User groups . . . . . . . . . . . . . . . . . . . . . . . . 55
4.3.11 Backing up and restoring users . . . . . . . . . . . . . 56
4.3.12 Clock synchronization . . . . . . . . . . . . . . . . . . 56
4.3.13 Configuring the System ROS installation . . . . . . . 57
4.3.14 Log files . . . . . . . . . . . . . . . . . . . . . . . . . . 58
4.3.15 Udev . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
4.4 Basestation Setup and Pairing . . . . . . . . . . . . . . . . . 58
4.4.1 Requirements . . . . . . . . . . . . . . . . . . . . . . . 59
4.4.2 Plugging things in . . . . . . . . . . . . . . . . . . . . 60
CONTENTS 5
8 Maintaining PR2 95
8.1 Installing upgraded stacks . . . . . . . . . . . . . . . . . . . . 95
8.2 Installing updated disk images . . . . . . . . . . . . . . . . . 95
8.3 Resetting PR2 . . . . . . . . . . . . . . . . . . . . . . . . . . 95
8.4 Diagnostics Logs . . . . . . . . . . . . . . . . . . . . . . . . . 96
8.4.1 Setting up automatic transfer . . . . . . . . . . . . . . 96
8.4.2 Manual transfer . . . . . . . . . . . . . . . . . . . . . . 96
8.5 Solving hardware problems . . . . . . . . . . . . . . . . . . . 96
8.5.1 Figuring out what’s wrong . . . . . . . . . . . . . . . . 96
8.5.2 Support . . . . . . . . . . . . . . . . . . . . . . . . . . 96
8.5.3 Documentation . . . . . . . . . . . . . . . . . . . . . . 97
Chapter 1
Introduction
Space To use the PR2 you will need to have enough room for it to drive
around and move its arms. The PR2 is designed to move through ADA-
compliant spaces (Americans with Disabilities Act), so corridors should be
at least 36” wide, doorways should be at least 32” wide, and the ground
should be flat and level. You will need enough space for the PR2 to move
around and perform tasks.
Safe Environment The space where the PR2 operates should be free of
hazards. Specifically, stairways or other fall hazards can pose an extreme
danger and the PR2 should not be operated near any type of dropoff. You
should also avoid hazardous objects, sharp objects such as knives, sources
7
8 CHAPTER 1. INTRODUCTION
Electrical The PR2 charges using a standard 120V American power out-
let. The robot can draw 15A of current when plugged in, so we strongly
recommend recharging the PR2 only on outlets with no other devices on the
circuit breaker.
Development tools You will need at least one laptop or desktop com-
puter to connect to the robot. The PR2 ships with a base-station computer,
which is a desktop, but you will need to provide a screen, mouse, and key-
board. A laptop with wireless access is ideal.
ROS Since all of the PR2 software is based on ROS, completing the begin-
ning tutorials available at ROS.org will help you understand the structure
of the software on the robot and will give you tools to understand the data
that is moving around in the system.
PR2 Safety Be sure to familiarize yourself with the contents of the fol-
lowing chapter on safety before using the PR2.
Chapter 2
Safety
2.1 Overview
Safety is a vitally important concern whenever you are around a PR2. Its
a heavy piece of equipment with many moving parts. The robot travels
through the environment and can carry and manipulate a wide variety of
objects. Its movements and actions are not completely predictable. The
PR2 can cause significant damage if it falls on or runs over someone. There
are several ways it can pinch, grab, and twist fingers or other body parts.
The robot can wield dangerous implements and knock heavy objects over.
You must always be cautious and attentive when you are around a PR2.
Managing safety is a challenge when dealing with any complex engi-
neering system. In the case of the PR2, consider also the open, extensible,
programmable, experimental nature of the platform. The PR2’s capabili-
ties and behaviors change over time, with user interactions, and with re-
programming.
With this in mind, Willow Garage has chosen a three-fold approach.
First, we have designed the PR2 to minimize potential risks and maximize
inherent safety, cognizant of its uncertain uses. Second, we communicate to
all users about how to minimize risk. And third, we have implemented an
explicit safety program to ensure that the community continues to identify
9
10 CHAPTER 2. SAFETY
Before operating or working with the PR2 you must do the follow-
ing:
Supervise children, visitors, and anyone who has not followed the
previous guideline. In particular, make sure they
– Keep fingers, hair, and clothing away from wheels and gears.
– Be aware of the location of emergency exits and make sure the
robot cannot block them.
– Do not operate the robot outdoors.
Keep the PR2 away from open flames and other heat sources. The
PR2 covers are flammable. They may burn if ignited.
When plugging in the PR2, always attach the power cord to the AC
inlet on the robot before attaching it to the AC outlet on the wall.
Unplug the cord from the wall before unplugging from the robot.
When you are developing software, you should consider that some
people have adverse reactions to the flicker from the texture projector
and only turn it on when necessary.
Regularly inspect and maintain anything the robot interacts with. For
example, regularly inspect the electrical outlets the robot plugs into.
Be aware that many things can go wrong even with a seemingly simple
activity. For example, consider what might go wrong while driving the
robot with the joystick:
robot could cause damage by running into a person or falling down stairs.
The Safety Board maintains a list of all known hazards in a document called
PR2 Hazards, which can be found on the safety.willowgarage.com web site.
Anyone who works with a PR2 should review this list regularly. If you know
of a potential source of damage that is not covered by one of the hazards
in the list, please let us know, using one of the contact methods described
below.
When a hazard is identified, one or more of the following steps is taken:
A Safety Officer for each PR2 site assists with two-way communication.
By email at safety@willowgarage.com
By phone at 650-475-9794
16 CHAPTER 2. SAFETY
Chapter 3
PR2 hardware
3.1.1 PR2
See later sections in this chapter for more detail on the PR2 robot itself or
see Chapter 5 for instructions on getting it out of the crate and set up in
your lab.
Wireless Joystick
The PR2 ships with a bluetooth joystick for teleoperating the robot. The
bluetooth joystick is a Sony DUALSHOCK3 (Figure 3.1) wireless controller.
It can be charged using any standard USB A to mini-B USB cable (one is
included in the accessory kit). For more information, see the ps3joy package
at ros.org.
17
18 CHAPTER 3. PR2 HARDWARE
Wireless run-stop
The PR2 comes with an OMNEX T50 wireless run-stop transmitter. When
the red button is pressed, or the unit is out of range, the wireless run-stop
transmitter will halt the motors and put the power system in standby mode.
Note that this does not completely cut power to the robot.
To start the wireless run-stop, press the green start button (Figure 3.2);
if this works properly, you will see a light flashing on the wireless run-stop
beside the start button. While transmitting, the wireless run-stop has a
range of approximately 800 ft. The wireless run-stop is powered by four AA
batteries; the battery light will flash when the battery charge is low and new
batteries are required.
3.1. WHAT’S IN THE BOX 19
User Manual
3.1.4 Toolkit
3.2 Mechanism
PR2 is a 32-dof mobile manipulator with a mobile base, two arms, and a
variety of sensors on a pan-tilt head.
3.2.1 Terminology
We talk about the robot kinematics using the concepts of joints, links,
frames, actuators, and transmissions. Each of these is defined and repre-
sented in code, as well as having a unique name. In general, a single joint
will have an actuator and a transmission and will connect two links together.
A link is a rigid body in the kinematic tree, and will have a coordinate frame,
but not all frames are associated with links. We allow ”fixed” joints, so some
rigid bodies that could be considered one link are considered to be two links
rigidly joined together. This is done mostly at locations where there is a
physical interface between components.
space. Every link has an associated frame, but we also use frames
to represent other things, such as the optical frame of a camera, the
global map, or the location of a detected object. Frames are always
defined relative to one another, and relationships and transformations
between them are tracked using the tf package.
Joint Joints are considered part of the robot, and define the relationship
between links. The joints for the PR2 are defined in the URDF de-
scription that can be found in the pr2 description package. The PR2
has mostly rotational joints, but the torso is translational, and there
are also a number of ”fixed” joints used to represent the notion that
two links are part of the same rigid body. Rotational and translational
joints are generally represented in the same way in the system, and
we refer to joint ”effort” instead of force or torque, as well as using
position, and velocity to represent both linear and angular movement.
In general, the names for a link and the associated frame will be similar
(e.g. r forearm link and r forearm frame), and the names for an actuator, a
transmission, and the associated joint will be similar (e.g. r elbow flex motor,
r elbow flex trans, and r elbow flex joint). For components such as arms
and casters that are included in the robot in multiple locations, we use a
short prefix to indicate which location we are referring to
24 CHAPTER 3. PR2 HARDWARE
Base-Body-Spine
The base-body-spine assembly of the PR2 has only one joint - the prismatic
torso lift joint which moves the torso up and down relative to the base.
The base link holds the rear panel with electrical/network connections, the
computers, and the battery system, as well as bolting directly to the casters.
The torso lift link, which moves up and down, contains the speaker, and
the IMU, as well as serving as the attachment point for both arms and for
the head.
3.2. MECHANISM 25
Head
The pan-tilt head which holds the wide and narrow stereo cameras, the 5
mega-pixel camera, and the texture projector is made up of two links - the
head pan link, connected to the torso by the head pan joint, and the
head tilt link, connected to the pan link by the head tilt joint. The
sensors are all attached to the tilt link.
The upper Hokuyo laser range-finder is mounted to the laser mount link,
which is tilted up and down by the laser tilt mount joint
Casters
Each robot has four steered and driven casters, one at each corner of the
base. The casters are refered to as front right, front left, back right, and
back left. They are named according to the above table of location pre-
fixes (fr , fl , br , and bl ). Each caster consists of a rotation joint loca-
tion caster rotation joint, which rotates or steers the body of the caster,
called the location caster rotation link, around a vertical axis. Attached
to the body of the caster are two parallel driven wheels, whose drive joints
26 CHAPTER 3. PR2 HARDWARE
are location caster r wheel joint and location caster l wheel joint.
Arms
The arm has 7 degrees of freedom. Starting from the attachment to the
torso, the first joint is the location shoulder pan joint which rotates the
location shoulder pan link, or shoulder turret, around a vertical axis.
The shoulder turret contains the springs that store energy to counter-
balance the mass of the rest of the arm. Two degrees of freedom, the loca-
tion shoulder lift joint and location upperarm roll joint attach the
location upper arm link to the shoulder.
The upper arm contains the counterbalance bar, which is a large steel
bar that attaches to the counterbalance attachment and transmits the coun-
terbalance forces into the structure of the arm. The upper-arm also contains
motors for the location elbow flex joint and location forearm roll joint,
which connect the forearm to the upper-arm.
The forearm (location forearm link) contains a 640x480 color cam-
era that can always see the gripper, as well as the two motor which drive
the wrist flex joint and the continuous location wrist roll joint that
attaches to the gripper.
Grippers
The gripper consists of a central palm link called the location gripper palm link
which is rigidly fixed to the location wrist roll link and has a single ac-
tuated degree of freedom. The motor in the gripper drives the 4 joints of the
gripper together to result in parallel motion of the fingertips. The parallel
distance between the gripper tips is treated as a translational joint, called
location gripper joint that can be controlled. The four rotational joints
in the hand which are constrained to move together are also modelled as
joints which can be observed but not controlled. The gripper also contains
a 3-dof accelerometer and an LED which can be turned on and off to assist
in calibration or finding the location of the gripper in camera images.
Additional Information
A CAD approximated kinematic and inertial description of the PR2 can be
found in the pr2 description package. This package uses a robot specific
Extensible Markup Language (XML) and Document Object Model (DOM)
representation called Uniform Robot Description Format(URDF), which can
be converted or exported to other formats such as COLLADA.
3.2. MECHANISM 27
3.2.3 Drivetrains
The joints in the PR2 are all actuated with brushed electric motors, and
all position sensing is done with optical incremental quadrature encoders.
Except where noted, each joint has an optical sensor (interrupt or reflective)
which is used at startup to identify a home position. Once the home po-
sition is identified, the incremental encoders are used to track motion. All
drivetrains in the robot have positive-engagement drives (gears or belts),
and the motor controllers monitor for encoder errors, so there should not be
any drift in measured position over time, although the repeatibility of the
calibration sensors may cause minor differences in position sensing between
runs.
Velocity estimates are made by differentiating the position sensors at
1ms, so the quantization of the encoders produces noise in the velocity signal,
which is especially significant at low speeds.
Torque estimates are made by measuring the commanded current of
the motor and using the values of the torque constant from the datasheet
together with the model of the transmission. These transmission models
assume 100% efficiency, and accuracy of torque estimates and commands is
limited by the friction in the drivetrain, so joint torque accuracy should be
characterized where you are relying on it.
Head Drivetrains The drivetrains for the head pan, head tilt, and laser
tilt are all fairly similar. Since precise pointing of sensors is important,
28 CHAPTER 3. PR2 HARDWARE
all three of these joints have 10,000 count encoders mounted in the
drivetrain after the major sources of potential backlash (gears). The
laser tilt axis is driven directly by the motor, through the encoder,
and then via a belt-drive. The head pan and tilt are both driven from
the motor through a gearset (planetary gearhead for the tilt joint and
external spur gears for the pan joint). The encoder is mounted on the
shaft after the gearset, and then a belt drive is used for the final stage
reduction. These drivetrains are all high-efficiency and capable of very
high velocities. The software velocity and position limits on these
joints are important to prevent hard collisions with the joint stops,
which will cause damage to the hardware (espially to the sensors). If
the mass of the head is changes significantly, the pan and tilt link gains
may need to be re-tuned.
Caster Drivetrains The three joints in each caster have basically the same
drivetrain, which is a Maxon amax-32 motor with a gearhead and a
continuous belt output. Position sensing is done via an encoder on
the back of the motor. The drivetrain is efficient enough to be easily
backdriveable. To rotate the caster, all three motors work together
(the rotation motor drives the rotation, and the two wheels drive in
opposite directions to provide additional forces. To drive, the two
wheel motors rotate in the same direction and the rotation motor
helps to keep them aligned in the proper direction.
Arm Drivetrains The first four degree of freedom in the arm (shoulder
pan, shoulder lift, upperarm roll, and elbow flex) are all driven with
RE40 motors that have single-stage planetary gearheads which output
to a toothed pulley that runs on a belt. These belts all have termi-
nations at either end of a capstan on the moving link, which is how
the torque is transmitted. The terminations are also the way that
these belts are tensioned, and propoer belt tensioning is important to
prevent backlash (which can come from extra slack in the belt), fric-
tion (which can come from extra tension in the belt), and excess wear
(which can come from a belt which is too tight, too loose, or just mis-
aligned). The position is measured via an optical encoder on the back
of the motor, so the backlash of the gearhead and the stretch of the
belt both contribute to the error in the sensed position. Velocity limits
are important on these joints to prevent motor damage from running
over speed, as well as to prevent rapid decelleration which can damage
the motor, gearhead, and belt.
3.2. MECHANISM 29
These drivetrains are all fairly high efficiency, which means they can
be backdriven. This is made possible by the low force requirements
on those joints due to the arm counterbalance. The counterbalance
uses a system of springs and linkages to compensate for the effect of
gravity on the upper arm and forearm links. The compensation should
be effective throughout the range of motion of the first four links of
the arm.
Wrist Drivetrains The forearm roll joint is driven by a motor in the up-
perarm with a planetary gearhead and external spur gear. Position is
measured via an optical encoder on the back of the motor. Because of
the higher gear reduction, the efficiency and backdriveability of this
joint is not as good as that of the first four joints of the arm.
The wrist flex and roll use a differential drive between two motors.
If the motors are turned in the same direction the wrist rolls, if they
are turned oposite the wrist flexes. The differential bevel gears are
attached after a standard encoder, motor, gearhead assembly.
Gripper Drivetrain The gripper consists of two fingers with two joints
each. Within each finger, a four-bar linkage constrains the two joints
to move together so that the fingertips remain parallel. The two fingers
are constrained together with a sector gear that meshes between the
first phalanges of the two fingers. The motion of the fingers is driven
by a motor which drives a lead-screw in the palm of the hand. This
lead-screw is embedded in the four-bar linkage so that the rotation of
the motor has a nonlinear relationship to the movement of the joints.
The gripper can be back-driven when significant force is applied. Un-
like all other non-continuous joints in the system, the gripper has no
calibration flag. Initial homing is done by closing the gripper until
30 CHAPTER 3. PR2 HARDWARE
it gets blocked and then treating that position as a zero point. This
means that the gripper is unable to detect if it has miscalibrated on
startup.
Home Pose
In order to describe the PR2 robot pose and joint positions in a consistent
manner, a home pose of the robot has been defined. At the home pose,
all joint-angles are considered to be at zero. In the home pose the casters
are facing straight ahead, the arms are straight ahead in front of the body,
the grippers are closed, the tilting laser is level, and the head is centered
and flat. For most joints the calibration reference point is not at the home
pose, or zero position, and the URDF contains the offsets between the flag
positions and the home position.
The coordinate frames for all links of the PR2 are defined to be aligned with
a world coordinate frame of positive z-axis up, positive x-axis forward, and
positive y-axis robot-left when the PR2 is in the home pose. All joint angle
conventions are chosen so that at the home position, positive motion of the
joint causes positive motion around one of the positive axes of the world
coordinate system.
Each motor/encoder on the PR2 has its dedicated Motor Controller Board
(MCB). The MCB detects and counts transitions in the encoder signal,
measures the motor current, and commands the voltage going to the motor.
Each MCB runs a PI-control loop to control the motor current to a desired
value, by commanding the motor voltage. This control loop is closed at
100kHz on an FPGA on the MCB. A shared etherCAT realtime Ethernet
link with the first computer allows all MCBs in the PR2 to communicate
with the main computers with deterministic timing.
Each MCB has the following inputs and outputs:
Encoder input Each MCB can read quadrature incremental encoder in-
put. In proper operation, this should never skip or drift.
3.2. MECHANISM 31
Power input Each MCB is connected to the raw battery-power bus, and
using the circuit breakers you can switch between ”enabled”, which
provides 44-80VDC to the MCB and allows it to drive the motor,
”standby”, which provides 18VDC to the MCB and allows it to con-
tinue to communicate and read sensors but doesn’t allow driving the
motors, and ”disabled”, which turns off power the the MCB altogether.
Digital input Each MCB has a digital input which is used for detecting
the flags at the calibration positions on power-up. The MCB internally
latches the encoder counts at the time that the digital input transitions
from high to low and from low to high, which accurate detection of
calibration flag positions.
Digital output Each MCB has a digital output. On the gripper, this is
used to control the LED mounted in the hand. Elsewhere in the robot,
this is used to generate synchronization pulses which allow synchro-
nizing the cameras, the projector, and the motion control systems
together precisely.
32 CHAPTER 3. PR2 HARDWARE
Motor output Each MCB can drive a single brushed DC motor. The MCB
drives the output with an H-bridge and uses a current-measurement
to do closed-loop current control on the motor.
SPI There are two SPI ports which are only available on the gripper MCBs
and which are used to connect to the fingerip sensors.
Realtime loop
The realtime loop for the PR2 is a single process, which can be found in the
pr2 ethercat package. At runtime, the node is called realtime loop.
This process uses the RT PREEMPT extensions to the Linux kernel to
run as a hard realtime process, with a cycle time of 1ms, and performs
both controller update computations and communication over EtherCAT
with the MCBs. Non-realtime threads within the same process are used
to communicate over ROS to publish diagnostics, configure controllers, and
otherwise control the behavior of the PR2’s motion-control system
Controller manager
. Within the realtime loop, the controller update is dealt with by a ROS com-
ponent which contains both realtime and non-realtime functionality, called
the Controller Manager. Controlle Manager has an update step which is
called by the realtime loop at 1khz which receives measured motor torques
and positions and sends desired motor torques for the next cycle.
The Controller Manager includes the joint-limit safety code that enforces
position, velocity, and torque limits which are necessary to keep the PR2
from damaging its hardware. In addition, it has a dynamic plugin loading
mechanism that allows shared libraries containing realtime controllers to be
loaded and executed inside the 1kHz realtime loop.
Environmental specs
The PR2 is an indoor, household robot. Operating outside this type of envi-
ronment could cause damage to the PR2, and injury or death to operators.
3.2. MECHANISM 33
Water The PR2 has not been tested for any type of contact with wa-
ter or any other liquid. Under no circumstances should the PR2 come in
contact with water from rain, mist, ground water (puddles) and any other
liquid. Water contact can cause damage to the electrical circuitry and the
mechanism.
Drive Surface The drive surface of the PR2 must be capable of support-
ing the entire weight of the PR2, about 450 pounds (220 kgs). If the surface
is too soft, the PR2 can get stuck and fail to drive. A commercial carpet or
tile is recommended.
Incline Surface The PR2 is ready for ADA-compliant ramps, which are
at 1/12 slope. Ramps that are steeper than a 1/12 slope are unsafe and may
be a tip over hazard.
The PR2 motor controller boards (MCB’s) will not allow a current com-
mand greater than the maximum continuous current specified for the joint’s
actuator. This means that maximum joint effort may be lower than the max-
imum effort specified above. Below are the actuators for each joint (Maxon
part number), and their maximum allowable commanded current.
3.3 Sensors
The PR2 has a variety of sensors on its body:
tilting platform can sweep the scanning laser through 135◦ (+90◦ and −45◦
from level) and can be controlled using the default laser tilt controller. For
more information, see the hokuyo node and pr2 default controllers packages
at ros.org.
Wide Stereo Camera The wide stereo camera is part of the dual stereo
pair and is a 100Mb color ethernet camera. The wide stereo uses the
Aptina MT9V032C12STC imager chip and has a maximum resolution
of 752 x 480 pixels at 15 fps. The camera has a field of view (FOV) of
approximately 90◦ and a 2.5mm F2.5 Marshall V-4402.5-2.5-HR lens.
For more information, see the wge100 camera package at ros.org.
Narrow Stereo Camera The narrow stereo camera is part of the dual
stereo pair and is a 100Mb monochrome ethernet camera. The narrow
stereo uses the Aptina MT9V032C12STM imager chip and has a max
resolution of 752 x 480 pixels at 15 fps. The camera has a FOV of
approximately 55◦ and a 5.6mm F2.0 Marshall V-4405.6-2.0-HR lens.
For more information, see the wge100 camera package at ros.org.
Gigabit Ethernet Camera The PR2 has a gigabit ethernet camera lo-
cated to the left of the dual stereo pair on the pan-tilt head. The
gigabit ethernet camera is a Prosilica GC2450C, which uses the Sony
ICX-625AQ imager chip and has a maximum resolution of 2448 x 2050
pixels at 15 fps. Additionally, the gigabit ethernet camera has a 8mm
F1.4-F16 Kowa LM8JC lens. For more information, see the prosil-
ica camera package at ros.org.
Textured Light Projector The PR2 has a textured light projector lo-
cated to the (robot’s) left of the dual stereo pair on the pan-tilt head.
The projector has a FOV of approximately 55◦ and a 5.6mm F2.0 Kowa
LM12JC lens. For more information, see the pr2 camera synchronizer
package at ros.org. Note: The projector will only work if the motors
are enabled and runstop is not hit.
Fingertip Pressure Sensors The default fingertips of the PR2 are sturdy
aluminum blocks with non-slip rubber covers for added friction and
compliance in grasping. However, the aluminum tips can be swapped
out for an (included) set of RoboTouch tactile sensing pads made by
Pressure Profile Systems, each with 22 tactile sensing elements: 15
in a 5x3 array on the front surface, 2 on top, 2 on each side, and 1
in back, near the top. Each tactile element has a pressure range of
0-30 psi (0-205 kPa) and sensitivity of 0.1 psi (0.7 kPa). The sensors
connect to the robot via an SPI ribbon cable and two screws, and have
a maximum scan rate of 35 Hz.
The tactile sensors are highly fragile when not protected by the rub-
ber covering, and so care should be taken not to damage the rubber
covering. For more information, see the fingertip pressure package at
ros.org.
Calibration LED
3.3.7 Speaker
The PR2 has one Logitech V20 notebook speaker located under the pan-tilt
head next to the tilting laser. For more information, see the sound play
package at ros.org.
3.4. POWER SYSTEM 39
AC power The robot has a 3-prong IEC320 plug in the back of the base,
which is connected through a circuit breaker to the four AC-DC con-
verters used to charge the battery packs. With a 120V supply, the
system is designed to draw less than 15A, so a standard 15A or 20A
outlet will suffice. The load is capable at times of approaching the
15A limit, make sure there are no other devices which draw significant
power (e.g. computers or heaters) on the same circuit.
Motor Power Bus The motors get power through 3 discrete circuit break-
ers on the power board. These create three independent motor power
busses: left arm, right arm, and base/head. The motor power bus can
be in one of three states.
12V system bus 12V power for sensors supplied by the power board. This
is also the recommended source of power for user supplied accessories.
12V computer power 12V power for the computers supplied by the power
board.
40 CHAPTER 3. PR2 HARDWARE
3.4.3 Batteries
The battery system has four battery bays. Each bay is comprised of four
Ocean Server BA95HC-FL 14.4V Li-ion batteries, a V-INFINITY VF-S320-
18A-CF 18V AC-DC Power Supply, and a Ocean Server XP-04SRW four-
channel high current battery controller. This provides the PR2 with approx-
imately two hours of countinous operation after a full recharge. For more
information, see the ocean battery driver package at ros.org.
The PR2 battery system reports a warning in the diagnostics if the tem-
perature goes above 50C, which is the maximum recommended operational
temperature of the batteries.
The batteries are exothermic when discharging, and tend to get hottest
when they are near minimum charge. During a work day, when your PR2
is constantly charging and discharging, the temperature of the batteries can
slowly climb. If your lab or workspace is warm (above 25C) you are much
more likely to see this problem.
After the battery temperature goes above approximately 54C, the bat-
teries will not charge until the battery temperature drops below 46C.
If your batteries are reporting that they are too hot, then you need to
reduce the load on the batteries. Generally, it is best to plug the robot in as
soon as possible. It may take several hours for the batteries too cool down
and charge.
The main power board fan will run at full power whenever the batteries
are above 46C. If the fan is abnormally loud, clean your fan filter.
The following table decodes the meaning for the error codes. For further
diagnosis please provide the status codes in bug reports.
count location
1 Self Test
2 Main Loop
3 Breaker 0
4 Breaker 1
5 Breaker 2
6 Calibration Test
Circuit Message
1 Disable via software command
2 Failed during turn on cycle
3 Shutdown by E-stop
4 Circuit breaker tripped
3.4. POWER SYSTEM 43
Besides supplying power the power board also interfaces with the wireless
run/stop radio receiver and the run/stop button. The run/stop system is
designed to reduce the power on the motor bus to a level where only the
board communications and their encoder positions are maintained. The red
button and radio system are described as provide physical run/stop control
over the motors in the robot. This mechanism is implemented in hardware
and can not be altered by software.
Please note that the run/stop system only reduces power to the motor
power bus and nothing else. If there is an electrical problem or power needs
to be shutdown for service, the red DC circuit breaker on the rear lower
panel is the only way to totally shut off the power board.
insert picture
insert picture
insert picture
The robot electrical systems are complex, and it is easy to damage robot
components by hot-plugging. Never plug in or unplug any components inside
the robot unless the power system is shut off completely.
All 12V connectors in the robot use the same connector, a 2x1 Molex
Mini-Fit Jr. The mating connector part number is 39-01-3022 or from
Digikey WM1021-ND. Pin one is negative and pin 2 is positive. Pin 2 is
the pin closest to the latch.
Chapter 4
PR2 Computers
This section covers the configuration of the computers and software that
comes installed on the robot
c1 provides routing for the rest of the robot when it is plugged in via
the WAN port .
45
46 CHAPTER 4. PR2 COMPUTERS
c1 provides routing for the rest of the robot when connected to another
network via an openVPN tunnel
c1 provides DHCP services for other devices connected to the robot
internal network.
c1’s PCI slot is used for a 4-port ethernet card, giving it a total of 6
ethernet ports. These are:
lan0 - lan3: connection to internal robot network
wan0: connected directly to WAN port on back of robot
ecat0: connected to robot ethercat network
4.1.3 Basestation
The basestation is a Zareason xPC. It is a dedicated point of contact through
which network traffic to the robot can be routed. It has 2 ethernet ports,
wan0, on the motherboard, is the primary ethernet port. It is intended to
be plugged into your building network. lan0, on the pci card is a dedicated
port for servicing the robot. When necessary, this port should be plugged
directly into the robot service port.
When configured properly, it is important that the basestation is visible
on port 1194 both via your wired building network as well as via your
building wireless network. This will likely require assistance from your local
network administrator.
4.2 Networking
The majority of communication between components onboard the PR2 hap-
pens via an onboard ethernet network, referred to as the “robot internal
network.” This onboard network can be accessed directly via either wired
connection (through the service port), or wireless connection (through the
WAP). Additionally, the robot can be accessed via the basestation through
a VPN tunnel.
4.2. NETWORKING 47
– 10.68.0.1 - c1 (lan0)
– 10.68.0.2 - c2 (lan0)
– 10.68.0.5 - wifi-router
– 10.68.0.6 - basestation (lan0)
– 10.68.0.91 - c1-esms
– 10.68.0.92 - c2-esms
– 10.68.0.250 - wap
– 10.69.0.11 - c1 (lan1)
– 10.69.0.12 - c2 (lan1)
The above figure depicts the interaction between the robot and building
networks. The dotted lines show paths which may or may not be connected
at any given point in time. That is, the basestation or a laptop may not
always be plugged into the service port, and the robot WAN port may not
always be plugged into the building network. The colored lines depict path-
ways that different network traffic follows. The main thing of importance
to note is that there are three ways to talk to the robot: direct wire, direct
wireless, or VPN. Additionally, the VPN traffic itself can be routed in one
of two ways, either via a wired or wireless path. the VPN. Note: for clarity,
we have labeled all interfaces connected to the building network as WAN,
and interfaces connected to the robot network as LAN, but this may well not
be the case for laptops or desktops on your actual network, where the usual
default interface name is typically “eth0”
Direct wired connection. One possibility is to connect a laptop,
or the basestation lan0 port to the robot service port. This sim-
4.2. NETWORKING 49
ply puts the laptop, or the basetation directly on the robot internal
network. The basestation is always configured to use the IP address
10.68.0.6, whereas the laptop will likely be configured to use DHCP.
When plugged into the service port, you can talk to the robot LAN
ports directly on the 10.68.0.0/24 subnet. This system will work
even if the VPN system is not functioning. This is typically used for
reinstalling the robot, or debugging other networking problems.
VPN connection. When not plugged into the service port, the bases-
tation and robot communicate over VPN. The basestation acts as the
VPN server, and is always reachable at 10.68.255.1. However, there
are two mechanism through which the VPN traffic may be routed.
Ubuntu users. If you run into a computer problem not covered by the PR2
documentation, the Ubuntu Documentation is the next place to look.
4.3.1 BIOS
The BIOS configuration is slightly different between c1 and c2 to allow them
to boot differently. c1 defaults to booting off of the internal disk, while c2
defaults to netbooting off the lan0 interface. Early in the boot process, c1 is
reconfigured to try netbooting off of the the lan1 interface before booting off
the disk (using lan1 rather than lan0 enables the basestation to distinguish
the 2 computers). On a proper shutdown, c1 is switched back booting off
the disk, but in the event of a hard power failure, the default BIOS state
leaves c1 netbooting. This is convenient for reinstallation or recovery.
4.3.2 Networking
To keep connections behaving sensibly when transitioning the VPN connec-
tion to the basestation between wired and wireless, the robot is configured to
route ALL traffic that is not on the robot internal network out through the
basestation. Any traffic not routed via the basestation is sent to a blackhole
to keep connections from getting broken. This means that if VPN is not
connected your robot will not be able to see the outside world even though
it might appear that the network is configured appropriately.
This is handled using an ip rule configuration. Most of these rules
are added by the init-script: /etc/init.d/iprules.sh. You can view the
current rule configuration using the command ip rule:
pr2admin@c1:$ ip rule
0:from all lookup local
1000:from all to 10.68.0.0/24 lookup main
1001:from all to 10.0.2.239 lookup main
1002:from all to 10.68.1.0/24 lookup main
2000:from all lookup vpn
3000:from all blackhole
32766:from all lookup main
32767:from all lookup default
The two important rules are priority 2000 and 3000. The priority 2000 rule
routes all traffic into the vpn routing table:
pr2admin@c1$ ip route list table vpn
default via 10.68.1.6 dev tun0 metric 1
52 CHAPTER 4. PR2 COMPUTERS
The priority 3000 rule is what sends things to the blackhole. By disabling the
priority 3000 rule, traffic which cannot be routed through the basestation,
such as when the vpn tunnel is down, will simply go to the main routing
table.
To remove the priority 3000 rule, you can run:
pr2admin@c1$ sudo ip rule del priority 3000
This may be especially helpful when repairing a system in a particularly
bad state since otherwise you may not be able to fetch necessary software
updates or download necessary configuration files.
Additionally, iptables is configured using configuration files in /etc/iptables.d/.
These rules are responsible for providing firewalling on the robot wan0 in-
terface, turning on masquerading, and NATing incoming vpn traffic into the
robot local network.
4.3.4 autofs
Both of the computers have automount configured for mounting the /home
partition of the other computer in a computer-independent way using autofs.
These automounts are located in the directory /pr. To get to the home
partition on c1 you can use the path /pr/1/ and to get to the home partition
on c2 you can use the path /pr/2/. You should rarely need to do this
explicitly, but it is necessary to make sense of home directory locations.
4.3. COMPUTER CONFIGURATION 53
4.3.6 Kernel
Both c1 and c2 run a 2.6 kernel with the RT PREEMPT patch. We compile
the kernel in order to apply the patch and to enable some configuration.
4.3.7 Storage
Each computer has two hard-drives - one internal 2.5” 500Gb Seagate Mo-
mentus drive, and a slot for a removable 3.5” SATA hard-drive that is ex-
posed on the top of the robot base.
By default the only hard-drive used is the internal drive on c1. There
are 3 relevant partitions created during installation:
when done. Until the drive is unmounted, you do not have a guarantee
the data has been written to disk, and if the robot runs out of batteries,
your data may be lost.
Formatting Drives
If you want to partion / reformat one of the removable drives, or the the
internal drive on c2, you can use the formatdisk helper utility. Simply pass
it the name of the drive you want to format, for example:
or
Drive maintenance
If you suspect a drive of having problems, you can run a selftest using
smartmontools
Note: it may be helpful to assign users the same UID used on your
building network so the UIDs are consistent when mounting shares or moving
around the removable drives.
Moving the home directory and creating the symlink is handled for you
by the script: /usr/local/sbin/adduser.local, which gets run automat-
ically as a part of user-creation. You should not need to worry about this
script at all unless you are changing the user-creation process.
admin – Members of this group have full root privileges when using
the sudo command
To add a user to a group, use the usermod command. The most common
invocation uses the options -a (append) and -G (group). For example:
Move this file off the robot before reinstalling. Then, to restore users:
pr2admin@pr10XX:/etc/ros$ ls -l distro
lrwxrwxrwx 1 root rosadmin 9 2010-11-10 15:27 distro -> boxturtle
pr2admin@pr10XX:/etc/ros$ sudo rm distro
pr2admin@pr10XX:/etc/ros$ sudo ln -s cturtle distro
pr2admin@pr10XX:/etc/ros$ ls -l distro
lrwxrwxrwx 1 root root 7 2010-11-12 10:19 distro -> cturtle
4.3.15 Udev
4.4.1 Requirements
Naming
In order for ROS to work properly, it depends on each computer in your
system being able to correctly resolve the hostnames of all other computers
in your ROS system. For an in depth explanation, please familiarize yourself
with http://www.ros.org/wiki/ROS/NetworkSetup. However, in short, you
are probably going to need 3 hostnames, and 3 IP addresses – one for the
basestation, and one for each of the two robot computers. Each of these 3
hostnames MUST either be resolved by your building network DNS server,
or else they will need to be added to the /etc/hosts file of all the relevant
computers.
IP Address configuration
For the robot to be able to find the basestation, it needs to be given a
constant IP address. Unless you have a reason not to, this IP address should
be assigned to the basestation statically. However, if you are certain that
your DHCP server will always assign the same IP, it is ok for this IP to be
assigned via DHCP.
The IP address assigned to your basestation must be visible on both the
wired and wireless segments of your building network on port 1194. This is
the port that VPN uses when the robot makes its connection back to the
basestation (it can be changed by appropriately modifying /etc/openvpn/server.conf
on the basestation, and /etc/openvpn/basestation.conf on the robot).
Depending on how secure your network is, and whether these segments are
separated by a firewall, you may need assistance from your local sysadmin
to allow traffic through on this port.
Finally, for the robot to be able to find the basestation, both the wired
and wireless networks must provide a DHCP server. The operation of the
system is that the robot will acquire an IP address via DHCP and then
contact the basetation at the known IP address that it is paired to. Review
the section on Networking for a more thorough overview.
Examples
In the remainder of the examples in this section we will assume that our
basestation has been given the hostname prbase1, and our computers will
be named prx1 and prx2. We assume that DNS resolves them correctly as
follows:
60 CHAPTER 4. PR2 COMPUTERS
prbase1 – 192.168.1.100
prx1 – 192.168.1.101
prx2 – 192.168.1.102
When plugging in the basestation, make sure that you plug WAN0 (on
the motherboard) into your building network. LAN0, on the PCI card, is
only intended to be plugged into the robot service port.
Additionally, it is important to plug the DVI port into the installed
graphics card (on the right side of the computer) and not the extra DVI
port on the motherboard.
There is only one place to plug in the power, and your keyboard/mouse
can be plugged into any of the available USB ports.
1. Configuring IPs
Static IP – To configure the basestation with a static IP, you must
edit the file /etc/network/interfaces and change wan0 to use a
4.4. BASESTATION SETUP AND PAIRING 61
domain school.edu
search school.edu
nameserver 192.168.1.1
DHCP – If you are using DHCP, you must make sure that your DHCP
server respects the client-id specification and is configured to assign
a consistant IP address to the client-id of the basestation. NOTE:
macaddress based assignment of IPs will not work correctly because the
basestation also acquires IPs on behalf of the robot. The default client-
id for the basestation is “basestation.” If you need to change this to a
different client-id, you must edit the file /etc/dhcp3/dhclient.conf,
and change the relevant line, for example
2. Configuring Hostname
You will also likely need to change the hostname of the basestation. Leaving
it as “basestation” is ok, but you need to make sure the DNS server correctly
resolves this name to the IP address you have assigned the basestation. To
change the hostname you will need to edit the files: /etc/hostname, to just
contain the name of the basestation. For example:
prbase1
127.0.0.1 localhost
127.0.1.1 prbase1.willowgarage.com prbase1
10.68.255.1 prbase1.willowgarage.com prbase1
10.68.0.1 c1
10.68.0.2 c2
3. Applying Settings
Once you have reconfigured the network, you should reboot the basestation
to make sure the network comes back up correctly. At this point you should
be connected to your local network and be able to ping any machine that
you may want to access the robot from.
the wifi router, and then try to access that ip address. If you can reach
that IP address once the routing entry is added, you know the wifi router
is connected properly. For example, to route requests to the willow garage
website through the wifi-router explicitly:
It will prompt you for some information. It is good practice to get the
information correct, but will not actually impact the performance of the
robot.
C1 NAME – This is the intended hostname of c1. Your DNS server needs
to resolve this to the IP address you intend to use for your robot.
C2 NAME – This is the intended hostname of c2. Your DNS server needs
to resolve this to the IP address you intend to use for your robot.
64 CHAPTER 4. PR2 COMPUTERS
VPN SUBNET – Unless you are using multiple robots, this should be
10.68.1.0. The 3rd field of the IP, however, can be any value other
than 0 and 255, which are reserved for the robot local network and the
basestation server respectively. No two robots on the same basestation
should be assigned the same VPN subnet.
To actually brand the robot, first plug the basestation into the service
port of the robot, and then use the robot-brand command
For example, if your robot were going to be named “prx”, c1 was going
to named “prx1”, c2 was going to be named “prx2”, and you wanted to use
the default 10.68.1.0 192.168.1.100, you would run:
During the branding process, it may prompt you for the password of
“root@c1”. By default this will be “willow”. Additionally, you may be
prompted to choose a password for the pr2admin account.
When the script finishes, you should be able to connect to the robot over
the VPN. Check that it works and then exit.
Select the drive listed as “USB-HDD0” and hit “Page Up” to make it
number 1
If the installer complains about not being able to find the ISO, choos
“Scan Hard Drive for ISO...” and then hit “Enter” to continue.
When the installer completes, hit “Enter” to shut down and remove
the USB stick.
When the basestation boots you should have a fresh image – consult
the section on Basestation Setup and Pairing to configure the bases-
tation.
If the installer complains about not being able to find the ISO, choose
“Scan Hard Drive for ISO...” and then hit “Enter” to continue.
When the installer completes, hit “Enter” to shut down and remove
the USB stick.
When the basestation boots you should have a fresh image – consult
the section on Basestation Setup and Pairing to configure the bases-
tation.
Alternatively, plug a keyboard into the PR2. This can be done using
the aux usb port under the back cover. To remove this cover, follow the
instructions in section XYZ.
When the robot is booting you will hear 2 beeps followed by a short
pause, and then another 2 beeps. After the 4th beep, hit f12 on the keyboard
(either physically or through the KVM) to force c1 to netboot.
Which will update all packages on your system, pulling in security fixes
for the pr2 configuration as well as for the appropriate ros-release.
– root - willow
– pr2admin - willow
– root - willow
– pr2admin - willow
– admin - admin
– guest - guest
C1 ESMS (10.68.0.91)
– root - changeme
C2 ESMS (10.68.0.92)
– root - changeme
– root - willow
– root - willow
Chapter 5
Now that there is adequate room around the crate, begin opening the
crate by unlatching the metal latches around the panel labeled OPEN
71
72 CHAPTER 5. SETTING UP PR2 IN YOUR LAB
THIS PANEL FIRST, Figure 5.2. Lift the latch up then rotate the latch
handle counter-clockwise until the hook is extended and no longer engaged.
Finally push the hook outwards to disengage the latch.
Unlatch the six latches on the front panel and set the panel aside for
use later. Inside the crate is a vaccuum sealed PR2, Figure 5.3, unlatch
and remove the two boards holding the head in place. After the boards are
removed, unlatch all of the latches aroung the bottom of the crate. Make
sure that all of the latch hooks are pushed down and out of the way.
Now the top of the crate is completely unlatched. Verify that the
two boards holding the head in place have been removed, and then
with two people grab opposite sides of the crate and slowly walk the crate
backwards off the crate base. Remove all of the plastic wrapping and tape
5.1. TAKING PR2 OUT OF THE CRATE 73
from around the foil vaccuum wrapping. Once the wrapping is removed cut
the foil wrapping about one foot up from the seam all the way around the
base of the robot, this will leave enough material for repacking the robot
if needed. Pull the foil wrapping off and remove the dessicant bags from
around the PR2, Figure 5.4.
Figure 5.4: Removing the foil wrapping, dessicant bags, and foam coverings.
Slide the foam coverings off of the arms and over the base laser, then
remove the bracing straps on each side of the head, Figure 5.5, using an
4mm allen wrench (this can be found in the robot toolkit). Place the straps
and screws in a bag for later use when repacking the PR2.
Figure 5.5: Removing the head straps and pushing back packaging.
Push back the foil wrapping and other materials to reveal the platform
in the base of the crate. In the crate base beneath the PR2 platform is
a support board that must be removed before unscrewing the bolts and
lowering the platform, Figure 5.6. Push the board from one side so that it
protudes out the other side and pull it free.
74 CHAPTER 5. SETTING UP PR2 IN YOUR LAB
Once the support board is free, use the drill to unscrew the bolts around
the crate base making sure that the two bolts in front of the robot come
completely out of the nuts. Unlatch the board in front of the PR2 base
and set it aside. With two people, take the panel labeled OPEN THIS
PANEL FIRST with the label face up, so that the boards act as rails on
the side of the panel, and lay the panel on the edge of the platform aligning
the pegs with the holes in the panel, as shown in Figure 5.7.
Figure 5.7: Using the OPEN THIS PANEL FIRST panel as a ramp.
With the ramp in place, walk to the back of the robot and switch on the
power switch as shown in Figure 5.8. Once the PR2 computers are booted
connect to the PR2 wifi (PRXXXXLAN) using your wifi manager. The
default password is ”willow”. After connecting to the wireless access point on
the robot you can ssh into the robot as pr2admin with the default password
of ”willow”. Once you are logged into the robot follow the directions outlined
5.1. TAKING PR2 OUT OF THE CRATE 75
Please keep all shipping materials, including the crate, in storage. They
are useful for moving the PR2 to another location, and will be required if
you ever have to ship the PR2 back to Willow Garage for service.
76 CHAPTER 5. SETTING UP PR2 IN YOUR LAB
Chapter 6
77
78 CHAPTER 6. RUNNING THE PR2
6.1.3 Run-stop
Before running the robot, you should also have the wireless run-stop nearby
(Figure 6.1), so that you can shut down the motors if you need to.
The PR2 has two run-stop buttons: the red push-button on the middle
of the PR2’s back, and the yellow wireless run-stop transmitter. If either one
is in the stop position, the motors are disabled so the robot cannot move. In
an emergency, press the stop button on the wireless transmitter,
or hit the push-button in the back. Putting either run-stop button in
the stop position does not damage the robot or turn off the computers, it
simply stops the motors.
The wireless run-stop is also powered by batteries, which can run down.
Therefore, it is a good idea anyway to turn the wireless run-stop off (by
pressing the ”STOP” button) when not in use. If the wireless run-stop runs
out of battery charge, then the battery light (the light next to the battery
symbol in the lower half of the wireless run-stop face) will flash. To change
the battery, you will need a slotted screwdriver to open the wireless run-stop
case (Figure 6.2).
Before using the PR2, you will also need an account on the robot comput-
ers. Ask the robot administrator to create an account for you, using the
instructions in section ??.
6.2. TURNING ON PR2 79
Figure 6.2: Opening the PR2 wireless run-stop to change the batteries.
You should see the red lights on the computers turn on, hear the fans
spin up, and hear several rising-tone beeps from the computers as they boot.
The process of booting the computers will take about 5 minutes. You will
know that the computers are on when you see a red light illuminate on each
of the computers in the robot base.
80 CHAPTER 6. RUNNING THE PR2
6.2.1 Logging in
Once the robot is on, ssh into the main computer using the account created
for you by the administrator, using the steps below.
In the following tutorial, we will use pr<x>1 to refer to the first computer
on robot <x> and <username> to refer to your account username. Ask your
robot administrator what name you should use for the robot you want to
run.
To log in to the robot, open a terminal window and type
$ ssh <username>@pr<x>1
You should already have access to all the ROS tools. For instance, to see
what packages are available to you, type
$ rospack list-names
and you should see a list of the ros packages currently in your path.
$ ckill list
This will show you what programs are currently running on the robot. If
nothing shows up, then no one else is logged into the robot. If other people
have processes running on the robot, you will need to find out if you can
interrupt their work. You should find out who is on the robot and ask them
to allow you to kill their processes so that you can work on the robot. If
you cannot find the people running processes on the robot, ask the robot
adminstrator for guidance on what the policy is in your lab. If it is fine for
you to kill the other processes running on the robot, you can type
and all the processes that are being run on the robot will be killed.
6.3. STARTING THE SOFTWARE 81
Running robot start will start the roslaunch for you in the background as
a system user. This will allow you to continue to use your current terminal
and the robot will keep running after you log out.
To see what topics are being published in ROS now, you can type
$ rostopic list
$ roslaunch /etc/ros/robot.launch
$ ssh <username>@pr<x>1
$ rostopic list
to see what topics are being published by the system in the new terminal
while the roslaunch continues to run in the original terminal. Remember
that <x> is a placeholding variable to be replaced with the ID of the robot
you are using.
Either way, the robot should be running, but since you have the wireless
run-stop in the stop position, the motors will not be moving.
$ export ROS_MASTER_URI=http://pr<x>1:11311
$ rosrun pr2_dashboard pr2_dashboard
You should see the pr2 dashboard control panel (a graphical user interface)
appear and provide you with information about the state of the robot. It is
ok if not all of the icons are green. In fact, the run-stops should be “warning”
you that the wireless runstop is not on.1
Take a moment to review the state of the robot. You can get a sense for
the health of your robot by looking at the diagnostics information; click on
the wrench on the far left. Since you have the run-stop in the stop position,
you see that the motors are giving you a warning because the robot was just
turned on and the encoders on the joints have not been calibrated yet.
If you see warnings or errors in any other sections, you should read the
error messages and try to figure out what the problem is. Ask your robot
administrator for help if there are errors that you do not understand.
1
If you do not see the pr2 dashboard control panel appear, then there is a chance that
you have not yet built the pr2 dashboard. To do this, type rosmake pr2 dashboard to
build pr2 dashboard. Once this is done, you can try launching the dashboard again.
6.4. RUNNING THE DASHBOARD 83
When running the PR2, the most important piece of software for you to un-
derstand and control the state of the system is the pr2 dashboard. pr2 dashboard,
Figure 6.4, is a GUI for debugging and controlling low-level state of the PR2.
The dashboard displays the diagnostic, circuit breaker, run-stop, and bat-
tery status. The robot will not usually start up with all green lights. In fact,
if you bring up the robot properly, then you should see a dashboard display
that looks more like Figure 6.4. This is because the wireless run-stop should
be in the stop position. You can tell that the wireless run-stop is in the stop
position by mousing over the dashboard to see the tooltips, which describe
what each icon means. See Figure 6.5.
Figure 6.5: The PR2 dashboard when starting up the robot, showing
tooltips.
Diagnostic Status The state of the robot is shown by the diagnostic in-
dicators in the pr2 dashboard.
84 CHAPTER 6. RUNNING THE PR2
Circuit Breaker Status The circuit breakers are labeled L/B/R, which
stand for Left Arm, Base/Spine, and Right Arm. Each breaker can be
in one of four states, and clicking on any of the breakers will pop up
a menu (Figure 6.6), allowing you to change the state of one or all of
them:
Run-stop Status The runstop indicators display the status of the PR2
runstops and their states cannot be changed using the dashboard.
There are two run-stops on the robot, a wireless run-stop, see 3.1.2,
and a red push button run-stop on the back of the robot.
Battery Status The battery will change its color and % filled based on the
6.5. CALIBRATING THE JOINTS 85
If you do not discover any problems in the diagnostics, and you want to
continue with robot bringup, first check the physical area around the robot
to ensure that the robot will not hit anything around it when it calibrates.
The robot’s arms will be fully extended and the spine will move up and
down during calibration. Once the physical area is cleared, press the green
“START” button on the wireless run-stop. This should change the state of
the run-stop indicator on the dashboard to a green circle, and will allow the
robot to turn power on for the motors.
If the robot circuit breakers are not yet enabled, the next step is to enable
the circuit breakers (marked L, B, R). When you click on the circuit-breaker
icon, select “enable all” from the menu to turn on all three breakers.
If the robot motors are not yet reset, then click on the picture of a motor,
and select “reset motors.”
When you have started the wireless run-stop, enabled all the robot circuit
breakers, and have reset thr boto motors, the robot will move its joints to
find the absolute reference positions of each joint so that it can calibrate the
mechanism. When calibration is finished, you should see all the icons in the
dashboard reading OK (Figure 6.7).
Figure 6.7: The PR2 dashboard when the wireless run-stop is in the start
position.
If this calibration step fails, then you can use the pr2 dashboard to diag-
nose the problems with the robot. See your robot administrator if you need
assistance in understanding and addressesing the issues.
86 CHAPTER 6. RUNNING THE PR2
Before driving a robot around, it is best to tuck the robot arms. If you do
not tuck the robot arms before driving, then the arms are likely to swing
around while the robot is moving.
To run the tuckarm package, type into the robot computer (pr<x>1):
This will tuck both robot arms. The feedback from tuckarm should display
something like this:
For more information about how to drive the robot around, see the
tuckarm instructions at ros.org.
To move the robot, you can now drive it around with the joystick. To do
this, you will need to open a new terminal window with a new ssh connection
to the robot and run the teleop joystick launch file
$ ssh <username>@pr<x>1
$ roslaunch pr2_teleop teleop_joystick.launch
Then to control the robot, use L1 (Figure 6.9) as the “deadman” switch.
L1 should be held down with your left pointer finger (like a trigger) whenever
you wish to control the robot. If you let go of the L1 button, then commands
will no longer be sent from the controller to the robot. While pressing L1,
use the other buttons for the following movements:
1. L1 (left pointer finger): The “dead man” switch allows the controller
to send commands to the robot. If the “dead man” is disabled, no
commands will work.
88 CHAPTER 6. RUNNING THE PR2
2. L2 (right pointer finger): The head switch allows the joysticks to con-
trol the head instead of the base
3. Right joystick (right thumb): Translates the base or head (i.e., front,
back, left, right)
4. Left joystick (left thumb): Rotates the base or head (i.e., spin clockwise
or counter-clockwise)
5. R1 (left pointer finger): The “run” switch commands the base to move
faster
6. Triangle and X (right thumb): Moves the torso up and down
To drive the robot around (i.e., driving the base), hold down L1 and use
the two joysticks to control its direction of movement (right joystick) and
rotation (left joystick). To drive the robot around at faster speeds, also hold
down R1.
To move the robot head, hold down L1 and use the two joysticks to
control the head movements.
To move the robot torso, hold down L1 and press the triangle button
to move the torso up or the X button to move the torso down. The torso
moves slowy.
For more information about how to drive the robot around, see the ps3joy
tutorial at ros.org.
$ ssh <username>@pr<x>1
$ sudo robot stop
This logs you into the robot and stops the robot processes.
As an alternative to simply stopping the proceeses running on the robot,
you can also turn off the robot computers. To do this, open a new terminal
and type:
$ ssh <username>@pr<x>1
$ sudo pr2-shutdown
If you turn off the robot, you will hear four sets of descending beeps
from the robot computers. Then the red lights on each of the computers
will turn off. If this does not happen, then the robot computers might not
be completely shut down properly.
Finally, to exit from the robot computer terminal, type
$ exit
If someone was waiting to use the robot after you, be sure to let them
know that you are done with the robot.
90 CHAPTER 6. RUNNING THE PR2
Chapter 7
The PR2 comes with the PR2 variant of the latest released distribution of
ROS installed from binary debian packages in /opt/ros . It is recommended
to use this installation where possible to save compile time and disk space.
91
92 CHAPTER 7. WRITING CODE ON PR2
ROS stack tutorials These tutorials cover the basic ROS concepts and
tools for writing and using ROS nodes.
tf tutorials These tutorials cover using the tf library for cooridinate tran-
sofrms using the python and C++ APIs.
navigation tutorials These tutorials cover configuring and using the nav-
igation stack on the PR2 and other robots.
laser pipeline tutorials These tutorials cover processing laser data and
converting laser data into 3D representations.
PR2-users This mailing list provides the latest PR2 news and is a forum
for posting questions to the PR2 community for help.
94 CHAPTER 7. WRITING CODE ON PR2
Chapter 8
Maintaining PR2
Instructions on using the pr2 admin user to install new version of stacks and
apps next to what is already on the system.
Instructions on how users set up their accounts to be either using the
latest code all the time or to be locked to a particular version. Discussion
of the advantages of each.
Sometimes, you may want to reset PR2 to factory defaults. This is the
process. This can either be done while preserving user data, or can be done
as a full factory reset.
Essentially, this is a full update to the last-installed disk image.
95
96 CHAPTER 8. MAINTAINING PR2
8.5.2 Support
For hardware issues, please submit a ticket at support.willowgarage.com
8.5. SOLVING HARDWARE PROBLEMS 97
8.5.3 Documentation
For more detailed documentation, see support.willowgarage.com. This in-
cludes drawings and step-by-step instructions for replacing all user-servicable
parts. After this list of chapters, we should have a set of other tutorials
which have been referenced from the text. Only tutorials that are on the
critical path should be in-lined in the text. Everything else should be refer-
enced and then collected at the end.