M-File Help: trchain | View code for trchain

# trchain

Chain 3D transforms from string

T = trchain(s, q) is a homogeneous transform (4x4) that results from compounding a number of elementary transformations defined by the string s. The string s comprises a number of tokens of the form X(ARG) where X is one of Tx, Ty, Tz, Rx, Ry, or Rz. ARG is the name of a variable in main workspace or qJ where J is an integer in the range 1 to N that selects the variable from the Jth column of the vector q (1xN).

For example:

    trchain('Rx(q1)Tx(a1)Ry(q2)Ty(a3)Rz(q3) Rx(pi/2)', [1 2 3])

is equivalent to computing:

    trotx(1) * transl(a1,0,0) * troty(2) * transl(0,a3,0) * trotz(3)

## Notes

- The string can contain spaces between elements or on either side of ARG.
- Works for symbolic variables in the workspace and/or passed in via the vector Q.
- For symbolic operations that involve use of the value pi, make sure you define it first in the workspace: pi = sym('pi');

## See also

trchain2, trotx, troty, trotz, transl

© 1990-2014 Peter Corke.