M-File Help: ETS3 | View code for ETS3 |
Elementary transform sequence in 3D
This class and package allows experimentation with sequences of spatial transformations in 3D.
import +ETS3.* L1 = 0; L2 = -0.2337; L3 = 0.4318; L4 = 0.0203; L5 = 0.0837; L6 = 0.4318; E3 = Tz(L1) * Rz('q1') * Ry('q2') * Ty(L2) * Tz(L3) * Ry('q3') * Tx(L4) * Ty(L5) * Tz(L6)
fkine
isjoint | test if transform is a joint |
njoints | the number of joint variables |
structure a string listing the joint types
display | display value as a string |
plot | graphically display the sequence as a robot |
teach | graphically display as robot and allow user control |
char | convert to string |
string | convert to string with symbolic variables |
* | compound two elementary transforms |
+ | compound two elementary transforms |
Create an ETS3 object
E = ETS3(w, v) is a new ETS3 object that defines an elementary transform where w is 'Rx', 'Ry', 'Rz', 'Tx', 'Ty' or 'Tz' and v is the paramter for the transform. If v is a string of the form 'qN' where N is an integer then the transform is considered to be a joint and the parameter is ignored. Otherwise the transform is a constant.
E = ETS3(e1) is a new ETS3 object that is a clone of the ETS3 object e1.
Convert to string
E.char() is a string showing transform parameters in a compact format. If E is a transform sequence (1xN) then the string describes each element in sequence in a single line format.
Display parameters
E.display() displays the transform or transform sequence parameters in compact single line format.
Find joints in transform sequence
E.find(J) is the index in the transform sequence ETS(1xN) corresponding to the J'th joint.
Forward kinematics
ETS.fkine(q, options) is the forward kinematics, the pose of the end of the sequence as an SE3 object. q (1xN) is a vector of joint variables.
ETS.fkine(q, n, options) as above but process only the first n elements of the transform sequence.
'deg' | Angles are given in degrees. |
Test if transform is a joint
E.isjoint is true if the transform element is a joint, that is, its parameter is of the form 'qN'.
Test if transform is prismatic joint
E.isprismatic is true if the transform element is a joint, that is, its parameter is of the form 'qN' and it controls a translation.
Compound transforms
E1 * E2 is a sequence of two elementary transform.
Number of joints in transform sequence
E.njoints is the number of joints in the transform sequence.
Number of joints in transform sequence
E.njoints is the number of joints in the transform sequence.
Graphical display and animation
ETS.plot(q, options) displays a graphical animation of a robot based on the transform sequence. Constant translations are represented as pipe segments, rotational joints as cylinder, and prismatic joints as boxes. The robot is displayed at the joint angle q (1xN), or if a matrix (MxN) it is animated as the robot moves along the M-point trajectory.
'workspace', W | Size of robot 3D workspace, W = [xmn, xmx ymn ymx zmn zmx] |
'floorlevel', L | Z-coordinate of floor (default -1) |
'delay', D | Delay betwen frames for animation (s) |
'fps', fps | Number of frames per second for display, inverse of 'delay' option |
'[no]loop' | Loop over the trajectory forever |
'[no]raise' | Autoraise the figure |
'movie', M | Save an animation to the movie M |
'trail', L | Draw a line recording the tip path, with line style L |
'scale', S | Annotation scale factor |
'zoom', Z | Reduce size of auto-computed workspace by Z, makes robot look bigger |
'ortho' | Orthographic view |
'perspective' | Perspective view (default) |
'view', V | Specify view V='x', 'y', 'top' or [az el] for side elevations, plan view, or general view by azimuth and elevation angle. |
'top' | View from the top. |
'[no]shading' | Enable Gouraud shading (default true) |
'lightpos', L | Position of the light source (default [0 0 20]) |
'[no]name' | Display the robot's name |
'[no]wrist' | Enable display of wrist coordinate frame |
'xyz' | Wrist axis label is XYZ |
'noa' | Wrist axis label is NOA |
'[no]arrow' | Display wrist frame with 3D arrows |
'[no]tiles' | Enable tiled floor (default true) |
'tilesize', S | Side length of square tiles on the floor (default 0.2) |
'tile1color', C | Color of even tiles [r g b] (default [0.5 1 0.5] light green) |
'tile2color', C | Color of odd tiles [r g b] (default [1 1 1] white) |
'[no]shadow' | Enable display of shadow (default true) |
'shadowcolor', C | Colorspec of shadow, [r g b] |
'shadowwidth', W | Width of shadow line (default 6) |
'[no]jaxes' | Enable display of joint axes (default false) |
'[no]jvec' | Enable display of joint axis vectors (default false) |
'[no]joints' | Enable display of joints |
'jointcolor', C | Colorspec for joint cylinders (default [0.7 0 0]) |
'jointcolor', C | Colorspec for joint cylinders (default [0.7 0 0]) |
'jointdiam', D | Diameter of joint cylinder in scale units (default 5) |
'linkcolor', C | Colorspec of links (default 'b') |
'[no]base' | Enable display of base 'pedestal' |
'basecolor', C | Color of base (default 'k') |
'basewidth', W | Width of base (default 3) |
The options come from 3 sources and are processed in order:
Many boolean options can be enabled or disabled with the 'no' prefix. The various option sources can toggle an option, the last value encountered is used.
The robot is displayed as a basic stick figure robot with annotations such as:
which are controlled by options.
The size of the annotations is determined using a simple heuristic from the workspace dimensions. This dimension can be changed by setting the multiplicative scale factor using the 'mag' option.
Compound transforms
E1 + E2 is a sequence of two elementary transform.
Convert to string with symbolic variables
E.string is a string representation of the transform sequence where non-joint parameters have symbolic names L1, L2, L3 etc.
Show joint type structure
E.structure is a character array comprising the letters 'R' or 'P' that indicates the types of joints in the elementary transform sequence E.
Graphical teach pendant
Allow the user to "drive" a graphical robot using a graphical slider panel.
ETS.teach(options) adds a slider panel to a current ETS plot. If no graphical robot exists one is created in a new window.
ETS.teach(q, options) as above but the robot joint angles are set to q (1xN).
'eul' | Display tool orientation in Euler angles (default) |
'rpy' | Display tool orientation in roll/pitch/yaw angles |
'approach' | Display tool orientation as approach vector (z-axis) |
'[no]deg' | Display angles in degrees (default true) |
© 1990-2014 Peter Corke.