Planning For Manipulation With Adaptive Motion Primitives
Planning For Manipulation With Adaptive Motion Primitives
Planning For Manipulation With Adaptive Motion Primitives
sachinc@willowgarage.com
‡ Robotics Institute, Carnegie Mellon University, Pittsburgh, PA 15213
maxim@cs.cmu.edu
Claim 1 – An arbitrary orientation specified in RPY Now, we discuss the algorithm of the orientation solver.
coordinates (ψ, θ, φ) can be represented by two unit vectors Firstly, since the two inputs to the orientation solver are
v1 and v2 as shown in figure 4. v1 accounts for pitch θ the initial and final orientations of the end effector in RPY
and yaw φ, whereas v2 holds information about roll ψ. The coordinates, in the base frame B, it becomes necessary to
transformation is a straight-forward result and is given by convert these inputs from frame B to a frame F attached to
the following equations. This representation is analogous to the forearm, as indicated by the claim 2 above. The frame F
the axis-angle representation. is such that the x-axis is along the forearm, and the vector
v2F (see figure 5), which corresponds to forearm roll is along
v1 = (cos(θ) cos(φ), cos(θ) sin(φ), sin(θ)) the y-axis. This conversion can be implemented through two
v2a = (sin(φ), − cos(φ), 0) transformations. 1) Convert end effector RPY in the base
v2 = R v2a , where frame into the corresponding 2-vector representation in the
base frame. Let us say that these vectors are vi1B , vi2B , vf 1B
R is the rotation matrix about the axis v1 and can be
and vf 2B . Here, the subscript i stands for initial, f for final
obtained by applying the Rodriguez formula.
and B for base frame. 2) Given the rotation matrix RF B of
Claim 2 – The change in RPY coordinates of the end frame F relative to frame B, we convert these four vectors
effector due to an ordered 3-tuple of motions (forearm roll, into the corresponding ones vi1F , vi2F , vf 1F and vf 2F , in
frame F . The ordered 3-tuple of motions can now be found The reach of the end effector in RPY space is restricted
by manipulating these four vectors. by joint limits in forearm roll, wrist flex and wrist roll. In the
PR2, forearm and wrist roll are continuous but the wrist flex
has a finite limit of 126o on one side and 0o on the other.
Given these limits, there are exactly 2 solutions to the ordered
3-tuple, which differ only in forearm roll. More precisely,
forearm rolls in the two 3-tuples are of opposite direction;
their absolute values sum to 360o . In the example in figure
3, the two first sequences are (90o , 30o , 90o ) depicted in
the figure, and (−2700 , 300 , 90o ). Our orientation solver is
designed to check for both sequences, taking advantage of
Fig. 6: Explanatory sketch of the orientation solver. the fact that even if one sequence will cause a collision, the
other sequence may be viable.
Figure 6 illustrates the functionality of the orientation
solver. The forearm and the calculated 2-vectors for the end B. Cost Function
effector are shown in the reference frame F . Because our The cost function is designed to minimize the path length
desired motion is an ordered 3-tuple (forearm roll, wrist flex, while maximizing the distance between the manipulator and
wrist roll), the first motion that we need to calculate is the nearby obstacles along the path. Thus the cost of traversing
forearm roll (r1 ). Since in frame F , a forearm roll causes any transition between states s and s0 in graph G can be
the projection of a vector on the yz plane to rotate about represented as c(s, s0 ) = ccell (s0 ) + caction (s, s0 ). The action
the x-axis, the magnitude of the forearm roll motion from cost, caction , is the cost of the motion primitive which is
one orientation to another can be calculated as the angle generally determined by the user. The soft padding cost, ccell ,
between the projections of the vectors v1 corresponding to is a cost applied to cells close to obstacles to discourage
these orientations. In figure 6, these projections of vi1F and the search from planning a path that drives any part of the
vf 1F are denoted by lines L1 and L2 . The forearm roll is manipulator close to nearby obstacles.
then given as r1 = arccos(uL1 · uL2 ), where uL is a unit
vector along line L, and p · q is the dot product between C. Heuristic
vectors p and q. The purpose of a heuristic function is to improve the
Next, we need to evaluate wrist flex (r2 ). Let us denote efficiency of the search by guiding it in promising directions.
the rotation matrix corresponding to forearm roll as Rf r . The Heuristic-based search algorithms require that the heuris-
vectors vi1F and vi2F are transformed to vm1F = Rf r vi1F tic function is admissible and consistent. In the following
and vm2F = Rf r vi2F respectively, after the forearm roll. sections, we describe the two components of our heuristic
(These intermediate vectors are not shown in figure 6 to avoid function as well as our method for combining them to
cluttering the diagram.) The wrist flex is then evaluated as form a unified admissible heuristic. The first component
r2 = arccos(vm1F · vf 1F ). The rotation matrix Rwf , which hendef f has been presented previously [2], whereas the
corresponds to wrist flex, is about the axis along the vector second component helbow is novel.
vm1F Xvf 1F . This rotation transforms vm1F into vf 1F , and 1) hendef f : As the ability to plan robustly in cluttered
vm2F into vf 0 2F = Rwf vm2F . Thus, after executing the environments is the primary focus of our research, we need
rotations r1 and r2 , the yaw and the pitch of the end effector a heuristic function that efficiently circumvents obstacles. We
will be equal to the final desired values. However, the roll use a 3D Dijkstra’s search to compute the cost of the least-
will be different, in general. The wrist roll (r3 ) is evaluated cost path from the end effector position at a given state to
as r3 = arccos(vf 0 2F ·vf 2F ). The concise algorithm is stated the end effector position at the goal state. Exact details can
below. be found in [2].
hendef f proves to be an informative heuristic in directing
the graph search around obstacles in a cluttered workspace.
1) Compute vi1B , vi2B , vf 1B and vf 2B However, hendef f is computed under the assumption that the
2) Using RF B , compute vi1F , vi2F , vf 1F and vf 2F end effector is a point robot with radius rendef f , the radius
3) Compute uL1 and uL2 of the actual end effector. In doing so, we are treating the
4) r1 = arccos(uL1 · uL2 ) arm as an untethered point robot on a 26-connected grid,
5) Compute Rf r as rotation about (1, 0, 0) of angle r1 thus allowing for least-cost paths to be computed that may
6) Compute vm1F = Rf r vi1F and vm2F = Rf r vi2F be infeasible for an end effector limited by the kinematics
7) r2 = arccos(vm1F · vf 1F ) of the attached manipulator.
8) Compute Rwf as rotation about vm1F Xvf 1F of angle
Figure 7 displays one such scenario where the starting
r2
position of the end effector is below a narrow table and the
9) vf 0 2F = Rwf vm2F
goal pose is above the table. In the figure it can be seen
10) r3 = arccos(vf 0 2F · vf 2F )
that the least-cost path from the start configuration leads the
end effector around the tabletop to the goal. Considering
the length of the manipulator and its kinematics, such a
path is impossible for the end effector to follow. In such a
case, hendef f will misguide the search considerably. A more
effective search would require a combination of hendef f
and some additional kinematic information. The following
paragraph explains our method for alleviating this problem.
Fig. 9: Elbow locus for end effector goal position constraint (0.60,-
0.40,0.8).
D. Search
Any standard graph search algorithm can be used to
search the constructed graph G. Given the graph’s size,
however, optimal graph search algorithms such as A* [6] are
inapplicable. Instead, we employ an anytime version of A*
- Anytime Repairing A* (ARA*) [10].This algorithm gener-
ates an initial, possibly suboptimal solution quickly and then
concentrates on improving this solution while deliberation
time allows. The algorithm guarantees completeness for a
given graph G and provides a bound on the suboptimality
of the solution at any point in time during the search. ARA*
speeds up the typical A* search by inflating the heuristic Fig. 10: Shown here are five types of test environments used
in our experimental analysis. (1) tabletop manipulation (2) over-
values by a desired inflation factor, . An greater than 1.0 under tabletop (3) bookshelf (4) random obstacles (5) cluttered
will produce a solution guaranteed to cost no more than environment
times the cost of an optimal solution.
Part of our analysis entailed comparing the effectiveness
IV. EXPERIMENTAL RESULTS of using only the orientation solver-based motion primitives,
To test the capabilities of the motion planner we randomly using only inverse kinematics-based motion primitives and
generated a battery of tests representing different types of combining the two approaches (in addition to the static
realistic manipulation scenarios. We use the 7DOF arm of and multi-resolution motion primitives). Refer to Table I for
the PR2 robot as our test platform in these environments. detailed results. For these tests, we started the planner with an
All of the tests require the planner to plan to 6DOF end- = 100, setting a maximum planning time of two seconds.
effector pose constraints, with a 1cm tolerance around the The planning times reported in the table do not include
goal position constraint and an absolute tolerance of 0.05 the time to compute the heuristics, which was consistently
radians in the roll, pitch, and yaw angles of the end effector. between 0.65 and 0.75 seconds. From these results, we de-
In all of the experiments mentioned in this paper, the planner termined that adding inverse kinematics-based motion prim-
was given a maximum planning time of two seconds. itives is better than adding orientation solver-based motion
See figure 10, which shows the five different types of primitives in less cluttered environments, however, the failure
environments. The tabletop tests are intended to mimic rate of using only IK-based motion primitives increases as
manipulation scenarios. In these tests, the initial arm con- the environments become more cluttered. The orientation
figuration is randomly generated within a confined region solver-based motion primitives function better in cluttered
below the right shoulder of the robot. All of the end-effector environments because they generate smaller motions that
goal poses are within 16cm of the tabletop, and require roll minimize the risk of collision.
and pitch angles of zero but differ in the yaw constraint. Furthermore, we analysed the effect of switching from
During the experiments, we varied both the height of the the set of coarse 4DOF motion primitives to fine 7DOF
table and the distance of the robot to the edge of the table. motion primitives at different distances from the final goal.
The over-under table tests require that the manipulator go Table II shows the effect of this switching distance, d, on
from above the table to below and vice versa. The bookshelf the assorted tests. We concluded that although switching
tests require that the end effector start on either side of farther away from the goal is more costly, it provides a
the bookshelf or on a different shelf than the goal pose. stronger guarantee on completeness. The higher failure rate
The obstacle tests were created by randomly placing cubic for a greater switching distance is due to the inability of the
obstacles in the workspace of the arm and then randomly planner to finish planning in a timely manner.
generating start configurations and goals. The final set of Finally, we concluded our analysis by comparing our
tests, the cluttered environments, proved to be some of the methods to a sampling-based planner. A cluttered environ-
most difficult, because of the minimal lateral clearance for ment was randomly chosen for testing, and we compared the
the elbow. We could not generate a sufficient set of valid paths returned by multiple calls to a sampling-based planner
cluttered environments to include a table of statistics. From against those returned by ours. Table III shows comparisons
all of the environments we generated, we chose the most based on the distance metric, which is the ratio of the path
Random Obstacle Tests (128 trials)
seconds to 1st sol. space constraints. The search is facilitated by a combination
solver cost expan. f inal failures of two heuristics that aid in coping with obstacles in the
avg std max
OS 33288 4164 10.69 0.114 0.290 1.840 3(2.3%) environment. While the algorithm was tested on the PR2, it
IK 21126 2026 4.50 0.042 0.153 1.490 1(0.8%)
Both 20945 2016 4.30 0.042 0.156 1.550 0
is general enough to apply to other robots with kinematically
Tabletop Manipulation Tests (18 trials) similar arm structures. Our experimental analysis shows
seconds to 1st sol. that the use of adaptive motion primitives in search-based
solver cost expan. f inal failures
avg std max planning for manipulation can lead to very efficient planning.
OS 71000 4798 16.62 0.168 0.218 0.820 2(11.1%)
IK 57875 3548 11.50 0.303 0.553 2.020 2(11.1%) In particular, these adaptive motion primitives significantly
Both 67333 3463 13.78 0.306 0.495 1.850 0 improve search performance, while maintaining the same
Table Over-Under Tests(38 trials) theoretical guarantees as our planner that used static motion
seconds to 1st sol.
solver cost expan. f inal
avg std max
failures primitives.
OS 72194 4419 14.94 0.334 0.362 1.900 1(2.6%)
IK 52731 3493 10.61 0.307 0.431 2.000 12(31.6%) VI. ACKNOWLEDGEMENTS
Both 62368 3408 10.26 0.267 0.207 0.750 0 We thank Willow Garage for their partial support of this
Bookshelf Tests(8 trials)
seconds to 1st sol.
work. In addition, this research was partially sponsored
solver cost expan. f inal failures by the Army Research Laboratory Cooperative Agreement
avg std max
OS 75250 4965 16.00 0.086 0.050 0.200 1(2.6%) Number W911NF-10-2-0016.
IK 41143 3486 6.86 0.039 0.012 0.060 12(31.6%)
Both 42750 3619 7.50 0.059 0.031 0.110 0 R EFERENCES
TABLE I: Summary of experimental results. [1] R. Bohlin and L. Kavraki. Path planning using lazy prm. In IEEE
International Conference on Robotics and Automation, VOL.1, 2007.
[2] B. Cohen, S. Chitta, and M. Likhachev. Search-based planning for
manipulation with motion primitives. In Proceedings of the IEEE
length to the Euclidean distance from the start position of the International Conference on Robotics and Automation (ICRA), 2010.
[3] A. Kanehiro et al. Whole body locomotion planning of humanoid
end effector to the goal pose. While our search-based planner robots based on a 3d grid map. In Proceedings of the IEEE
is deterministic and always gives the same score, the scores International Conference on Robotics and Automation (ICRA), 2005.
of the sampling-based planner vary drastically. We believe [4] E. Frazzoli and S. Karaman. Incremental sampling-based algorithms
for optimal motion planning. Int. Journal of Robotics Research, 2010.
that such variability can be counter-productive in situations [5] D. Furcy. Chapter 5 of Speeding Up the Convergence of Online
where repeatability is a requirement. Heuristic Search and Scaling Up Offline Heuristic Search. PhD thesis,
Georgia Institute of Technology, 2004.
Assorted tests (80 trials) [6] P. E. Hart, N. J. Nilsson, and B. Raphael. A formal basis for the
d cost expan. f inal failures heuristic determination of minimum cost paths. IEEE Transactions on
20cm 68016 2760 14.19 18(22.5%) Systems, Science, and Cybernetics, SSC-4(2):100–107, 1968.
40cm 89128 2865 17.83 33(41.2%) [7] L. Kavraki, P. Svestka, J.-C. Latombe, and M. H. Overmars. Proba-
bilistic roadmaps for path planning in high-dimensional configuration
TABLE II: The effect of changing distance d, the threshold for spaces. IEEE Transactions on Robotics and Automation, 12(4):566–
switching between M PlowD and M PhighD , on the efficacy of the 580, 1996.
[8] J.J. Kuffner and S.M. LaValle. RRT-connect: An efficient approach to
planner.
single-query path planning. In Proceedings of the IEEE International
Conference on Robotics and Automation (ICRA), pages 995–1001,
2000.
[9] M. Likhachev and D. Ferguson. Planning long dynamically-feasible
Cluttered test (search-based planner score: 4.46) maneuvers for autonomous vehicles. International Journal of Robotics
avg std max min Research (IJRR), 2009.
6.43 3.29 13.23 1.65 [10] M. Likhachev, G. Gordon, and S. Thrun. ARA*: Anytime A* with
provable bounds on sub-optimality. In Advances in Neural Information
TABLE III: Showing variability of paths returned by sampling Processing Systems (NIPS) 16. Cambridge, MA: MIT Press, 2003.
based planners, based on the distance metric. The test used was a [11] J. Pearl. Heuristics: Intelligent Search Strategies for Computer
randomly chosen highly cluttered environment. Problem Solving. Addison-Wesley, 1984.
[12] Nathan Ratliff, Matt Zucker, J. Andrew Bagnell, and Siddhartha
Srinivasa. Chomp: Gradient optimization techniques for efficient
motion planning. In IEEE International Conference on Robotics and
V. CONCLUSION Automation, 2009.
[13] R. Zhou and E. A. Hansen. Multiple sequence alignment using A*.
In this paper we have presented a search-based motion In Proceedings of the National Conference on Artificial Intelligence
planning algorithm for manipulation that is capable of (AAAI), 2002. Student abstract.
planning efficiently for manipulators with many degrees of [14] R. Zhou and E. A. Hansen. Beam-stack search: Integrating backtrack-
ing with beam search. In Proceedings of the International Conference
freedom. In our approach, we introduced adaptive motion on Automated Planning and Scheduling (ICAPS), pages 90–98, 2005.
primitives that plan efficiently and precisely using both pre-
defined multi-dimensional actions and primitives that are
generated on the fly by analytical solvers. The algorithm
relies on an anytime graph search to generate solutions
quickly, as well as provide theoretical guarantees on the
completeness, consistency and provides a bounds on the sub-
optimality of the solution cost, under state space and action