ROS On The PR2: Steve Cousins
ROS On The PR2: Steve Cousins
ROS On The PR2: Steve Cousins
T O P I C S
n the last issue of IEEE Robotics & Automation Magazine, we talked about a number of different robots running the robot operating system (ROS). In this issue, we are going to focus on one in particular, the PR2. Willow Garage announced in May the 11 institutions that will get to use a PR2 for free for two years through its PR2 Beta Program (Figure 1). The PR2s all run ROS, and the institutions have all committed to making significant open-source contributions back to the ROS community. ROS has been gaining traction at an astonishing rate since its release in January, but having 11 PR2s at top institutions will accelerate that progress even further. We will give a brief overview of what the PR2 Beta Program recipients are planning to do, and then dive into a concrete example of the use of ROS on the PR2. The PR2 robot is a mobile-manipulation platform designed to make robotic software development easy. ROS was designed with the needs of a mobile-manipulation platform in mind, and early versions of ROS were tested and refined using the PR2. The 11 international PR2 Beta Program sites include one in Japan, three in Europe, and seven in the United States. The PR2 Beta Program institutions and their proposal titles are: u Stanford University, USA: STAIR on PR2 u University of California, Berkeley, USA: PR2 Beta Program: A Platform for Personal Robotics u Massachusetts Institute of Technology (MIT), USA: Mobile Manipulation in Human-Centered Environments u Georgia Institute of Technology (GA Tech), USA: Assistive Mobile Manipulation for Older Adults at Home u University of Southern California (USC), USA: Persistent and Persuasive Personal Robots (P3R): Towards Networked, Mobile, Assistive Robotics u University of Pennsylvania, USA: PR2GRASP: From Perception and Reasoning to Grasping u Albert-Ludwigs-Universitt Freiburg, Germany: a TidyUpRobot u Bosch, USA: Developing the Personal Robotics Market: Enabling New Applications Through Novel Sensors and Shared Autonomy u Technische Universitt Mnchen (TUM), Germany: a u CRAM: Cognitive Robot Abstract Machine u Katholieke Universiteit Leuven, Belgium: Unified Framework for Task Specification, Control and Coordination for Mobile Manipulation u University of Tokyo (JSK), Japan: Autonomous Motion Planning for Daily Tasks in Human Environments Using Collaborating Robots.
Figure 1. The 11 PR2 robots that Willow Garage graduated to institutions around the world that promised to make significant contributions to ROS.
The PR2 robot is designed to do human-scale tasks in environments where people are present. A number of the institutions (Freiburg, GATech, MIT, Stanford, TUM, Berkeley, and JSK) will teach the robot to do tasks around the home, such as clearing or setting a table, emptying a dishwasher, preparing meals, doing laundry, and generally assisting people in everyday home tasks. Stanford and Berkeley will also work on business tasks like taking inventory, and doing assembly and manufacturing. Bosch will make their PR2 available for remote access by scientists at other institutions, and Leuven will make a number of excellent open source tools for robotics available on the PR2. We expect that the PR2 Beta Program will result in significant advances in robotics science. Teams plan to extend capabilities that are already in ROS on navigation and mapping, object recognition, grasping and manipulation, sensor self-calibration, planning, and people-aware navigation. A couple of the teams will study how dynamic objects work, e.g., how different kinds of doors open or how to interact with common objects like lamps. A number of groups will develop new machine learning algorithms, try them on the PR2, and make the implementations available in ROS. And finally, many of the institutions will study humanrobot interaction.
IEEE Robotics & Automation Magazine
23
SEPTEMBER 2010
The PR2 robot is designed to do human-scale tasks in environments where people are present.
A key criterion for the selection was promised open-source contributions back to ROS, and we expect that the robotics community will benefit greatly from the work of these groups over the next two years. The groups will leverage the core capabilities that have already been put into ROS. In the next section, we will explore one particularly powerful such capability, the transform library (TF).
outlet and register its coordinates in the frame of the robots base, and then move that arm to a position where it can grasp a plug and robustly insert the plug into the outlet. It also means that making the robots parts move in harmony is a trivial programming task. The code sample below is a simple ROS Python program for pointing the PR2s head at a point in space. Lines 14 just set up the programs environment by bringing in the relevant modules. Line 6 creates a new ROS node called move_the_head. Lines 810 use ActionLib to create a simple controller that will aim the head at a goal. (ActionLib will be the subject of a future column and is already the subject of a number of tutorials on ros.org.) 1 import rospy 2 from actionlib import SimpleActionClient 3 from pr2_controllers_msgs.msg import PointHeadAction, PointHeadGoal 4 from geometry_msgs.msg import Point 5 6 rospy.init_node(move_the_head) 7 8 client = SimpleActionClient( 9 /head_traj_controller/point_head_ action, PointHeadAction) 10 client.wait_for_server() 11 12 g = PointHeadGoal() 13 g.target.header.frame_id = base_link 14 g.target.point = Point(1.0, 0.0, 1.0) 15 g.min_duration = rospy.Duration(1) 16 17 client.send_goal(g) 18 client.wait_for_result() For purposes of this article, the interesting lines are 1215, and especially line 13. Line 12 creates a PointHeadGoal that can be passed to the head controller (client). How do we express that goal? We express it with respect to a frame. In line 13, the frame_id is set to base_link, which is welldefined on the PR2, the base of the robot. So far, this example is a bit boring. Line 14 sets the goal to (1.0, 0.0, 1.0) relative to the base of the robot, and if we run the example, the robot would stare off at a point in space. By adjusting the (x,y,z) of the goal, we could make the head stare at a different point in space. What is really cool is that TF allows us to automatically reason about lots of other interesting points that the robot implicitly knows about. Instead of using base_link, we could ask the robot to point the head at (0.0, 0.0, 0.0) of r_gripper_r_ finger_tip_link (the right grippers right finger tip) and without any more thought we run the program and the robot looks at its right hand. Furthermore, it is a trivial adaptation to the program to add a loop so that the head follows the hand where ever it moves. And that simple 20-line program will make the head follow the hand, no matter whether the hand is being commanded to move by another program or moved by a person touching the robot. Similarly, by using a map frame, the
SEPTEMBER 2010
same program can make the robot continually look at a point in a room as other programs (or a joystick) drive the robot around. TF is magic, in the tradition of the best magicians. The magician seems to exert little effort, and yet amazing things happen. We went through the whole example without even mentioning Quaternions! Although there are a few more details to understand, the bottom line is that libraries like TF raise the level of robotics programming in ROS so that programmers can think about higher level issues and leave lowlevel details like transformations to the operating system.
Final Notes
ROS has come a long way since its 1.0 Box Turtle release in January. By the time you read this, the C Turtle release should be out. Installation of ROS on Debian variants of Linux has gotten easy as well: Box Turtle and C Turtle both have associated Debian install files, so basic ROS installation can now be performed with the apt-get command. Along with the releases, there are an enormous number of tutorials to help you get started with ROS. Just go to http:// ros.org to get started.
N E W S A N D
V I E W S
and Automation (ICRA) Industrial Forum in Anchorage, companies do not buy robots alone; they only buy them when they become an integral, often subsidiary, part of a problem solution. MobileRobots Inc., known for its autonomous mobile robot bases and motivity robot operating system, has converged with Adept Technology Inc., known for its high-speed, human-sized robotic arms. The new company, Adept MobileRobots, will specialize in emerging technologies for automation, which may combine mobility, perception, and manipulation. Innovation and Entrepreneurship in Robotics Award finalist Kuka is expanding promotion and testing of its
LWR lightweight, compliant, human-sized research arm atop a mobile base designed by students from Georgia Tech. Jeanne Dietsch is the vice president of Emerging Technologies at Adept. As cofounder of MobileRobots Inc., she led development of the motivity autonomous robot operating system and other foundation technologies used by automated guided vehicle and service robot manufacturers. She blogs for IEEE Spectrum and serves on the Industrial Activities Board (IAB) of IEEEs Robotics & Automation Society, as well as on editorial boards of various robotics journals. She helped in founding the Robotics Technology Consortium.
C O M P E T I T I O N S
(continued from page 22)
The annual International Botball Tournament will be held at the 2010 Global Conference on Educational Robotics, in Edwardsville, Illinois, 711 July. Botball is targeted at middle and high school students and is designed to develop students science, engineering, technology, mathematics, and writing skills. More information on Botball is available at http:// botball.org.
SEPTEMBER 2010
Finally, the AAAI Robotics Programs will be held during AAAI 2010, in Atlanta, Georgia, 1115 July. This year sees a number of events, including the learning by demonstration challenge, the small-scale manipulation challenge (robotic chess), the robotics education track, the semantic robot vision challenge, a workshop on enabling intelligence through middleware, and an open exhibition.
IEEE Robotics & Automation Magazine
25