St ephane CARON, Yoshihiko NAKAMURA, Quang-Cuong PHAMSt ephane CARON, Yoshihiko NAKAMURA,...

4
Kinodynamic Motion Retiming for Humanoid Robots St´ ephane CARON, Yoshihiko NAKAMURA, Quang-Cuong PHAM Department of Mechano-Informatics, University of Tokyo, Japan 1. Introduction In this paper, we advocate the use of Time- Optimal Path Parameterization (TOPP) to enable planning of dynamic motions for humanoid robots. Consider a robot with n degrees of freedom. The Time-Optimal Path Parameterization (TOPP) prob- lem is to find a time parameterization s(t) : [0,T ] [0,T ref ] of a reference path q(s) : [0,T ref ] R n such that the retimed duration T is minimal. The opti- mization is constrained by physical limitations of the robot, e.g., joint, velocity and torque limits. Addi- tional constraints for balance or frictional contact can also be incorporated, as we will see. A first solution to the TOPP problem based on the maximum velocity curve (MVC) was introduced as early as 1985 in seminal papers by Bobrow et al. [1] and Shin et al. [9]. Since then, it has been succes- sively refined over the years to improve computation efficiency [10], deal with new kinds of constraints [7] or handle properly so-called “dynamic singularities” [8, 5]. This approach leads to fast computations, but dynamic singularities need to be treated with special care to avoid numerical instabilities. More recently, convex optimization has been ex- plored as an alternative to the MVC solution [12, 11, 2]. This approach allows for more general objective functions than the total duration T , e.g., jerk or en- ergy consumption. It is also said to be less sensi- tive to dynamic singularities, although the problem remains (see e.g., Figure 4 in [12]). However, com- putation times with this approach are significantly slower than with the MVC approach (e.g., [6] reported computation times one order of magnitude slower on n-dimensional point-mass problems). TOPP has been applied to humanoid trajectory planning using convex optimization in [11] and [3]. In [11], the authors take into account balance and sliding constraints, but not the actuation redundancy that arises in double support configurations. In [3], the author deals with both actuator limits and frictional contacts, using a polytope projection algorithm for the latter case. Throughout the paper, ˙ q and ¨ q denote the derivatives of q with respect to the reparameterized time t, while q s and q ss denote the derivatives with respect to the path variable s. Both are linked by the chain-rule ˙ q sq s and ¨ q sq s s 2 q ss . As a conse- quence, constraints expressed as functions of (q, ˙ q, ¨ q) can be written equivalently as functions of the path derivatives (s, ˙ s, ¨ s). For the humanoid, we are inter- ested in three types of constraints: ZMP balance: if we denote by x ZMP ,y ZMP the floor coordinates of the ZMP and p := ( x ZMP y ZMP 1) t , the condition that the ZMP lies inside the support polygon can be written as D(s) p(s, ˙ s, ¨ s) 0, (1) where D(s) is the matrix of the support polygon. Frictional contact: for a ground reaction force f i exerted at a given contact point C i , the lin- earized condition of frictional contact is +1 +1 -μ +1 -1 -μ -1 +1 -μ -1 -1 -μ 0 0 -1 f i (s, ˙ s, ¨ s) 0, (2) Actuated torques: given the stacked vector f of reaction forces at all contact points and the corresponding stacked matrix J C of all contact jacobians, the equations of motions for the under- actuated humanoid are τ = S M(q)¨ q + ˙ q t C(q) ˙ q + g - J T C f (3) with M(q) the inertia matrix, C(q) the Cori- olis tensor and g(q) the gravity vector. Given that q, ˙ q, ¨ q and f can be expressed as func- tions of (s, ˙ s, ¨ s), the bounded torques condition |τ |≤ τ max can be written as τ (s, ˙ s, ˙ s) - τ max 0 (4) τ max - τ (s, ˙ s, ¨ s) 0 (5) All three types of constraints boil down to a relation f (s, ˙ s, ¨ s) 0. We will show how each of them can be further factorized in: ¨ sa(s)+˙ s 2 b(s)+ c(s) 0. (6) The MVC algorithm was developped to solve prob- lems in this form. As such, with the ability to compute vectors (a(s), b(s), c(s)) at each index s [0,T ref ] of the reference trajectory, we will be able to retime our humanoid motions with TOPP. 2. Balance constraints Although it does not guarantee balance, the con- dition that the Zero-Moment Point (ZMP) lies inside the convex hull of ground contact points is physically consistent with the robot not tilting. In [7], the au- thors derived the TOPP form (6) of this constraint for rectangular support areas. We will now provide a similar derivation for any convex polygonal area. For each link i of the robot, let us denote by r i the position of its center of mass in the laboratory

