Keywords

These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

1 Introduction

When actors portray characters on stage they use much more than only their voice and words to convey the feelings of their alter ego. It is an interplay of verbal and non-verbal expression that creates the impression of lively personalities instead of blank inanimate robots. But also when removing voice and facial expressions our perception is still able to read the emotional state.

Already Darwin [2] asked whether facial and bodily expressions of emotions are inherent or whether they are learned during lifetime. He also proposed that expressions which can be found in both man and animals, such as the sneer, are due to a common genetic ancestors. More recently Ekman [3] created the Facial Action Coding System (FACS), which is able to categorize and encode almost every anatomically possible facial expression.

But emotions are not only expressed in faces but also using body posture and movement. Already simple visualizations such as point light displays of a walking person suffices for us to be able to recognize emotions [1]. This is demonstrated by the computer program “BML Walker” described in [15]. It allows specification of physical properties such as sex, weight, and also emotional aspects nervous-relaxed and happy-sad via sliders. A point light display of a motion that fits to the chosen parameter is generated on-the-fly. Generation of emotional motions therefore seems to be possible. But how can we use this to gain insight into emotions?

In [13] kinematic analysis of emotional walking motions was done. They used motion capture data and used a non-linear blind-source separation method. It efficiently finds only a few source components that approximate high-dimensional emotional walking. This allows one to simulate different emotional styles on a kinematic skeleton. Furthermore these spatio-temporal primitives are specific for different emotions and indicate emotion-specific primitives in the human motor system.

Only little research of emotional body language has so far been done by using (rigid-body) dynamics. In [11] a learning method was used to create stylized motions which can be used as a physics-based animation system. It allows one to learn a parameter vector θ from motion-capture data, which can then be applied to different motions. The vector θ contains information such as elasticity parameters for shoe contact, muscles and tendons and also preferences for certain muscles. The method was used to learn emotional styles, but focus of this research is on generation of stylized animations and not on emotional body language itself.

With our research, we want to explore emotional body language on the level of rigid-body dynamics. One of the assumptions of our work is that human motions are optimal in some sense. Optimization has already been successfully used to create human like motions such as running [14] or platform diving [8]. We therefore use a model-based approach using a rigid-body model and optimal control methods. This allows us to look at emotional body language on a level of forces and torques that act in or on the body. One of the key questions we have is, whether it is possible to relate certain emotions to specific goals in the form of objective functions.

In this paper we want to show our preliminary results that will form the base for future work for that we want to use motion capture data and inverse optimal control methods. For this we want to follow the method presented in [12] which uses a bi-level approach to identify the objective function that is described as a linear combination of base criteria. Using this, the identification of the objective function is then formulated as a least-squares parameter estimation of the linear coefficients that tries to fit the optimally controlled motion to that of a recorded emotional motion which requires the solution of an optimal control problem in the lower loop.

This paper focuses on this lower level optimal control problem along with a selection of base criteria functions and their solutions.

2 Rigid-Body Model for Human Walking

The multi-body model we created consists of 12 bodies, including legs (which are split-up in thigh and shank), feet, upper- and lower-arms, head, and trunk. It is a 2-D model that moves in the sagittal plane and has 14 degrees of freedom (3 for the pelvis, 2 for each hip, knee, ankle, shoulder, and elbow and 1 for the head). During contact with the ground the model is subject to algebraic constraints. We use multiple distinct Phases for each set of contact constraints. Collisions of the foot with the ground are modeled as inelastic impacts.

The state of the body is described using generalized coordinates which are denoted by q. The variables \(\dot{q},\ddot{q},\) and τ are the generalized velocities, accelerations and joint torques. Our model is an underactuated system which means there are fewer actuators than degrees of freedom. In our case, the 3 degrees of freedom of the pelvis are not actuated, which results in \(\tau _{0}(t) =\tau _{1}(t) =\tau _{2}(t) = 0\) at all times. All other degrees of freedom and also their corresponding joints are called actuated.

We use data from the biomechanics literature [10] for both the kinematic and inertial quantities so that our model matches that of an adult male person.

