M-File Help: mtraj | View code for mtraj

# mtraj

Multi-axis trajectory between two points

[q,qd,qdd] = mtraj(tfunc, q0, qf, m) is a multi-axis trajectory (MxN) varying from configuration q0 (1xN) to qf (1xN) according to the scalar trajectory function tfunc in m steps. Joint velocity and acceleration can be optionally returned as qd (MxN) and qdd (MxN) respectively. The trajectory outputs have one row per time step, and one column per axis.

The shape of the trajectory is given by the scalar trajectory function tfunc

    [S,SD,SDD] = TFUNC(S0, SF, M);

and possible values of tfunc include @lspb for a trapezoidal trajectory, or @tpoly for a polynomial trajectory.

[q,qd,qdd] = mtraj(tfunc, q0, qf, T) as above but T (Mx1) is a time vector which dictates the number of points on the trajectory.

## Notes

- If no output arguments are specified Q, QD, and QDD are plotted.
- When TFUNC is @tpoly the result is functionally equivalent to JTRAJ except that no initial velocities can be specified. JTRAJ is computationally a little more efficient.

## See also

jtraj, mstraj, lspb, tpoly

© 1990-2014 Peter Corke.