Algorithm Search⌘K

Problemintro

Trajectory generation

Also called trajectory planning.

Turn a path or a set of waypoints into positions, velocities and accelerations over time that the robot can follow.

Trajectory generation is the step between deciding where a robot should go and making its motors go there. A motion planner or a person gives a path, a list of waypoints, or just a target. The motor controllers need much more: a position, a velocity and an acceleration for every joint at every control cycle, typically every millisecond. The trajectory generator fills that gap. It must produce a motion that passes through the given points or along the given path, that is smooth enough for the mechanics, and that stays within the limits of the motors on velocity, acceleration and sometimes jerk. Within those rules it usually tries to be as fast or as smooth as possible. The problem is older than robotics: cam designers and machine tool builders solve the same problem, as in cam follower motion laws and feedrate scheduling. It differs from its neighbors as follows. A time scaling is one kind of answer, the timing along a fixed path. Trajectory optimization is the more general problem that also chooses the path and uses a model of the dynamics.

In plain words

A plan for a robot arm often says only "go from here, through there, to over there". The motors cannot use that. They need to know, a thousand times a second, exactly where each joint should be and how fast it should be turning. Trajectory generation turns the plan into that stream of numbers. The motion must be possible: no motor can go faster than its top speed or speed up faster than its strength allows. It should also be gentle, because sudden changes in force shake the arm. And it should not waste time. Different methods trade these goals in different ways, from a single formula for a simple move to an optimization for a drone flying through many points.

Definition

Input.

  • A geometric description of the motion, one of: a start and a goal configuration; waypoints q0,…,qmq_0, \dots, q_m in the configuration space, with or without times; or a path θ(s)\theta(s), s∈[0,1]s \in [0, 1].
  • Boundary states: velocities and accelerations at the start and the end, often zero (rest to rest).
  • Limits on each joint, such as ∣q˙i∣≤Vi|\dot q_i| \le V_i, ∣q¨i∣≤Ai|\ddot q_i| \le A_i and ∣q...i∣≤Ji|\dddot q_i| \le J_i, or limits on joint torques through a dynamic model.
  • A criterion: the duration TT is given, or TT is to be minimized, or a smoothness cost such as ∫∥q...∥2dt\int \|\dddot q\|^2 dt is to be minimized.

Output. A trajectory q:[0,T]→Cq : [0, T] \to \mathcal C that meets the boundary states, passes through the waypoints or along the path, has continuous derivatives up to a required order kk (usually k=1k = 1 or 22), satisfies the limits, and is optimal or good for the criterion.

Single-letter quantities used on this page. DD is the distance of a one-axis move, VV, AA and JJ are its limits on velocity, acceleration and jerk, TT is the duration, mm is the number of segments between waypoints, and nn is the number of joints.

Variants

  • Point to point. One axis or several joints move from one configuration to another, usually from rest to rest. The joints must arrive together.
  • Via points. The trajectory passes through waypoints (interpolation) or near them (approximation), with or without given passing times.
  • Along a fixed path. The geometry is fixed and only the time scaling s(t)s(t) is sought. The time-optimal version under joint torque limits is time-optimal path parameterization.
  • Online. The trajectory must be recomputed every control cycle from the current state, because the target can change: online trajectory generation.
  • Joint space or task space. The trajectory is planned for the joint angles, or for the end-effector pose and then mapped through inverse kinematics.
  • With moving obstacles. The timing must avoid obstacles that move along the path: path-velocity decomposition.
  • Learned. The shape comes from a demonstration and must be adapted to new goals: dynamic movement primitives.

Examples

One axis, four profiles. Move one joint D=1D = 1 rad from rest to rest with V=1V = 1 rad/s and A=2A = 2 rad/s². The smallest duration that respects both limits depends on the shape of the profile:

profile smallest TT (s) binding limit jerk
trapezoid 1.5 both unbounded at 4 instants
double S, J=8J = 8 1.75 all three at most 8
cubic 3≈1.732\sqrt 3 \approx 1.732 acceleration unbounded at the ends
quintic 1.875 velocity about 9.1 at the ends
degree 7, minimum snap shape 2.1875 velocity 0 at the ends

The trapezoid is the fastest possible (a theorem). The polynomials each reach a limit at only one instant, so they are slower, but they are smoother. The numbers follow from the peak values on the linked pages: for example the cubic needs 1.5/T≤11.5/T \le 1 and 6/T2≤26/T^2 \le 2.

Waypoints for a drone. A quadrotor must fly through waypoints 0,1,00, 1, 0 at times 0,1,20, 1, 2 s along one axis without stopping. A minimum-snap trajectory passes the middle waypoint with zero velocity and an acceleration of −8.4-8.4; its snap cost is about six times smaller than stopping at the waypoint. See minimum-snap trajectory.