The damping effects of muscles and tendons are modeled using linear damper elements at the actuated joints. We use an identical damper constant for corresponding left and right joints which results in 6 damper constants. These constants are added as free parameters to the optimization problem.

An overview of the model is given in Fig. 1a and the possible types of contact for a single foot is shown in Fig. 1b.

Fig. 1
figure 1

Overview of the model structure and the contact constraints. (a) Overview of our model topology. The model has 12 segments and 14 degrees of freedom. (b) Contact model for ground foot. The square markers and coordinated arrows describe the contact points and contact normals along which the contact point translation is constrained. The constraint forces are applied on the foot segment

2.1 Phases

We are interested in a periodic gait, which means that the pose at the end of a double step is identical to that at the beginning. A symmetric periodic gait is a further simplification which assumes that a step with the right leg is the step of the left leg mirrored on the sagittal plane. This allows us to restrict ourselves to the optimization of a single step and posing appropriate periodicity constraints.

For each type of contact with the ground we have different constraint sets and therefore different ODEs for the model dynamics. Figure 2 shows the single step we optimize, the order of the individual model phases, and when collisions occur. In total we have four contact phases: Right Flat, Right Toes, Right Toes Left Heel, Right Toes Left Flat and two collision events: at touchdown of Left Heel and touchdown of the Left Toes.

The actual durations of each of the phases are not prescribed. Instead each they are determined by the optimization.

Fig. 2
figure 2

Overview of the gait phases and the constraint sets RF Right Flat, RT Right Toes, RT LH Right Toes Left Heel, RT LF Right Toes Left Flat. Ground collisions occur at TD LH (touchdown Left Heel) and TD LT (touchdown Left Toes)

2.2 Contact Modeling

As a contact model we use a single segment flat foot. Different numbers of constraints are imposed on the model, depending on the type of contact: three constraints when the foot is flat on the ground, two constraints when either heel or toes are in contact, or no constraints when the foot is swinging (Fig. 1b).

The constrained dynamics can be expressed as a differential algebraic equation with:

$$\displaystyle\begin{array}{rcl} M(q)\ddot{q}& =& -C(q,\dot{q}) - G(q)^{T}\lambda + T\tau,{}\end{array}$$
(1a)
$$\displaystyle\begin{array}{rcl} g(q)& =& 0.{}\end{array}$$
(1b)

where M(q) is the joint-space inertia matrix, \(C(q,\dot{q})\) the Coriolis and gravitational forces, and τ the joint actuation torques. The matrix T maps the applied torques onto the actuated joints. The matrix G(q) is the contact Jacobian of the contact constraints g(q) and λ are the contact forces. The constraint Jacobian G(q) has full rank due to the choice of contact points and normals (Fig. 1b).

Using index reduction this is transformed into a linear system of the form:

$$\displaystyle{ \left (\begin{array}{cc} M(q)&G^{T}(q) \\ G(q) & 0 \end{array} \right )\left (\begin{array}{c} \ddot{q}\\ \lambda \end{array} \right ) = \left (\begin{array}{l} - C(q,\dot{q}) + T\tau \\ -\gamma (q,\dot{ q}) \end{array} \right ) }$$
(2)

where \(\gamma (q,\dot{q})\) contains derivative terms of the algebraic contact equation (1b). The matrix on the left-hand side is regular and the system can therefore be solved to obtain \(\ddot{q}\).

With the invariants \(g_{\mathit{pos}}(t_{0}) = g(q(t_{0})) = 0\) and \(g_{\mathit{vel}}(t_{0}) = \frac{d} {dt}g(q(t_{0})) = 0\), fulfilled at the beginning of the time horizon, the system (2) is mathematically equivalent to (1). When using this formulation one normally has to pay attention on drift of the algebraic constraint during numerical integration over larger time horizons. For our case the integration duration is usually less than a second so we do not need to account for this.

By setting \(x(t) = (q(t),\dot{q}(t))^{T}\) and u(t) = τ(t) and due to the regularity of the matrix in (2) we can embed the contact dynamics (2) in an ordinary differential equation (ODE):

$$\displaystyle{ \dot{x} = f(t,x(t),u(t)). }$$
(3)