Transcript of St ephane CARON, Yoshihiko NAKAMURA, Quang-Cuong PHAMSt ephane CARON, Yoshihiko NAKAMURA,...

Page 1: St ephane CARON, Yoshihiko NAKAMURA, Quang-Cuong PHAMSt ephane CARON, Yoshihiko NAKAMURA, Quang-Cuong PHAM Department of Mechano-Informatics, University of Tokyo, Japan 1. Introduction

Kinodynamic Motion Retiming for Humanoid Robots

Stephane CARON, Yoshihiko NAKAMURA, Quang-Cuong PHAMDepartment of Mechano-Informatics, University of Tokyo, Japan

1. Introduction

In this paper, we advocate the use of Time-Optimal Path Parameterization (TOPP) to enableplanning of dynamic motions for humanoid robots.

Consider a robot with n degrees of freedom. TheTime-Optimal Path Parameterization (TOPP) prob-lem is to find a time parameterization s(t) : [0, T ] →[0, Tref] of a reference path q(s) : [0, Tref] → Rn suchthat the retimed duration T is minimal. The opti-mization is constrained by physical limitations of therobot, e.g., joint, velocity and torque limits. Addi-tional constraints for balance or frictional contact canalso be incorporated, as we will see.

A first solution to the TOPP problem based onthe maximum velocity curve (MVC) was introducedas early as 1985 in seminal papers by Bobrow et al.[1] and Shin et al. [9]. Since then, it has been succes-sively refined over the years to improve computationefficiency [10], deal with new kinds of constraints [7]or handle properly so-called “dynamic singularities”[8, 5]. This approach leads to fast computations, butdynamic singularities need to be treated with specialcare to avoid numerical instabilities.

More recently, convex optimization has been ex-plored as an alternative to the MVC solution [12, 11,2]. This approach allows for more general objectivefunctions than the total duration T , e.g., jerk or en-ergy consumption. It is also said to be less sensi-tive to dynamic singularities, although the problemremains (see e.g., Figure 4 in [12]). However, com-putation times with this approach are significantlyslower than with the MVC approach (e.g., [6] reportedcomputation times one order of magnitude slower onn-dimensional point-mass problems).

TOPP has been applied to humanoid trajectoryplanning using convex optimization in [11] and [3]. In[11], the authors take into account balance and slidingconstraints, but not the actuation redundancy thatarises in double support configurations. In [3], theauthor deals with both actuator limits and frictionalcontacts, using a polytope projection algorithm forthe latter case.

Throughout the paper, q and q denote thederivatives of q with respect to the reparameterizedtime t, while qs and qss denote the derivatives withrespect to the path variable s. Both are linked by thechain-rule q = sqs and q = sqs + s2qss. As a conse-quence, constraints expressed as functions of (q, q, q)can be written equivalently as functions of the pathderivatives (s, s, s). For the humanoid, we are inter-ested in three types of constraints:

• ZMP balance: if we denote by xZMP, yZMP

the floor coordinates of the ZMP andp := ( xZMP yZMP 1 )

t, the condition that the

