QQFLY.NET
← Writing

Lie groups in robotics: smooth trajectories

Robotics deals with things that move in the physical world. To get the behavior we want, our control strategies have to respect that world's rules.

In earlier posts, we looked at Lie groups in visual servoing and in handling dynamic constraints. This time, I want to look at their role in trajectory planning.

Here's the demo:

A path, and a schedule for following it

Trajectory planning can be separated into path interpolation and time parameterization.

Waypoints and rigid-body poses along a path

Suppose we have taught a robot a set of waypoints. It cannot teleport between them, so we need a continuous path that connects them. Interpolation gives us a geometric path p(u)\mathbf{p}(u), where the scalar parameter uu lies in [0,1][0,1].

We can then choose how quickly to move along that path. Time parameterization gives us u(t)u(t), where tt is time, and a continuous trajectory p(u(t))\mathbf{p}(u(t)) that tells us where to be at each instant.

For a more detailed treatment, I recommend:

Biagiotti, Luigi, and Claudio Melchiorri. Trajectory Planning for Automatic Machines and Robots. DOI: 10.1007/978-3-540-85629-0.

Here, I want to focus on how the choice of interpolation affects time parameterization.

A corner cannot be crossed at arbitrary speed

Velocity is a vector. Because physical bodies have inertia, neither its magnitude nor its direction can jump instantaneously.

Velocity directions at a sharp corner

If we connect the waypoints with straight lines, the direction changes abruptly at the intermediate point B. A real robot must either depart from that exact geometric path or slow to zero at B. That tradeoff affects both accuracy and speed.

The usual solution is familiar from robotics textbooks: blend the corner with a circular arc or a polynomial curve so that the path's tangent changes continuously.

Blending a path through a corner

But how should we blend orientations? What is a circular arc or a polynomial curve in orientation space?

What SLERP does—and what happens at a join

Quaternions give us spherical linear interpolation, or SLERP. Does that solve the problem?

Three orientations at the same position

In this example, a rigid body must pass through three orientations without changing position. SLERP finds a rotation axis between two orientations and rotates about that axis. Applied to the example, it gives:

Angular velocity during piecewise SLERP interpolation
SLERP interpolation. The green arrow shows the direction of angular velocity.

SLERP is the orientation-space counterpart of straight-line interpolation. At the intermediate waypoint, the direction of angular velocity still changes abruptly.

As of 2020, papers on orientation interpolation with higher-order continuity were still appearing at conferences such as IROS and ICRA. Let's look at the problem using a Lie-group representation.

In a linear space, such as Cartesian position or joint coordinates, interpolation between s1\mathbf{s}_1 and s2\mathbf{s}_2 is easy to write:

s(u)=s1+u×(s2−s1),u∈[0,1]\mathbf{s}(u)=\mathbf{s}_1+u\times(\mathbf{s}_2-\mathbf{s}_1),\quad u\in[0,1]

For orientations R1\mathbf{R}_1 and R2\mathbf{R}_2, we define the corresponding group operations:

  • Addition: R1⊕R2=R1×R2\mathbf{R}_1 ⊕ \mathbf{R}_2=\mathbf{R}_1\times\mathbf{R}_2.
  • Inversion: ⊖R=R−1\ominus\mathbf{R}=\mathbf{R}^{-1}.

This gives us a “subtraction” operation:

R2⊖R1=Expm(Logm(R1−1×R2))\mathbf{R}_2 ⊖ \mathbf{R}_1=Expm(Logm(\mathbf{R}_1^{-1}\times\mathbf{R}_2))

Here, Logm is the matrix logarithm. For the details of these operations, see an introduction to Lie groups and Lie algebras.

SLERP can then be expressed in a form that resembles interpolation in a linear space:

R(u)=R1⊕(R2⊖R1)u=R1⊕Expm(u×Logm(⊖R1⊕R2)),u∈[0,1]\mathbf{R}(u)=\mathbf{R}_1 ⊕ (\mathbf{R}_2 ⊖ \mathbf{R}_1)^u=\mathbf{R}_1 ⊕ Expm(u\times Logm(⊖\mathbf{R}_1\oplus\mathbf{R}_2)),\quad u\in[0,1]

Building a Bézier blend

In linear spaces, polynomial interpolation is straightforward, and Bézier curves are one way to construct those polynomials.

Constructing a quadratic Bézier curve
A second-degree Bézier curve.
Constructing a fifth-degree Bézier curve
A fifth-degree Bézier curve.

These animations, from Wikipedia, illustrate how an nth-degree Bézier curve is built from repeated linear interpolation. Once we have a definition of linear interpolation on a Lie group, we can extend the same construction to obtain a Bézier curve on that group.

That gives us an orientation path with a Bézier blend:

SLERP compared with a fifth-degree Bézier blend
Left: SLERP. Right: a fifth-degree Bézier blend. Green arrows indicate angular-velocity directions.

With this Lie-group Bézier blend, the tangent direction of the orientation trajectory no longer changes abruptly.

Our earlier high-speed handling example also required continuous trajectory interpolation across SE(3). It used these techniques too.

Continuous changes in the direction of end-effector angular velocity
The direction of the end effector's angular velocity changes continuously.
A robot trajectory-interpolation experiment
A movie clip used as a closing joke
A couple of unexpected guests.
← Writing