The dimensions and equations for \(G(q),\gamma (q,\dot{q}),\) and λ change depending on the contact type which results in multiple distinct ODEs which each describe the dynamics for a specific set of constraints. The model equations for the different contact phases i are denoted by:

$$\displaystyle{ \dot{x} = f_{i}(t,x(t),u(t)). }$$
(4)

This formulation allows us to describe the dynamics of the character as continuously differentiable functions for each set of constraints as required by our trajectory optimization method.

2.3 Ground Collision

We model the foot touchdown as an inelastic collision. Such a contact gain has two consequences: the set of constraints change, which results in a change of the model equation (4) and furthermore in a discontinuity of the generalized velocities \(\dot{q}\).

If a contact gain is detected at time t c we can compute the change of the velocities from right before the contact event \(\dot{q}_{c}^{-}\) to after the collision \(\dot{q}_{c}^{+}\) by solving

$$\displaystyle{ \left (\begin{array}{cc} M(q) &G_{\mathit{new}}^{T}(q) \\ G_{\mathit{new}}(q)& 0 \end{array} \right )\left (\begin{array}{c} \dot{q}_{c}^{+}\\ \varLambda \end{array} \right ) = \left (\begin{array}{c} M(q)\dot{q}_{c}^{-} \\ 0 \end{array} \right ). }$$
(5)

The matrix G new (q) is the constraint Jacobian for the new constraint set and Λ the impulse in cartesian coordinates that acts at the contact points of the new constraint set. Solving this equation ensures that the invariant \(g_{\mathit{vel}}(t_{c}^{+}) = 0\) is fulfilled.

Analog to the model equations this equation can also be written as a transition function:

$$\displaystyle{ x(t_{c}^{+}) = h_{ i}(x(t_{c}^{-})) }$$
(6)

for which i denotes the specific constraint set used for the constraint Jacobians.

On contact losses there is no discontinuity for the generalized velocities \(\dot{q}\), therefore no special treatment is required. In this case the transition function (6) simplifies to \(x(t^{+}) = x(t^{-})\).

2.4 Dynamics Implementation

All modeling and computation is done using the RBDL – the Rigid Body Dynamics Library. It is a highly efficient C++ code that contains some essential rigid-body dynamics algorithms such as the Recursive Newton-Euler Algorithm (inverse dynamics), the Composite Rigid-Body Algorithm (computation of the joint-space inertia matrix), and the Articulated Body Algorithm (forward dynamics).

The library strongly builds on the concept of Spatial Algebra [4], which is a both concise and efficient notation for describing rigid-body kinematics and dynamics. Instead of expressing the motion of the individual bodies using two distinct sets of 3-D equations (one for translations and one for rotations) it combines the two equations in a uniform 6-D formulation. This results in less equations but also fewer lines of code.

RBDL uses by default the Eigen3 C++ template library [6] for linear algebra. It automatically makes use of high-performance SSE instructions that greatly speeds up evaluation of the 6-D expressions if supported by the CPU.

Computations for the joint-space inertia matrix M(q) is done using the the Composite Rigid-Body Algorithm. The Recursive Newton-Euler Algorithm is used to compute the coriolis and gravitational forces \(C(q,\dot{q})\). The library also computes the contact Jacobians G(q) and derivative terms \(\gamma (q,\dot{q})\). RBDL then builds the linear system (2) and solves it using a Householder QR decomposition provided by the Eigen3 library.

The RBDL is freely available under the permissive zlib-License and can be obtained from [5].

3 Optimal Control Problem Formulation of a Human Gait

By using optimal control methods we can simultaneously optimize the motion \(x(t) = [q(t),\dot{q}(t)]^{T}\), the controls u(t) = τ(t) and the parameters p, such as the spring damper constants and steplength and velocity. We have four model equations (RF, RT, RT LH, RT LF), which results in a four–phase optimal control problem.

3.1 General Formulation

The whole optimal control problem can be written as:

$$\displaystyle{ \min _{x(\cdot ),u(\cdot ),p,t_{1},\ldots,t_{4}}\ \ \sum _{i=1}^{4}\int _{ t_{i-1}}^{t_{i} }\varPhi _{L_{i}}(t,x(t),u(t),p)\mathit{dt} +\sum _{ i=1}^{4}\varPhi _{ M_{i}}(t_{i},x(t_{i})) }$$
(7a)

subject to:

$$\displaystyle\begin{array}{rcl} \dot{x}(t)& =& f_{i}(t,x(t),u(t),p),\ \ t \in [t_{i-1},t_{i}],\ i = 1,\ldots,4,\qquad \;{}\end{array}$$
(7b)
$$\displaystyle\begin{array}{rcl} x(t_{j}^{+})& =& h_{ j}(x(t_{j}^{-})),\ \ j = 2,3,\quad {}\end{array}$$
(7c)
$$\displaystyle\begin{array}{rcl} g_{i}(t,x(t),u(t),p)& \geq & 0,\ \ \ \ t \in [t_{i-1},t_{i}],\ i = 1,\ldots,4,\quad {}\end{array}$$
(7d)
$$\displaystyle\begin{array}{rcl} r^{\mathit{eq}}(x(\hat{t}_{ 0}),\ldots,x(\hat{t}_{k}),p)& =& 0,\ \ \ \ \hat{t}_{0},\ldots \hat{t}_{k} \in [t_{0},t_{4}],\quad {}\end{array}$$
(7e)
$$\displaystyle\begin{array}{rcl} r^{\mathit{ineq}}(x(\hat{t}_{ 0}),\ldots,x(\hat{t}_{k}),p)& \geq & 0,\ \ \ \ \hat{t}_{0},\ldots \hat{t}_{k} \in [t_{0},t_{4}].\quad {}\end{array}$$
(7f)

The objective function (7a) used here is split up in two parts: the Lagrange terms \(\varPhi _{L_{i}}\) that are evaluated over the whole phase duration and the Mayer terms \(\varPhi _{M_{i}}\) that are evaluated at the end of each phase. The former can be used to e.g. minimize the torques applied whereas the latter can for example be used to minimize time. Equivalence of the two terms can be shown but their explicit use eases the formulation of certain optimization criteria. We used different objective criteria to achieve different walking styles:

  • Minimum Torques: here we minimize the control effort formulated as \(\varPhi _{L_{i}} = \vert \vert Wu(t)\vert \vert ^{2}\) with a diagonal scaling matrix W that accounts for different strengths of joint actuation.

  • Minimum Time: this optimization criterion does not need a Lagrangian term. Only a Mayer term at the last phase is needed which is \(\varPhi _{M_{4}}(t_{4},x(t_{4})) = t_{4}\).

  • Minimum Angular Amplitudes: for this criterion we minimize the amplitudes of the actuated joints by setting \(\varPhi _{L_{i}} = \vert \vert q_{\mathit{actuated}}(t)\vert \vert ^{2}\).

  • Minimum Head Angular Velocity: here we want to minimize the global head angular velocity, which we formulate as \(\phi _{L_{i}} = (\dot{q}_{\mathit{PelvisRotZ}}(t) +\dot{ q}_{\mathit{HeadRotZ}}(t))^{2}\).

Equations (7b) are the model equations from Sect. 2.2 for each contact phase. The transition functions in (7c) are used to describe the changes from one phase to another which we described in Sect. 2.3. General state and control bounds such as joint and torque limits are described by (7d). Posture conditions (e.g. foot positions), periodicity at given points in time and detection of phase switches are modeled by (7e) and (7f). The latter also includes a minimum step size of 0.4 m to ensure a sufficient walking distance.

3.2 Numerical Solution

To solve this problem we use a direct multiple shooting method which is implemented in the software package MUSCOD-II [9]. It discretizes the continuous formulation (7a)–(7f) for both controls and states by dividing the time horizon in M so-called multiple shooting intervals. The states are discretized as starting values s j for initial value problems defined for each multiple shooting interval j. The controls are discretized by parameters r j for simple base functions on each multiple-shooting interval, such as piecewise constant, piecewise linear or spline functions for each interval. To ensure that the resulting states represent a continuous solution additional continuity conditions