After a sampling planner. A rapidly-exploring random tree returns a jagged path. Random shortcut path smoothing shortens it, and a time scaling with blends turns it into a trajectory.

Known algorithms

AlgorithmTimeSpacePropertiesCode
Cubic polynomial trajectoryΘ(n m) worstΘ(n m) extradeterministicexactofflinenot randomized1 language
Double-S velocity profileΘ(n) worstΘ(n) extradeterministicexactofflinenot randomized1 language
Minimum-jerk trajectoryΘ(d) worstΘ(d) extradeterministicexactofflinenot randomized1 language
Minimum-snap trajectoryΘ(d m³) worstΘ(m²) extradeterministicexactofflinenot randomized1 language
Online trajectory generationΘ(n) worstΘ(n) extradeterministicexactonlinenot randomized1 language
Quintic polynomial trajectoryΘ(n m) worstΘ(n m) extradeterministicexactofflinenot randomized1 language
Random shortcut path smoothingΘ(N (n + N + k)) worstΘ(n + N) extrarandomizednot exactofflinerandomized1 language
Trapezoidal velocity profileΘ(n) worstΘ(n) extradeterministicexactofflinenot randomized1 language

Bounds

  • Time, one axis, rest to rest. Under ∣q˙∣≤V|\dot q| \le V and ∣q¨∣≤A|\ddot q| \le A, every motion over the distance DD takes at least D/V+V/AD/V + V/A if D≥V2/AD \ge V^2/A, and at least 2D/A2\sqrt{D/A} otherwise, and the trapezoid attains it (theorem, on the trapezoid page).
  • Smoothness, one axis, rest to rest in time TT. With the end derivatives fixed to zero up to order k−1k - 1, the least value of ∫0T(q(k))2dt\int_0^T (q^{(k)})^2 dt is 12D2/T312 D^2/T^3 for k=2k = 2, 720D2/T5720 D^2/T^5 for k=3k = 3 and 100800D2/T7100800 D^2/T^7 for k=4k = 4 (theorems, on the pages of the cubic, the minimum-jerk and the minimum-snap trajectories).
  • Computation. The closed forms take Θ(1)\Theta(1) time per axis and per segment, so Θ(nm)\Theta(nm) in all. Minimum snap with equality constraints is one linear system of size Θ(m)\Theta(m).

Reductions

  • Fixed path to one dimension. Along a fixed path θ(s)\theta(s), the joint limits become limits on (s,s˙,s¨)(s, \dot s, \ddot s), and the problem becomes the choice of one function s(t)s(t), a time scaling.
  • Straight line in joint space to one axis. For θ(s)=θ0+sΔ\theta(s) = \theta_0 + s\Delta with box limits on each joint, the limits on ss are s˙≤min⁡iVi/∣Δi∣\dot s \le \min_i V_i/|\Delta_i| and ∣s¨∣≤min⁡iAi/∣Δi∣|\ddot s| \le \min_i A_i/|\Delta_i|, and a single trapezoid for ss solves the synchronized problem.
  • Equality-constrained minimum snap to a linear system. The KKT conditions of the quadratic cost with linear constraints are one nonsingular linear system.
  • Flat systems to kinematics. For differentially flat systems such as quadrotors, a smooth trajectory of the flat outputs determines the inputs, so trajectory generation for the outputs solves the dynamic problem, as long as the input limits hold.
  • Moving obstacles to a plane. With the path fixed, moving obstacles become forbidden regions in the plane of path position and time (path-velocity decomposition).

Applications

Industrial robot controllers generate joint trajectories for every point-to-point and linear move. CNC machines schedule the feed along tool paths. Quadrotors fly minimum-snap trajectories through waypoints. Collaborative robots replan online when a person comes close. Humanoids and animation systems use minimum-jerk and learned trajectories for human-like motion. Cam and linkage design uses the same motion laws for mechanical followers.

References

  1. Kevin M. Lynch and Frank C. Park, Modern Robotics, Mechanics, Planning, and Control, Cambridge University Press, 2017, Chapter 9 (trajectory generation), Sections 9.1 to 9.4
  2. Luigi Biagiotti and Claudio Melchiorri, Trajectory Planning for Automatic Machines and Robots, Springer, 2008, Chapter 2 (polynomial and other elementary trajectories) and Chapter 3, Sections 3.2 and 3.4 (trapezoidal and double S profiles)
  3. Bruno Siciliano, Lorenzo Sciavicco, Luigi Villani and Giuseppe Oriolo, Robotics, Modelling, Planning and Control, Springer, 2009, the chapter on trajectory planning (general locator)

Where this leads

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW2 basic
  • a contract.yaml