Trajectory Generation
A trajectory is a time-parameterized motion:
Moro provides compact numerical point-to-point and multi-waypoint polynomial interpolation and synchronized trapezoidal joint motion.
Normalized time
Let
and define
Then
Using normalized time makes the polynomial coefficients independent of the absolute time origin.
Physical-time derivatives satisfy
and
Linear interpolation
For endpoint positions \(x_0\) and \(x_f\),
Therefore
and
Cubic interpolation
For
with endpoint velocities \(v_0\) and \(v_f\),
Velocity and acceleration are
Quintic interpolation
For
with endpoint velocities \(v_0,v_f\) and accelerations \(a_0,a_f\),
Let
Then
Classical zero-derivative profiles
For \(x_0=0\), \(x_f=1\), and zero supported derivative conditions:
Linear
Cubic
Quintic
This gives the teaching progression
linear -> position
cubic -> position + velocity
quintic -> position + velocity + acceleration
Vector trajectories
The same formulas apply componentwise to vector-valued coordinates.
For joint space,
For Cartesian position space,
With zero derivative boundary conditions, a Cartesian position trajectory lies on the line segment between \(p_0\) and \(p_f\).
Nonzero derivative conditions can produce a curved path because the polynomial acts independently on each Cartesian component.
Synchronized trapezoidal joint-space motion
A trapezoidal motion profile is not a global polynomial interpolator. Instead, it prescribes a piecewise-constant acceleration, leading to a piecewise-linear velocity and piecewise-quadratic position.
For a point-to-point joint move, let
[ \Delta \mathbf q=\mathbf q_f-\mathbf q_0,\qquad \mathbf q(t)=\mathbf q_0+s(t)\Delta\mathbf q, ]
where dimensionless s(t) progresses from 0 to 1. The physical-time
derivatives are
[ \dot{\mathbf q}(t)=\dot s(t)\Delta\mathbf q,\qquad \ddot{\mathbf q}(t)=\ddot s(t)\Delta\mathbf q. ]
For each moving joint, independently prescribed bounds imply
[ \bar v=\min_{\Delta q_i\ne0}\frac{v_{i,\max}}{|\Delta q_i|}, \qquad \bar a=\min_{\Delta q_i\ne0}\frac{a_{i,\max}}{|\Delta q_i|}. ]
At rest at both endpoints, the peak progress speed for the minimum-duration symmetric profile is
[ v_p=\min(\bar v,\sqrt{\bar a}). ]
The acceleration, cruise and deceleration durations are
[ t_a=\frac{v_p}{\bar a},\qquad t_c=\frac{1-v_p^2/\bar a}{v_p},\qquad t_d=t_a, ]
so total duration is T=2t_a+t_c. A positive t_c produces a
trapezoidal velocity curve; t_c=0 produces a triangular one.
For local time \theta=t-t_0, effective acceleration A and speed
V=A t_a, the profile is
Phase |
|
|
|
|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
Unlike quintic interpolation with zero endpoint derivatives, this profile generally has nonzero acceleration at the start and end, and acceleration jumps at phase transitions. It is C1, not C2. At transition times, the stored acceleration uses the right-hand phase, except at the final endpoint (left-hand phase).
A longer prescribed duration can be achieved by scaling time uniformly.
If \alpha=T/T_{\min}\geq1, velocity magnitudes are divided by
\alpha and acceleration magnitudes by \alpha^2. All joint
coordinates remain synchronized because they share s(t).
This formulation provides a minimum duration within the symmetric rest-to-rest straight joint-path profile family. It is not a general time-optimal planner. It does not impose jerk bounds, collision avoidance, joint-position constraints or actuator torque limits.
See the R/RR teaching example and the trajectory user guide.
Separation from robot algorithms
Trajectory generation is independent of robot kinematics.
A Cartesian trajectory may later be resolved using sequential inverse kinematics:
cart = position_trajectory(...)
ik = solve_position_trajectory(robot, cart.p, q0=...)
Similarly, a joint-space trajectory can be passed directly to visualization as a time-major matrix.
Polynomial interpolation does not enforce robot constraints or dynamic feasibility. Trapezoidal joint-space motion respects the supplied velocity and acceleration limits along its synchronized path, but neither generator validates joint positions, collisions, or actuator limits.