You are required to be on two mailing lists before you can work on the pr2:
You also need to watch the pr2 safety video before working on it. We recommend to read the pr2 manual.
You can get your account from the administrators Alexis, Georg, Gheorghe. You will get full sudo permissions on the robot. Be careful with it. If you do not know all possible effects of an action, ask one of the administrators before. Installation of new software packages with `aptitude` or `apt-get` is not a problem. Messing around in configuration files or doing something like `sudo make install` is not allowed. Please be always aware that the robot may be reinstalled and your home directory gets deleted during this process. Never keep any important data on the robot. Always copy important data to your local machine.
Consistent time-stamping of data exchanged between the user's computer and the robot's computer is crucial for interpreting this data, on both computers. Keeping the the user's computer time synced with the robot's computer time requires some attention. The tool employed to take care of this synchronization is chrony http://chrony.tuxfamily.org. The general strategy is to have the two computers (user's computer and robot's computer) tightly coupled to one another, but loosely coupled to an external time source. This will prevent the robot time and the user time from drifting too far one from the other. In our case the external time source will be the robot's base station. The robot's computer time should be always synced to the base station time. chony's job is to synchronize the user's computer time to the base station time.
I order to employ chrony to keep synced your computer time with the base station computer time, make sure:
1. you have chrony installed
sudo apt-get install chrony
2. you updated your chrony configuration file:
/etc/chrony/chrony.conf
allowing chrony to check if whether another chronyd client is already running (to be newly added to your chrony.conf file):
pidfile /var/run/chrony-internal.pid
and telling chrony client which is the chrony server to whom to sync (to replace the old servers in your chrony.conf):
server pr2a minpoll 3 maxpoll 15 maxdelay .010 initstepslew 0 pr2a 0.debian.pool.ntp.org 1.debian.pool.ntp.org 2.debian.pool.ntp.org 3.debian.pool.ntp.org
3. restarting chrony client (running on user's computer)
sudo /etc/init.d/chrony restart
4. check your installation / configuration
Start chrony:
chronyc
Ask chrony the synchronization sources:
sources
You should get something similar with:
210 Number of sources = 1 MS Name/IP address Stratum Poll LastRx Last sample ============================================================================ ^* pr2a.ai.loc 3 5 0 -24us[ -31us] +/- 33ms
The asterisk * appearing in front of the source confirms your computer time is synced to the pr2base.
Exit chrony:
exit
Now you should be fine.
A second test would be:
ntpdate -q pr2a
with an expected value smaller than 0.0001 milisecond.
Sometimes the clocks on the computers get into an inconsistent state. This will show up as an error in the pr2dashboard as: “NTP offset from XXX to YYY; Offset too great.” If the clocks are in an inconsistent state, try restarting chrony on your computer. If this still doesn't solve the problem you may ask one of the PR2 admins to restart chrony on the basestation, c1, and c2, in this order.
For additional details you may have a look how the synchronization problem between PR2's C1 and C2 is solved with the base station help http://pr2support.willowgarage.com/wiki/PR2%20Manual/Chapter13#Clock_Synchronization.
Get familiar with ROS by working through the following tutorials on your local machine before getting started on the robot:
To work on the robot, your computer must be either connected to the lab network. The robot's computers in the network are named pr2a and pr2b.
export ROS_IP=<the-ip-of-your-machine> export ROS_MASTER_URI=http://pr2a:11311
to run some ros nodes locally. To start your stuff, ssh into the robot with
ssh <your-name>@pr2a
You will see a message if the robot is free or claimed right now. If it is claimed, go and find the person who claimed it and ask if he/she still needs it. Never kill someone else's processes without asking. If the robot is not claimed, first find the wireless runstop. It should be close around the robot.
Now claim the robot:
robot claim
Make sure that the runstop is off before you start up the robot with:
roslaunch /etc/ros/indigo/robot.launch
The robot should come up now. To check, set the ROS_MASTER_URI on your local machine to http://pr2a:11311 and launch the rqt_pr2_dashboard with
rosrun rqt_pr2_dashboard rqt_pr2_dashboard
You should see only green fields. It is important that you run the dashboard whenever you are working on the robot.
It might be a good idea to first start the core manually before running the robot and to run all your commands in a screen or terminator session. Now release the runstop. The robot might calibrate. Be sure that it will not hit anything while calibrating. While moving the robot, always make sure that the wireless runstop is in reach. If you need to leave the robot for a short amount of time, make sure that you always press the runstop and make sure that the pr2's power cable is plugged in. First plug in the power cable into the PR2's inlet, then into the wall outlet. This is important because the power cable and the pr2 power inlet might get damaged otherwise. When you are done on the robot, move it to its docking station and plug in the network cable and the power cable. Press the red button on the runstop. Now release the robot with:
robot release
No food or drink in the PR2 workspace, in particular anywhere the PR2 might make contact with. Keep the joystick plugged into the USB hub nearby the robot charging station when not in use. Obey standard PR2 safety protocol, including: No sharp objects in the PR2’s grasp. No liquids near the PR2, regardless of how sturdy you think the container is. No objects may be placed on top of the PR2. Be wary of small objects (e.g. screws). If you suspect anything has fallen in the PR2, cut the power with the breakers and contact Alexis immediately.
# ssh -XAC pr2a
# /etc/ros/kinect2_bridge_remote.sh
This script sets the environment and launches the kinect2_bridge node on the Backpack PC.
robot claim
robot release
sudo shutdown -h now
sudo shutdown -h now