$$\displaystyle{x(t_{j+1};s_{j},r_{j}) - s_{j+1} = 0}$$

are formulated.

By doing so the functions x(t) and u(t) were replaced by their finite dimensional counterparts \(s_{0},\ldots,s_{M}\) and \(r_{0},\ldots,r_{M-1}\). Further discretization of the constraints and objective function leads to an nonlinear optimization problem of variables \(y = [s_{0},r_{0},\ldots,r_{M-1},s_{M},p,t_{1},\ldots,t_{4}]^{T}\) of the form:

$$\displaystyle{\begin{array}{ll} &\qquad \quad \min \limits _{y}\ F(y) \\ &\text{subject to:} \\ &\qquad \quad g(y) \geq 0 \\ &\qquad \quad h(y) = 0 \end{array} }$$

This problem is then solved by using a specially tailored sequential quadratic programming (SQP) method.

4 Results

Fig. 3
figure 3

Visualization of the optimized walking motions for the used objective criteria. (a) Minimum torques. (b) Minimum time. (c) Minimum angular amplitudes. (d) Minimum head angular velocity

For the control discretization we used spline functions and 10 multiple shooting intervals for the first phase (Right Flat) and 5 for each of the others (Right Toes, Right Toes Left Heel, and Right Toes Left Flat). The computation time for each motion is around 30 min on an Intel i7 920 processor.

A visualization of the computed gaits is presented in Fig. 3. The motions vary greatly in terms of speed and style. The motions are physically valid for the current model topology and look natural. There is a natural arm swing opposite to the leg swing.

While the motions “Minimum Torques” and “Minimum Head Angular Velocity” do look similar, there is a substantially stronger arm swing for the latter objective criteria. Arm motions counteract the rotational motions of the lower limbs and help to stabilize the upper body. In addition, arm motions can serve to damp out perturbations induced in the walking system by ground impacts. The two motions also differ in average velocity which is 0.99 m/s for “Minimum Torques” and 1.12 m/s for “Minimum Head Angular Velocity”.

The resulting motion for “Minimum Time” features a posture that is leaned forward as one would expect for a fast gait and it is also the motion with the shortest duration and also the highest average velocity of 1.6 m/s (duration: 0.3 s, step length: 0.48 m). The motion “Minimum Angular Amplitudes” has an average velocity of 1.45 m/s (duration: 0.44 s, step length: 0.64 m). Here, the overall posture is held upright and conveys a strong tenseness.

5 Conclusion and Outlook

The model and optimal control problem was presented together with various objective criteria and how the optimal control problem can be solved using a direct method. We computed optimized motions for four different objective criteria that resulted in four distinct walking styles. The motions themselves are highly coordinated and compliant. The method presented is well suited to generate off–line open–loop walking motions for a complex full–body human model.

The achieved results form the base of our further work to identify specific objective functions using an inverse optimal control problem formulation as successfully used in [12]. For this we would like to optimize gaits using a linear combination of multiple objective criteria, such as

  • Maximum average velocity

  • Minimum/maximum energy

  • Minimum/maximum acceleration

  • Minimum/maximum jerk

  • Minimum/maximum ground impacts

  • Maximum angular amplitudes

  • Minimum/maximum positive or negative work

  • Maximum manipulability measure [7].

These individual objective criteria will serve as base-functions for the identification of the objective function of emotional motions using inverse optimization. A first step for this would be a direct comparison of gaits computed by optimizations with recorded motions obtained by motion capture.

A more realistic model for the ground contact would be using spheres for the heel and toes of the foot or a single ellipsoid. This would allow continuous rolling curved surface instead of the discrete phases of the current flat foot. Another modeling extension would be to create a 3-D model and investigate turning or walking along curved paths. Additionally it would be an interesting question whether we could apply these objective functions for other types of motion such as grasping or other gestures.

Evaluating the results of the different objective criteria, the trajectories of the “Minimum Head Angular Velocity” solution seems to be the closest to a natural walking solution for a neutral emotional state. The importance of this criterion and others in the context of neutral motions and emotionally modified motions is further evaluated in our current research.