M-File Help: RTBPose | View code for RTBPose |
Superclass for SO2, SO3, SE2, SE3
This abstract class provides common methods for the 2D and 3D orientation and pose classes: SO2, SE2, SO3 and SE3.
dim | dimension of the underlying matrix |
isSE | true for SE2 and SE3 |
issym | true if value is symbolic |
plot | graphically display coordinate frame for pose |
animate | graphically display coordinate frame for pose |
print the pose in single line format | |
display | print the pose in human readable matrix form |
char | convert to human readable matrix as a string |
double | convert to real rotation or homogeneous transformation matrix |
simplify | apply symbolic simplification to all elements |
vpa | apply vpa to all elements |
+ | elementwise addition, result is a matrix |
- | elementwise subtraction, result is a matrix |
* | multiplication within group, also SO3 x vector |
/ | multiplication within group by inverse |
== | test equality |
~= | test inequality |
A number of compatibility methods give the same behaviour as the classic RTB functions:
tr2rt | convert to rotation matrix and translation vector |
t2r | convert to rotation matrix |
trprint | print single line representation |
trprint2 | print single line representation |
trplot | plot coordinate frame |
trplot2 | plot coordinate frame |
tranimate | aimate coordinate frame |
Animate a coordinate frame
RTBPose.animate(p1, p2, options) animates a 3D coordinate frame moving from pose p1 to pose p2, which can be SO3 or SE3.
RTBPose.animate(p, options) animates a coordinate frame moving from the identity pose to the pose p represented by any of the types listed above.
RTBPose.animate(pv, options) animates a trajectory, where pv is a vector of SO2, SO3, SE2, SE3 objects.
Compatible with matrix function tranimate(T), tranimate(T1, T2).
'fps', fps | Number of frames per second to display (default 10) |
'nsteps', n | The number of steps along the path (default 50) |
'axis', A | Axis bounds [xmin, xmax, ymin, ymax, zmin, zmax] |
'movie', M | Save frames as files in the folder M |
'cleanup' | Remove the frame at end of animation |
'noxyz' | Don't label the axes |
'rgb' | Color the axes in the order x=red, y=green, z=blue |
'retain' | Retain frames, don't animate |
Additional options are passed through to TRPLOT.
Convert to string
s = P.char() is a string showing homogeneous transformation elements as a matrix.
Dimension
n = P.dim() is the dimension of the group object, 2 for SO2, 3 for SE2 and SO3, and 4 for SE3.
Display a pose
P.display() displays the pose.
Convert to matrix
T = P.double() is a matrix representation of the pose P, either a rotation matrix or a homogeneous transformation matrix.
If P is a vector (1xN) then T will be a 3-dimensional array (MxMxN).
Test if pose
P.isSE() is true if the object is of type SE2 or SE3.
Test if pose is symbolic
P.issym() is true if the pose has symbolic rather than real values.
Subtract poses
P1-P2 is the elementwise difference of the matrix elements of the two poses. The result is a matrix not the input class type since the result of subtraction is not in the group.
Compound SO2 object with inverse
R = P/Q is a pose object representing the composition of the pose object P by the inverse of the pose object Q, which is matrix multiplication of their equivalent matrices with the second one inverted.
If either, or both, of P or Q are vectors, then the result is a vector.
If P is a vector (1xN) then R is a vector (1xN) such that R(i) = P(i)/Q.
If Q is a vector (1xN) then R is a vector (1xN) such thatR(i) = P/Q(i).
If both P and Q are vectors (1xN) then R is a vector (1xN) such that R(i) = P(i)/R(i).
Compound pose objects
R = P*Q is a pose object representing the composition of the two poses described by the objects P and Q, which is multiplication of their equivalent matrices.
If either, or both, of P or Q are vectors, then the result is a vector.
If P is a vector (1xN) then R is a vector (1xN) such that R(i) = P(i)*Q.
If Q is a vector (1xN) then R is a vector (1xN) such thatR(i) = P*Q(i).
If both P and Q are vectors (1xN) then R is a vector (1xN) such that R(i) = P(i)*R(i).
W = P*V is a column vector (2x1) which is the transformation of the column vector V (2x1) by the rotation described by the SO2 object P. P can be a vector and/or V can be a matrix, a columnwise set of vectors.
If P is a vector (1xN) then W is a matrix (2xN) such that W(:,i) = P(i)*V.
If V is a matrix (2xN) V is a matrix (2xN) then W is a matrix (2xN) such that W(:,i) = P*V(:,i).
If P is a vector (1xN) and V is a matrix (2xN) then W is a matrix (2xN) such that W(:,i) = P(i)*V(:,i).
Draw a coordinate frame (compatibility)
trplot(p, options) draws a 3D coordinate frame represented by p which is SO2, SO3, SE2 or SE3.
Compatible with matrix function trplot(T).
Options are passed through to trplot or trplot2 depending on the object type.
Add poses
P1+P2 is the elementwise summation of the matrix elements of the two poses. The result is a matrix not the input class type since the result of addition is not in the group.
Compact display of pose
P.print(options) displays the homogoneous transform in a compact single-line format. If P is a vector then each element is printed on a separate line.
Options are passed through to trprint or trprint2 depending on the object type.
Symbolic simplification
p2 = P.simplify() applies symbolic simplification to each element of internal matrix representation of the pose.
Get rotation matrix (compatibility)
R = t2r(p) returns the rotation matrix corresponding to the pose p which is either SE2 or SE3.
Compatible with matrix function R = t2r(T)
Split rotational and translational components (compatibility)
[R,t] = tr2rt(p) returns the rotation matrix and translation vector corresponding to the pose p which is either SE2 or SE3.
Compatible with matrix function [R,t] = tr2rt(T)
Animate a coordinate frame (compatibility)
TRANIMATE(p1, p2, options) animates a 3D coordinate frame moving from pose p1 to pose p2, which can be SO2, SO3, SE2 or SE3.
TRANIMATE(p, options) animates a coordinate frame moving from the identity pose to the pose p represented by any of the types listed above.
TRANIMATE(pv, options) animates a trajectory, where pv is a vector of SO2, SO3, SE2, SE3 objects.
Compatible with matrix function tranimate(T), tranimate(T1, T2).
'fps', fps | Number of frames per second to display (default 10) |
'nsteps', n | The number of steps along the path (default 50) |
'axis', A | Axis bounds [xmin, xmax, ymin, ymax, zmin, zmax] |
'movie', M | Save frames as files in the folder M |
'cleanup' | Remove the frame at end of animation |
'noxyz' | Don't label the axes |
'rgb' | Color the axes in the order x=red, y=green, z=blue |
'retain' | Retain frames, don't animate |
Additional options are passed through to TRPLOT.
Draw a coordinate frame (compatibility)
trplot(p, options) draws a 3D coordinate frame represented by p which is SO2, SO3, SE2, SE3.
Compatible with matrix function trplot(T).
'handle', h | Update the specified handle |
'color', C | The color to draw the axes, MATLAB colorspec C |
'noaxes' | Don't display axes on the plot |
'axis', A | Set dimensions of the MATLAB axes to A=[xmin xmax ymin ymax zmin zmax] |
'frame', F | The coordinate frame is named {F} and the subscript on the axis labels is F. |
'framelabel', F | The coordinate frame is named {F}, axes have no subscripts. |
'text_opts', opt | A cell array of MATLAB text properties |
'axhandle', A | Draw in the MATLAB axes specified by the axis handle A |
'view', V | Set plot view parameters V=[az el] angles, or 'auto' for view toward origin of coordinate frame |
'length', s | Length of the coordinate frame arms (default 1) |
'arrow' | Use arrows rather than line segments for the axes |
'width', w | Width of arrow tips (default 1) |
'thick', t | Thickness of lines (default 0.5) |
'perspective' | Display the axes with perspective projection |
'3d' | Plot in 3D using anaglyph graphics |
'anaglyph', A | Specify anaglyph colors for '3d' as 2 characters for left and right (default colors 'rc'): chosen from r)ed, g)reen, b)lue, c)yan, m)agenta. |
'dispar', D | Disparity for 3d display (default 0.1) |
'text' | Enable display of X,Y,Z labels on the frame |
'labels', L | Label the X,Y,Z axes with the 1st, 2nd, 3rd character of the string L |
'rgb' | Display X,Y,Z axes in colors red, green, blue respectively |
'rviz' | Display chunky rviz style axes |
Draw a coordinate frame (compatibility)
trplot2(p, options) draws a 2D coordinate frame represented by p
Compatible with matrix function trplot2(T).
'handle', h | Update the specified handle |
'axis', A | Set dimensions of the MATLAB axes to A=[xmin xmax ymin ymax] |
'color', c | The color to draw the axes, MATLAB colorspec |
'noaxes' | Don't display axes on the plot |
'frame', F | The frame is named {F} and the subscript on the axis labels is F. |
'framelabel', F | The coordinate frame is named {F}, axes have no subscripts. |
'text_opts', opt | A cell array of Matlab text properties |
'axhandle', A | Draw in the MATLAB axes specified by A |
'view', V | Set plot view parameters V=[az el] angles, or 'auto' for view toward origin of coordinate frame |
'length', s | Length of the coordinate frame arms (default 1) |
'arrow' | Use arrows rather than line segments for the axes |
'width', w | Width of arrow tips |
Compact display of homogeneous transformation (compatibility)
trprint(p, options) displays the homogoneous transform in a compact single-line format. If p is a vector then each element is printed on a separate line.
Compatible with matrix function trprint(T).
'rpy' | display with rotation in roll/pitch/yaw angles (default) |
'euler' | display with rotation in ZYX Euler angles |
'angvec' | display with rotation in angle/vector format |
'radian' | display angle in radians (default is degrees) |
'fmt', f | use format string f for all numbers, (default %g) |
'label', l | display the text before the transform |
Compact display of homogeneous transformation (compatibility)
trprint2(p, options) displays the homogoneous transform in a compact single-line format. If p is a vector then each element is printed on a separate line.
Compatible with matrix function trprint2(T).
'radian' | display angle in radians (default is degrees) |
'fmt', f | use format string f for all numbers, (default %g) |
'label', l | display the text before the transform |
Variable precision arithmetic
p2 = P.vpa() numerically evaluates each element of internal matrix representation of the pose.
p2 = P.vpa(d) as above but with d decimal digit accuracy.
© 1990-2014 Peter Corke.