QQFLY.NET
← Writing

Lie groups in robotics: carrying a drink at speed

Moving objects is one of the main jobs we give robot arms. Some objects, such as containers of liquid, impose requirements on the whole motion—not just the starting and ending poses.

A restaurant robot holding a serving tray level
A serving robot at Haidilao.

For the robot pictured above, the requirement is to keep the end effector level throughout the move. If we want to move faster, however, the trajectory also has to satisfy dynamic constraints.

A waiter carrying a tray at speed
A restaurant with an impressively fast serving system.

There are two things to work out: which dynamic constraints matter, and how to model them. Here's our demo, with a small surprise at the end.

Start with a one-dimensional problem

Consider a mechanism that can move horizontally along xx and rotate in the plane of the page. It needs to carry a cup of water from left to right without spilling it. We have actually used this as a programming exercise in our hiring process.

Horizontal acceleration and tilt angle of a cup

The constraint is easy to describe: the resultant of horizontal acceleration and gravity should be perpendicular to the supporting surface. It is essentially a high-school physics problem.

One way to solve it is to write down the constraints and formulate an optimization problem. Here is another way to look at it.

Choose a space that already satisfies the constraint

Although the mechanism has both a position and an angle, this constrained problem feels as though it has only one independent degree of freedom. If we can find that one-dimensional space, any point we choose within it should satisfy the constraint.

I'll skip the short derivation: horizontal acceleration aa and angle θθ have a one-to-one relationship. We can describe the coupled space as R(1)⊕SO(2)R(1) ⊕ SO(2):

  • R(1)R(1) is the space of horizontal accelerations aa.
  • SO(2)SO(2) is the space of angles θθ.
  • Here, ⊕⊕ denotes the relationship between the two: θ=−arctan2⁡(a,g)θ=-\operatorname{arctan2}(a,g).

Any point in this coupled space satisfies the constraint. Since acceleration cannot change instantaneously, we can sample in the tangent space—the space of jerk—and integrate:

  1. Jerk → acceleration, by integration.
  2. Acceleration → velocity, by integration.
  3. Velocity → position, by integration.
  4. Acceleration → θθ, using the relationship above.

In this construction, whatever jerk we supply, the resulting motion continues to satisfy the stated dynamic constraint.

Simulated motion satisfying the carrying constraint
Random samples in R(1)⊕SO(1)R(1) ⊕ SO(1) produce motions that satisfy the constraint.

Extend the construction to the robot

Returning to the robot arm, we can likewise look for a coupled space R(3)⊕SO(3)R(3) ⊕ SO(3) that satisfies the dynamic constraints throughout. What initially looked like a difficult six-degree-of-freedom problem then becomes a three-degree-of-freedom problem.

The integration and related operations are carried out in SE(3).

And then we can do this:

A Yaskawa arm carrying a drink dynamically
← Writing