ZMP lies inside the support polygon can bewritten as

D(s)p(s, s, s) ≤ 0, (1)

where D(s) is the matrix of the support polygon.• Frictional contact: for a ground reaction force

fi exerted at a given contact point Ci, the lin-earized condition of frictional contact is

+1 +1 −µ+1 −1 −µ−1 +1 −µ−1 −1 −µ0 0 −1

fi(s, s, s) ≤ 0, (2)

• Actuated torques: given the stacked vector fof reaction forces at all contact points and thecorresponding stacked matrix JC of all contactjacobians, the equations of motions for the under-actuated humanoid are

τ = S[M(q)q + qtC(q)q + g − JT

Cf]

(3)

with M(q) the inertia matrix, C(q) the Cori-olis tensor and g(q) the gravity vector. Giventhat q, q, q and f can be expressed as func-tions of (s, s, s), the bounded torques condition|τ | ≤ τmax can be written as

τ(s, s, s)− τmax ≤ 0 (4)

τmax − τ(s, s, s) ≤ 0 (5)

All three types of constraints boil down to a relationf(s, s, s) ≤ 0. We will show how each of them can befurther factorized in:

sa(s) + s2b(s) + c(s) ≤ 0. (6)

The MVC algorithm was developped to solve prob-lems in this form. As such, with the ability tocompute vectors (a(s),b(s), c(s)) at each index s ∈[0, Tref] of the reference trajectory, we will be able toretime our humanoid motions with TOPP.

2. Balance constraintsAlthough it does not guarantee balance, the con-

dition that the Zero-Moment Point (ZMP) lies insidethe convex hull of ground contact points is physicallyconsistent with the robot not tilting. In [7], the au-thors derived the TOPP form (6) of this constraintfor rectangular support areas. We will now provide asimilar derivation for any convex polygonal area.

For each link i of the robot, let us denote by ri

the position of its center of mass in the laboratory

Page 2: St ephane CARON, Yoshihiko NAKAMURA, Quang-Cuong PHAMSt ephane CARON, Yoshihiko NAKAMURA, Quang-Cuong PHAM Department of Mechano-Informatics, University of Tokyo, Japan 1. Introduction

reference frame. We write h the resultant of contactforces applied to the ground:

h :=∑i

mi(g − ri) (7)

and τ the moment of h around the origin of the fixedworld frame:

τ =∑i

(mir

i × (g − ri)− Li). (8)

In this expression, Li denotes the angular momentumat the center of link i. It is given by

Li = Ri(Iiωi + ωi × (Iiωi))

with Ri (resp. Ii) the rotation (resp. inertia) matrixassociated with link i, and ωi its angular velocity. Inthis work, we assumed that this angular momentumcould be neglected, which was verified empirically inour experiments. We will thus omit it from now on.

The floor coordinates of the ZMP are given by:(xZMP

yZMP

)=

1

( 0 0 1 )h

(1 0 00 1 0

)τ (9)

The condition that (xZMP, yZMP) belongs to the convexhull of the ground contact points can be expressedas the intersection of a set of half-planes, resulting inEquation (1). Let us focus on one line of this equation:

αyZMP + βxZMP + γ ≤ 0. (10)

Introducing uαβ := ( −α β 0 ) anduγ := ( 0 0 − γ), multiplying (10) by− ( 0 0 1 )h yields

0 ≥ uαβ · τ + uγ · h

Expanding h and τ , the constraint becomes:

0 ≥∑i

mi(uαβ · ri × (g − ri) + uγ · (g − ri))

≥∑i

mi(g − ri) · (uαβ × ri + uγ)

Given the jacobian Ji := dri

dq and hessian Hi := d2ri

dq2

of each link’s COM, one can write:

ri = Jiq = Jiqss

ri = Jiq + qtHiq = Jiqss+ s2(Jiqss + qstHiqs)

Using these expressions, (10) can finally be put inform (6) with:

aZMP(s) = −∑i

miJiqs(uαβ × ri + uγ),

bZMP(s) = −∑i

mi(Jiqss + qT

sHiqs) · (uαβ × ri + uγ),

cZMP(s) = g · (uαβ ×G +Muγ),

with G the COM of the robot and M its total mass.

3. Frictional ContactAs humanoid robots are not fixed to the ground,

six additional degrees of freedom (DOF) are needed toaccount for the position and orientation of their mo-bile referential. These DOFs are not actuated: theirmovement results from interactions with the environ-ment. We model these interations as a set of contactforces fi applied at corresponding contact points Ci(i = 1, . . . , k). Each foot in contact with the grounddefines four contact points, one per corner of its rect-angular contact surface. We denote by JiC = dRi

dq the

contact jacobian at Ci. (Note that it only depends onq.) The equations of motion are then given by Equa-tion (3). Projecting on the last six coordinates of thisequation gives:

P(M(q)q + qtC(q)q + g) = PJtf (11)

with P the corresponding 6× n projector. Using thepseudo-inverse (PJt)†, we can express a least-squaresolution f0 to (11):

f0 = (PJt)†P · (M(q)q + qtC(q)q + g) (12)

τ = E(q)M(q)q + E(q)qtC(q)q + E(q)g (13)

where E(q) := S(In − (PJt)†P

)is an actuated

torques projection matrix. With this last expression,we can express torque constraints τ ≤ τmax as

alstsq(s) = E(q)M(q)qs,

blstsq(s) = E(q)[M(q)qss + qs

tC(q)qs],

clstsq(s) = E(q)g(q)− τmax.

However, there are also frictional constraints on thecontact forces fi given by Equation (2) or, equiva-lently, T · f ≤ 0. One could e.g., use an off-the-shelfQuadratic Programming (QP) solver to take into ac-count these inequality constraints when solving for fat Equation (11). However, this approach would yieldan actuated torques projector E(q, q, q) with a non-linear dependency on q and q.

The rationale of our approach is to compute so-lutions to the QP problem with inequality constraintsonly for specific values of s, and use a linear modelto describe how f deviates from this solution whens < 1 or s > 1. All solutions to Equation (11) can bewritten:

f(q, q, q) = f0(q, q, q) + Q(q)z (14)

where the expression of a particular solutionf0(q, q, q) is given by Equation (12), and

Q(q) = (I − (PJTC)†PJT

C) is the projector onthe nullspace of the solution space. We can use thevector z ∈ R3k to enforce the additional constraintTf ≤ 0.

Using the chain-rule q = sqs and q = sqs +s2qss in Equation (12), we can write the variation off0 between the retimed state (q, q, q) and the initial

Page 3: St ephane CARON, Yoshihiko NAKAMURA, Quang-Cuong PHAMSt ephane CARON, Yoshihiko NAKAMURA, Quang-Cuong PHAM Department of Mechano-Informatics, University of Tokyo, Japan 1. Introduction

00

5

10

15

20s

5.9 11.8 s17.6 23.5 29.4 35.3 41.2 47.0 53

1

Fig.1 Retimed trajectory profiles in the (s, s) space. Maximum Velocity Curves are depicted by dotted cyanand magenta lines. The dashed blue line represents the initial trajectory (s = 1) while the red curvecorresponds to the retimed trajectory. It may follow but never crosses the MVCs. Shaded grey areas showthe intervals where we disabled retiming, forcing the retimed profile to go follow s = 1. Blue and greendots indicate discontinuity of the MVC and singular points, respectively.

trajectory state (q,qs,qss) as follows:

f0(q, q, q) = s2f0(q,qs,qss) + (1− s2)g + sm,

g := (PJTC)†Pg(q),

m := (PJTC)†PM(q)qs.

We verify that f0(q, q, q) = f0(q,qs,qss) when s = 1,which corresponds to the initial trajectory. Equation(14) becomes

