Professional Documents
Culture Documents
I. I NTRODUCTION
In this paper we consider the task of planning smooth
trajectories for robot motion. This is one of the fundamental
tasks of robotics, and has received a great deal of attention
over the past several decades. One strategy that has proven (c)
particularly effective for this task is the use of smooth,
parametrized splines to describe trajectories, either in joint-
space or task-space. Cubic splines in particular are ubiquitous
in robotic applications [1], as they provide a simple means
Fig. 1. Simple planning task used to demonstrate the potential advantage
of generating smooth (twice differentiable) trajectories for of cubic spline optimization. See text for details.
robot motion.
Cubic splines for robot trajectories are typically employed involve a slow search process, and still typically do not take
as follows. First, one uses a high-level planning algorithm to into account the final cubic spline form of the trajectory.
generate a series of kinematically feasibly waypoints that the The basic insight of the method we present in this paper
robot should pass through on its way to the goal. Next, one is that if we initially parametrize the trajectory as a cubic
fits the parameters of a cubic spline that passes through all spline, then in many cases we can accomplish both the
these points; the smoothness of the resulting cubic spline planning and trajectory fitting simultaneously. That is, we can
leads to a smoother motion of the robot than would be directly optimize the location of the cubic spline waypoints
obtained, for example, by a linear spline that just interpolated while obeying many of the same constraints (or approxi-
between the waypoints. We refer to this as the “two-phase” mations thereof) required by a typical planning algorithm.
approach, since the planning and spline fitting are done in Specifically, in this paper we show how to plan smooth
separate phases. task-space trajectories — that is, trajectories where we care
However, despite their advantages, cubic splines also suf- primarily about the position of the robot’s end effector —
fer from a number of drawbacks. The chief problem is that while maintaining kinematic feasibility, avoiding collision,
in the typical two-phase application of cubic splines, the and limiting velocities or accelerations, all via a convex
high-level waypoint planning is done separate from the cubic optimization problem. Convex optimization problems are
spline fitting procedure, which can lead to poor trajectories. beneficial in that they allow for efficiently finding global
To convey this intuition, consider the simple planning task optimums [4] — this allows us to solve the planning tasks in
shown in Figure 1 (a): the objective is to move a double a few milliseconds using off-the-shelf software, suitable for
pendulum, actuated at both joints, from the start to the goal, real-time re-planning and control. This approach is illustrated
while avoiding the obstacle. Figure 1 (b) shows a possible in Figure 1 (c). Because the waypoints and cubic spline
output from a typical planner (for example, a randomized and optimized simultaneously, the resulting trajectories are
tree planner [2]) and the corresponding cubic spline fit typically much smoother than those obtained by the two-
to these waypoints. Due to the stochastic nature of the phase approach.
planner, the waypoints do not lead to a particularly nice final We implement this proposed algorithm on a quadruped,
trajectory. Existing trajectory optimization techniques [3] can the “Little Dog” robot, to demonstrate its usefulness; indeed,
help mitigate this problem to some degree, but they usually the task of planning foot and body trajectories for this
robot originally motivated our approach. The cubic spline ultimately only use the 0, . . . T − 1 parameters, as described
optimization approach that we present in this paper is a above). Given the x matrix, we can find the parameters of
crucial element of our complete system on this robot, and the cubic splines using the following set of linear equations
as we demonstrate, the method substantially improves the
a = x (6)
quality of trajectories.
The remainder of this paper is organized as follows. In H1 b = H2 x (7)
Section II we review the standard means of fitting cubic c = H3 x + H4 b (8)
splines to a set of waypoints. Section III contains the chief d = H5 x + H6 b (9)
algorithmic contribution of the paper: here we present our
method for optimizing cubic spline trajectories using convex where the Hi ∈ R(T +1)×(T +1) matrices depend only (non-
programming. In Section IV we discuss the application of linearly) on the times t0 , . . . , tT . We present the complete
this algorithm to a quadruped robot, and present empirical definition of these matrices, as well as a derivation of the
evaluations. Finally, in Section V we discuss related work, equations, in Appendix A. However, the important point to
and conclude the paper in Section VI. gleam from this presentation is that the the parameters of the
cubic splines are linear in the desired locations x.
II. C UBIC S PLINES
III. C UBIC S PLINE O PTIMIZATION
Here we review the standard methods for fitting cubic
splines to a series of waypoints output by a planner. We In this section we present our primarly algorithmic con-
suppose that we have access to a high-level planner that plans tribution: a method for optimizing task-space cubic spline
a feasible path from a start location to a goal location. This trajectories using convex programming. As before, we as-
path is represented as a series of T + 1 desired time-location sume that we are given an initial plan, now denoted
pairs: (t0 , x̂0 ), (t1 , x̂1 ), . . . , (tT , x̂T ). (10)
(t0 , x⋆0 ), (t1 , x⋆1 ), . . . , (tT , x⋆T ) (1)
However, unlike the previous section, we will not require that
where x⋆i ∈ Rn denotes the desired location of the robot at our final cubic trajectory pass through these points. Indeed,
time ti ∈ R, specified in task space. most of the real planning is performed by the optimization
Given these waypoints, there is a unique piecewise-cubic problem itself, and the initial plan is required only for some
trajectory that passes through the points and satisfies certain of the approximate constraints that we will discuss shortly;
smoothness criteria. Specifically, we model the trajectory an initial “plan” could simply be a straight line from the start
between times ti and ti+1 , denoted xi (t) : R → Rn , as location to the goal location.
a cubic function The task of optimizing the location of the waypoints while
xi (t) = ai + bi (t − ti ) + ci (t − ti )2 + di (t − ti )3 (2) obeying certain constraints can be written formally as
0.05
0.04
0.03
0.02
z (m)
0.01
0
Terrain
−0.01 Desired Trajectory
−0.02
Trajectory Waypoints
−0.03
−0.04
0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18
xy (m)
0.6
0.5
x (m)
0.4
0.3
−0.06
y (m)
−0.08
−0.1
Fig. 10. Terrains used for evaluating the system. The top terrain is fairly
−0.12
trivial to navigate, while the bottom terrain is significantly more challenging.
0 0.1 0.2 0.3 0.4 0.5 0.6
0.1
0.05
0
0 0.1 0.2 0.3 0.4 0.5 0.6
using 1) fraction of successful runs, 2) speed over terrain,
Time (s)
3) average number of “recoveries”5 , and 4) average tracking
Fig. 8. Typical example of a foot trajectory generated by the algorithm.
The top figure shows the resulting trajectory in 3D space, while the bottom error (i.e., distance between the planned and actual location)
shows each component as a function of time. for the moving foot. Perhaps the most obvious benefit of
the cubic spline optimization method is that the resulting
0
speeds are faster; this is not particularly surprising, since
Desired Trajectory
Trajectory Waypoints
the splines output by our planner will clearly be more
−0.02
Support Triangle efficient than a simple box pattern over obstacles. However,
−0.04 equally important is that the cubic spline optimization also
leads to more robust behavior, especially on the challenging
y (m)
−0.06
terrain: the previous method only succeeds in crossing the
−0.08 terrain 70% of the time, and even when it does succeed
it typically needs to execute several recoveries, whereas
−0.1
0.05
This is seen in Table I from the fact that the cubic spline
0
0 0.2 0.4 0.6 0.8 1 1.2 1.4
optimization approach has lower tracker error, implying more
0
accurate placement of feet, and therefore greater robustness
y (m)
−0.02
−0.04
is challenging environments.
−0.06
0 0.2 0.4 0.6 0.8 1 1.2 1.4 Finally, we want to briefly mention issues of running
0.04
0.03
time. We solve the convex optimization problems using
z (m)
0.02
0.01
MOSEK, a general purpose convex solver, available at
0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 http://www.mosek.com. Using this software, solving
Time (s)
for a foot spline takes an average of 4.4 milliseconds (with
Fig. 9. Typical example of a COG trajectory generated by the algorithm.
1.1 millisecond standard deviation), while solving for the
COG path takes an average of 5.4 ms (0.4 ms standard
by our algorithm, we are ultimately interested in whether
deviation). These quantities remain approximately the same
or not the method actually improves performance on the
regardless of the terrain, and are fast enough to allow for
LittleDog. To evaluate this, we tested the system on two
real-time re-planning and control on the quadruped.
terrains of varying difficulty, shown in Figure 10. We com-
pare the cubic spline optimization approach to the trajectory V. D ISCUSSION AND R ELATED W ORK
planning method described in [8], which uses simple box-
As mentioned in the introduction, cubic splines are very
shapes to step over terrain, and linear splines for moving the
common in robotic applications [1]. This paper, as well as
COG. While, as mentioned previously, the entire system for
[5], [6], [7] discuss methods for approximately optimizing
planning and control of the quadruped is quite complex, all
the time of the trajectory, but do not consider optimizing
other elements of the system remain fixed in the experiments
the waypoints themselves. The work of Schlemmer et al.
here.
Table I shows the performance of the quadruped both 5 A recovery is required whenever the COG falls outside the supporting
with and without the cubic spline optimization. We ran 10 triangle. Again, see [8] for details.
Easy Terrain Challenging Terrain
Metric Spline Optimization Previous Method Spline Optimization Previous Method
% Successful Trials 100% 100% 100% 70 %
Speed (cm/sec) 7.02 ± 0.10 5.99 ± 0.07 6.30 ± 0.12 5.59 ± 0.31
Avg. Tracking Error (cm) 1.28 ± 0.03 1.40 ± 0.06 1.27 ± 0.05 1.55 ± 0.09
Avg. # Recoveries 0.0 0.0 0.5 ± 0.37 2.22 ± 1.45
TABLE I
P ERFORMANCE OF CUBIC SPLINE OPTIMIZATION ON THE TWO QUADRUPED TERRAINS . T ERMS INCLUDE 95% CONFIDENCE INTERVALS .
[9] perhaps bears the most resemblance to our own, as they R EFERENCES
do consider the modification the cubic spline parameters [1] C.-S. Lin, P.-R. Chang, and J. Luh, “Formulation and optimization
themselves. However, the resulting techniques are quite of cubic polynomial joint trajectories for industrial robots,” IEEE
different, since they break the trajectories into multiple Transactions on Automatic Control, vol. 28, no. 12, pp. 1066–1074,
1983.
segments with constant acceleration, not the continuous [2] S. M. LaValle, Planning Algorithms. Cambridge University Press,
acceleration profiles that we consider here; furthermore, they 2006.
focus on splines in joint space, whereas the most interesting [3] J. Betts, “Survery of numerical methods for trajectory optimization,”
Journal of Guidance, Control, and Dynamics, vol. 21, no. 2, pp. 193–
constraints (namely the kinematic feasibility and collision 207, 1998.
constraints) in our setting are precisely those that arise due [4] S. Boyd and L. Vandenberghe, Convex Optimization. Cambridge
to the task-space planning. University Press, 2004.
[5] B. Cao, G. Dodds, and G. Irwin, “Constrained time-efficient smooth
Free-knot splines [10], [11], typically used in the statistics cubic spline trajectory generation for industrial robots,” in Proceedings
literature, also relate to our method, as they involve choosing of the IEE Conference on Control Theory and Applications, 1997.
both the waypoints and times of parametric splines, including [6] J.-H. Park, H.-S. Kim, and Y.-K. Choi, “Trajectory optimization and
control for robot manipulator using evolution strategy and fuzzy logic,”
cubic splines. However, these methods typically focus on in Proceedings of the IEEE International Conference on Systems, Man,
fitting splines to data, not creating splines that relate to and Cybernetics, 1997.
any kind of trajectory planning, so the actual optimization [7] A. I. F. Vaz and E. M. Fernandes, “Tools for robotic trajectory plan-
ning using cubic splines and semi-infinite programming,” in Recent
approaches are very different. Advances in Optimization, A. Seeger, Ed. Springer, 2006, pp. 399–
Our method also relates to the trajectory optimization 413.
literature in robotics [12], [13], [14], [15], though these meth- [8] J. Z. Kolter, M. P. Rodgers, and A. Y. Ng, “A control architecture for
quadruped locomotion over rough terrain,” in Proceedings of the IEEE
ods typically focus on improving a pre-supplied (feasible) International Conference on Robotics and Automation, 2008.
trajectory via gradient or higher-order methods. Although in [9] M. Schlemmer, R. Finsterwalder, and G. Grubel, “Dynamic trajectory
this paper we focus on cases where the initial “plan” supplied optimization in real time for moving obstacles avoidance by a ten
degrees of freedom manipulator,” in International Conference on
to the cubic spline optimization problem is very simple and Intelligent Robots and Systems, 1995.
possibly infeasible, there is nothing that prevents the method [10] C. de Boor, A Practical Guide to Splines. Springer-Verlag, 1978.
from being used to optimize a feasible trajectory generated [11] D. Jupp, “Approximations to data by splines with free knots,” SIAM
Journal of Numerical Analysis, vol. 15, pp. 328–343, 1978.
by a planner, as in the approaches above: in this setting the [12] D. W. Miles and S. M. Rock, “Real-time dynamic trajectory optimiza-
algorithm could also function as a trajectory optimization tion,” in Proceedings of the AIAA Guidance, Navigation and Control
approach, specifically using a cubic spline parametrization Conference, 1996.
[13] S. Fleury, P. Soueres, J. Laumound, and R. Chatila, “Primitives for
of the trajectory, and using general convex optimization smoother mobile robot trajectories,” IEEE Transactions on Robotics
techniques rather than gradient methods alone. and Automation, vol. 11, no. 3, pp. 441–448, 1995.
Planning trajectories for the quadrupeds robot in particular [14] F. Lamiraux, D. Bonnafous, and O. Lefebvre, “Reactive path de-
formation for non-holonomic mobile robots,” IEEE Transactions on
has been considered in [8], [16], [17]. Although a full com- Robotics, vol. 20, no. 6, pp. 967–977, 2004.
parison between the different approaches is beyond the scope [15] S. Lee, J. Park, F. M. Kim, and J. Bobrow, “Newtow-type algorithms
of this paper, we did compare to our previous controller, [8] for dynamics-based robot movement optimization,” IEEE Transactions
and demonstrated that cubic spline optimization improves on Robotics, vol. 21, no. 4, pp. 657–667, 2005.
[16] D. Pongas, M. Mistry, and S. Schaal, “A robust quadruped walking gait
performance. The work by Mistry et al, [18] also considers for traversing rough terrain,” in Proceedings of the IEEE International
a quadruped and specifically looks at the trade-off between Conference on Robotics and Automation, 2007.
balance and kinematic feasibility, but this work is generally [17] J. R. Rebula, P. D. Neuhaus, B. V. Bonnlander, M. J. Johnson, and
J. E. Pratt, “A controller for the littledog quadruped walking on rough
orthogonal to our own, as it primarily considers control terrain,” in Proceedings of the IEEE International Conference on
strategies for achieving a given trajectory. Robotics and Automation, 2007.
[18] M. Mistry, J. Nakanishi, and S. Schaal, “Take space control with
VI. C ONCLUSION prioritization for balance and locomotion,” in Proceedings of the IEEE
International Conference on Robotics and Automation, 2007.
In this paper we presented a cubic spline optimization [19] R. H. Bartels, J. C. Beatty, and B. A. Barsky, An Introduction to Splines
method, for planning smooth trajectories for robot motion. for Use in Computer Graphics and Geometric Modelling. Morgan
The algorithm uses convex optimization methods to effi- Kaufmann, 1989.
ciently plan task-space trajectories, while obeying several A PPENDIX
constraints, such as kinematic feasibility and avoiding con-
tact. We apply this method to the task of planning trajectories A. Derivation of the Cubic Spline Equations
for a quadruped robot, and demonstrate significant improve- In this section we derive the standard equations for cubic
ment over past work. splines, presented in Section II. In particular, we show that
−2 −1
0 ··· 0 0
given desired locations and final and initial velocities of ∆t0 ∆t0
−2 −1
the spline, we can solve for the cubic spline parameters 0 ∆t1 ∆t1 ··· 0 0
−2
using the linear equations (6)–(9). We reiterate that this is a 0 0 ∆t2 ··· 0 0
H4 = (38)
standard derivation, but we include it for completeness and .. .. .. .. .. ..
. . . . . .
to solidify our notation. The derivation follows that in [19],
−2 −1
0 0 0 ··· ∆tT −1 ∆tT −1
but generalizes it to the case of arbitrary times for the spline
points. 0 0 0 ··· 0 0
Recall that the trajectory from time ti to ti+1 is given by 2 −2
0 ··· 0 0
∆t30 ∆t30
the cubic function 2 −2
0 ∆t31 ∆t31
··· 0 0
2 3
xi (t) = ai + bi (t − ti ) + ci (t − ti ) + di (t − ti ) (30)
0 0 2
··· 0 0
∆t2
H5 = .. .. .. .. .. ..
(39)
In order to achieve a smoother, continuous trajectory, we
.
. . . . .
impose four conditions on the spline: 1) at ti it must have 2 −2
0 0 0 ···
the value x⋆i , 2) at ti+1 it must have the value x⋆i+1 , 3) its ∆tT −1 ∆tT −1
derivative (velocity) must be continuous at ti+1 , and 4) its 0 0 0 ··· 0 0
second derivative (acceleration) must be continuous at ti+1 . 1 1
0 ··· 0 0
∆t20 ∆t20
These four conditions can be written formally as 0 1 1
··· 0 0
∆t21 ∆t21
xi (ti ) = x⋆i 0 0 1
··· 0 0
∆t22
xi (ti+1 ) = x⋆i+1 H6 =
.. .. .. .. .. ..
.
(40)
. . . . . .
ẋi (ti+1 ) = ẋi+1 (ti+1 )
0 0 0 ··· 1 1
∆t2T −1 ∆t2T −1
ẍi (ti+1 ) = ẍi+1 (ti+1 ).
0 0 0 ··· 0 0
Using the cubic function definition (30), these conditions can Finally, substituting (35) and (36) into (34) we obtain
be rewritten in terms of the cubic spline parameters:
2bi + 4bi+1 4bi+1 + 2bi+2
ai = x⋆i (31) + =
∆ti ∆ti+1
ai + bi ∆ti + ci ∆t2i
+ di ∆t3i = x⋆i+1 (32) (41)
6(x⋆i+1 − x⋆i ) 6(x⋆i+2 − x⋆i+1 )
+ .
bi + 2ci ∆ti + 3di ∆t2i = bi+1 (33) ∆t2i ∆t2i+1
2ci + 6di ∆ti = 2ci+1 (34) These equations, along with the additional constraints that
where can be expressed as the second set of linear equalities (7):
∆ti ≡ ti+1 − ti . H1 b = H2 x
Now we use simple variable elimination to get find explicit where
equations for the cubic spline parameters. Specifically, equa- 0 0 0 0
··· 0 0 0
tion (31) immediately leads to the first linear equation (6)
α0 β0 α1 0 ··· 0 0 0
a = x. 0 α1 β1 α2 ··· 0 0 0
0 0 α2 β2 ··· 0 0 0
Next, we use equations (32) and (33), to solve for ci and di H1 =
(42)
in terms of the xi ’s and bi ’s, giving: .. .. .. .. ..
.
.. .. ..
. . . . . . .
3(x⋆i+1 − x⋆i ) − (2bi + bi+1 )∆ti 0 0 0 0 · · · βT −3 αT −2 0
ci = (35) 0 0 0 0 · · · αT −2 βT −2 αT −1
∆t2i
0 0 0 0 ··· 0 0 0
2(x⋆i − x⋆i+1 ) + (bi + bi+1 )∆ti
di = . (36) 2 4 4
∆t3i αi ≡ , βi ≡ +
∆ti ∆ti ∆ti+1
This leads immediately to the third and fourth linear equa-
tions (8) and (9) and
0 0 0 0 ··· 0 0 0
c = H3 x + H4 b
−γ0 η0 γ1 0 ··· 0 0 0
d = H5 x + H6 b 0 −γ1 η1 γ2
··· 0 0 0
0 0 −γ2 η2 ··· 0 0 0
where
−3 3 H2 =
.. .. .. .. .. .. .. (43)
..
0 ··· 0 0
∆t20 ∆t20 . . . . . . . .
−3 3
0 ∆t21 ∆t21
··· 0 0
0
0 0 0 · · · ηT −3 γT −2 0
−3 0 0 0 0 · · · −γT −2 ηT −2 γT −1
0 0 ∆t22
··· 0 0
H3 =
.. .. .. .. .. ..
(37) 0 0 0 0 ··· 0 0 0
. . . . . . 6 6 6
3 γi ≡ , ηi ≡ − .
−3
0 0 0 ··· ∆t2T −1 ∆t2T −1 ∆t2i ∆t2i+1 ∆t2i
0 0 0 ··· 0 0