# jtraj

## jtraj

Compute a joint space trajectory between two points

### Syntax

• [q, qd, qdd] = jtraj(q0, qf, t, qd0, qdf)

### Input Arguments

• q0, qf — 1 x n row vectors of start and end positions, respectively.
• t — number of time steps, or time vector
• qd0, qdf — start and end velocity, respectively

### Output Arguments

• q — generated trajectory matrix (m x n)
• qd — velocity matrix (m x n)
• qdd — acceleration matrix (m x n)

### Description

jtraj( )computes a joint space trajectory between two set of joint variable values q0 (1 x n) and qf (1 x n). A qunitic polynomial is used with default zero boundary conditions for velocity and acceleration. Argument t can be given as number of time steps or a time vector. Initial and final joint velocity can be specified via qd0 and qdf, respectively.

### Examples

```q = jtraj([0 0],[pi/2 pi/4], 50); plot(q); // see the resulting trajectory [q, qd] = jtraj([-1 0 0 ],[1 pi/4 pi],[1:49]/49, [1 1 1],[2 0 1]); figure(1); subplot(211), plot(q); title('joint trajectory') subplot(212), plot(qd); title('joint velocity')```