f(q, q, q) = s2[f0(q,qs,qss) + Q(q)z0

]+ (1− s2)

[g + Q(q)z1

]+ s

[m + Q(q)z2

]Under this formulation, solutions to the general prob-lem “find (z0, z1, z2) s.t. Tf(q, q, q) ≤ 0” still dependon both s and s, but we make the approximation ofchoosing zi’s that only depend on q. First, taking(s2, s) = (1, 0), consider the following QP:

minz0‖z0‖

s.t. T(f0(q,qs,qss) + Q(q)z0

)≤ 0

This QP has a solution if and only if the input tra-jectory is feasible. To make the explanation eas-ier, let us suppose for now that all QPs have fea-sible solutions. Using a solution z0, we derive z1

at, e.g., (s2, s) = (2, 0):

minz1‖z1‖

s.t. T(u1 − Q(q)z1

)≤ 0

Where u1 := 2f0(q,qs,qss) − g + Q(q)z0. Similarlyfor z2 at, e.g., (s2, s) = (1, 1):

minz2 ‖z2‖s.t. T

(v0 + Q(q)z2

)≤ 0

Where v0 := f0 + m + Q(q)z0. Once z0, z1 and z2

are computed, the contact constraint (2) becomes (6)with

afriction(s) = T (m + Q(q)z2)

bfriction(s) = T (f0 − g + Q(q)(z0 − z1))

cfriction(s) = T (g + Q(q)z1)

Actuated torque limits are finally obtained from f us-ing Equation (3), which gives

atorque(s) = St(M(q)qs − m− Q(q)z2

)btorque(s) = St

(Mqss + qs

tC(q)qs)

+ St(g − f0 − Q(q)(z0 − z1)

)ctorque(s) = St

(g − g − Q(q)z1

)The previous method assumes that all QPs had

feasible solutions, which allowed us to use points(s2, s) ∈ {(1, 0), (2, 0), (1, 1)} where computations areconvenient. In the general case, the same methodcan be applied but the space (s2, s) needs to besearched for three feasible solutions. This search wasstraightforward in our experiments: random samplingin (0, s2

max)× [0, smax] retuend feasible solutions aftera few steps.

4. Experiment with HRP-4

In this experiment, we show how a slow andquasi-static motion can be accelerated by our solu-tion while still maintaining ZMP balance, frictionalcontact and actuated torque limits.

The reference trajectory is a 53-second quasi-static motion. It starts by moving the COM to theleft foot, then steps the right foot 15 cm forward,moves the COM to the right foot, steps the left foot15 cm forward, and finally moves the COM to the cen-ter of the support area. These high-level instructionsare translated into key-frames using inverse kinemat-ics. Trajectory chunks are then interpolated betweenthose key-frames using B-spline curves with a fixedduration Tref = 5.9 s. Foot contacts are maintainedin the interpolated trajectories using the method of[4] for closure of kinematic chains. Figure 2 shows atimelapse of the input motion.

We used the TOPP solver [6] to retime this tra-jectory. We defined the support area for the ZMP con-straints as a disc centered on the COM with radius 1cm, resulting in conservative balance. The friction co-efficient was set to 0.8 while the normal component ofcontact forces was enforced to a minimum 10 N (bychanging the right-hand side of Equation (2)). Ac-tuated torque limits were set to 50% of the robot’s

Page 4: St ephane CARON, Yoshihiko NAKAMURA, Quang-Cuong PHAMSt ephane CARON, Yoshihiko NAKAMURA, Quang-Cuong PHAM Department of Mechano-Informatics, University of Tokyo, Japan 1. Introduction

Fig.2 Timelapse of the original trajectory. The interval between two frames is 3.5 s (total duration: 53 s).

Fig.3 Timelapse of the retimed trajectory. The interval between two frames is 3.5 s (total duration: 24 s).

