Skip to content

Trajectories

Peter Corke edited this page Aug 17, 2026 · 2 revisions

The toolbox supports several classes of trajectory functions. They all return a Trajectory object which holds a collection of signals typically output by a trajectory generator.

1D trajectories

Function Purpose
quintic quintic polynomial (formerly named tpoly)
trapezoidal trapezoidal trajectory (linear segment with parabolic blends; lspb is a deprecated alias)

ND trajectories

Function Purpose
mtraj multi-joint wrapper for quintic or trapezoidal
jtraj quintic polynomial for multiple joints
mstraj multi-segment path with waypoints
ctraj Cartesian (SE3) straight-line path

The Trajectory object

The object returned by all of the functions above stores its data as .t/.s/.sd/.sdd (roboticstoolbox/tools/trajectory.py):

Attribute Type Meaning
t ndarray(n) or ndarray(n,m) independent variable (step or time)
s ndarray(n) or ndarray(n,m) position
sd ndarray(n) or ndarray(n,m) velocity
sdd ndarray(n) or ndarray(n,m) acceleration
istime bool true if t is in units of seconds, affects scaling of sd/sdd

For compatibility with other applications, .q/.qd/.qdd are read-only properties that are exact synonyms for .s/.sd/.sdd — both names access the same data, there's no separate 1D-vs-ND attribute split.

Method / property Meaning
len(T) n, the number of steps in the trajectory
T.naxes m, the number of axes (1 if .s is a 1D array)
T.plot() plot s, sd, sdd for every axis
T.qplot() plot using qplot(), with the joint-space labelling conventions used elsewhere in the Toolbox

Clone this wiki locally