mtraj

RTSX Help: multi-axis/multi-segment trajectory

mtraj

mstraj

Multi-axis (mtraj) and multi-segment/multi-axis (mstraj) trajectory generation

Syntax

  • [s, sd, sdd] = mtraj(q0, qf, M, options)
  • s = mstraj(segments, qdmax, tsegment, q0, dt, Tacc, options)

Input Arguments

  • q0, qf — row vectors of start and end positions, respectively. Number of elements in each vector equal number of motion axes.
  • M — number of points
  • segments — m x n matrix of via points, one row per point, one column per axis. The last via point is the destination.
  • qdmax — 1 x n vector of axis velocity limits that cannot be excedded
  • tsegment — m x 1 vector containing the durations for each of the m segments
  • q0 — 1 x n vector of initial axis coordinates
  • dt — time step
  • tacc — 1 x m vector of acceleration time for each segment

Output Arguments

  • s — generated trajectory matrix
  • sd — velocity matrix
  • sdd — acceleration matrix

Options

Note : options in [ ] must be passed to the function in pairs.

mtraj

  • ‘cpoly’ — use cubic polynomial trajectory
  • ‘qpoly’ — use quintic polynomial trajectory
  • ‘lspb’ — use linear segment with parabolic blend trajectory
  • ‘plot’ — plot trajectory

mstraj

  • ‘verbose’ — print information in command window
  • ‘plot’ — plot trajectory
  • [ ‘qd0’, value] — specify 1 x n vector of initial axis velocity
  • [ ‘qdf’, value] — specify 1 x n vector of final axis velocity

Description

mtraj( ) generates multi-axis trajectory from q0 to qf using cubic, quintic polynomial, or linear segment with parabolic blend (default), specified as an option.

mstraj( )generates multi-segment/multi-axis trajectory based on via points and axis velocity limits. Linear segment with parabolic blend is used. Initial and final axis velocitys can be specified as options.

Examples

s = mtraj([0 2], [1 -1], 50, 'qpoly');
s = mtraj([-1 1], [2 3], 100, 'plot');
via = [4, 1; 4, 4; 5, 2; 2, 5];
q = mstraj(via, [2 1],[], [4, 1], 0.05, 1, 'plot');

See also

  • cpoly, qpoly, lspb — trajectory generation using cubic, quintic polynomials or linear-segment parabolic blend
  • jtraj — joint space trajectory
  • ctraj — cartesian trajectory