limits. Figure 3 shows a timelapse of the retimed mo-tion after application of TOPP. The duration of theretimed trajectory is 24 s, i.e., 2× faster than its in-put.

We ran simulations with more aggressive valuesof the parameters in OpenHRP using full actuatedtorque limits and a 5 cm radius around the COM forthe ZMP. Figure 1 shows the retimed trajectory pro-file and MVCs thus obtained. The most constrainedpart of the problem occurs when the COM gets closeto the limits of the support area, which saturates thecontact constraints. The duration of the retimed tra-jectory in simulation is 12.3 s, more than 4× fasterthan its input.

Note that, for now, we do not retime the com-plete trajectory as a whole because of the discontinu-ities in (a(s),b(s), c(s)) that happen when switchingbetween single and double support. Rather, we setsmall time intervals around these transitions duringwhich retiming was disabled (grey areas in Figure 1).The duration of these intervals was set to 1.5 s on thereal robot and 0.2 s in the OpenHRP experiment.

5. Conclusion

In the present paper, we advocated the use ofTime-Optimal Path Parameterization to enable plan-ning of dynamic motions for humanoid robots. Weextended the existing formulation of ZMP constraintsto arbitrary polygonal areas and provided an originalapproach to incorporate frictional contact constraintsin TOPP. We evaluated our solution experimentallyon the HRP-4 platform.

References

[1] James E Bobrow, Steven Dubowsky, and JS Gibson. Time-optimal control of robotic manipulators along specified paths.The International Journal of Robotics Research, 4(3):3–17,1985.

[2] Kris Hauser. Fast interpolation and time-optimization on im-plicit contact submanifolds. In Robotics: Science and Sys-tems. Citeseer, 2013.

[3] Kris Hauser. Fast dynamic optimization of robot paths underactuator limits and frictional contact. In Robotics and Au-tomation (ICRA), 2014 IEEE International Conference on.IEEE, 2014.

[4] Yoshihiko Nakamura and Katsu Yamane. Dynamics computa-tion of structure-varying kinematic chains and its applicationto human figures. Robotics and Automation, IEEE Transac-tions on, 16(2):124–134, 2000.

[5] Quang-Cuong Pham. Characterizing and addressing dynamicsingularities in the time-optimal path parameterization al-gorithm. In Intelligent Robots and Systems (IROS), 2013IEEE/RSJ International Conference on. IEEE, 2013.

[6] Quang-Cuong Pham. A general, fast, and robust implemen-tation of the time-optimal path parameterization algorithm.arXiv preprint arXiv:1312.6533, 2013.

[7] Quang-Cuong Pham and Yoshihiko Nakamura. Time-optimalpath parameterization for critically dynamic motions of hu-manoid robots. In IEEE-RAS International Conference onHumanoid Robots, 2012.

[8] Zvi Shiller and Lu Hsueh-Hen. Computation of path con-strained time optimal motions with dynamic singularities.Journal of dynamic systems, measurement, and control,114(1):34–40, 1992.

[9] Kang G Shin and Neil D McKay. Minimum-time control ofrobotic manipulators with geometric path constraints. Auto-matic Control, IEEE Transactions on, 30(6):531–541, 1985.

[10] J-JE Slotine and Hyun S Yang. Improving the efficiency oftime-optimal path-following algorithms. Robotics and Au-tomation, IEEE Transactions on, 5(1):118–124, 1989.

[11] Wael Suleiman, Fumio Kanehiro, Eiichi Yoshida, J-P Lau-mond, and Andre Monin. Time parameterization of humanoid-robot paths. Robotics, IEEE Transactions on, 26(3):458–468,2010.

[12] Diederik Verscheure, Bram Demeulenaere, Jan Swevers, JorisDe Schutter, and Moritz Diehl. Time-optimal path tracking forrobots: A convex optimization approach. Automatic Control,IEEE Transactions on, 54(10):2318–2327, 2009.