Hierarchical Planning for PR2
This summer, Jason Wolfe (UC Berkeley) worked on hierarchical task planning for the PR2. Planning is important for performing tasks efficiently. If you're gathering ingredients for the Triple Chocolate Volcanic Explosion Soufflé you're fiendishly craving, you may fetch both the eggs and the butter from the fridge before heading to the pantry for the sugar and chocolate. If you weren't planning ahead, you might go get the eggs, drop them off on the counter, go back to the fridge to get the butter, unload again, continue to the pantry for the chocolate, and so on. You'll still make a soufflé, but your plan will be far from optimal.
Jason's work on hierarchical planning helped the PR2 plan out its tasks in a more logical, premeditated manner. The package takes into consideration high-level decisions, like the order in which to fetch the ingredients, down to low-level decisions like where to position the base of the robot and what angle to grasp an object from. In the video, the PR2 is told to move several bottles between two tables. Instead of manipulating each bottle independently of the others, the robot plans ahead and places the bottle being manipulated near the next bottle to grab. That way, the robot can simply put down the current item and, without driving to the next goal, reach over and pick up its next bottle. Jason's code can be found in the hierarchical_planning package. You may also be interested in Jason's and Bhaskara Marthi's RSS 2009 presentation on Angelic Hierarchical Planning.
In the process of working on this package, Jason spent time developing and debugging lower-level component actions, such as moving the base to a particular location. Interactive scripting languages are ideal for this purpose. Jason developed an experimental Java client library for ROS (rosjava), which he then used to create a ROS interface to Clojure (rosclj), a Lisp-like language built on Java. Using this interface, he then developed a large library of scripted actions which can be used for quickly specifying and tele-operating complex sequences. These can be found in the clj_pr2 package.