M-File Help: SO3 View code for SO3

SO3

Representation of 3D rotation

This subclasss of RTBPose is an object that represents an SO(3) rotation

Constructor methods

SO3 general constructor
SO3.exp exponentiate an so(3) matrix
SO3.angvec rotation about vector
SO3.eul rotation defined by Euler angles
SO3.oa rotation defined by o- and a-vectors
SO3.rpy rotation defined by roll-pitch-yaw angles
SO3.Rx rotation about x-axis
SO3.Ry rotation about y-axis
SO3.Rz rotation about z-axis
SO3.rand random orientation
new new SO3 object

Information and test methods

dim* returns 3
isSE* returns false
issym* true if rotation matrix has symbolic elements

Display and print methods

plot* graphically display coordinate frame for pose
animate* graphically animate coordinate frame for pose
print* 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

Operation methods

det determinant of matrix component
eig eigenvalues of matrix component
log logarithm of rotation matrix
inv inverse
simplify* apply symbolic simplication to all elements
interp interpolate between rotations

Conversion methods

SO3.check convert object or matrix to SO3 object
theta return rotation angle
double convert to rotation matrix
R convert to rotation matrix
SE3 convert to SE3 object with zero translation
T convert to homogeneous transformation matrix with zero translation
UnitQuaternion convert to UnitQuaternion object
toangvec convert to rotation about vector form
toeul convert to Euler angles
torpy convert to roll-pitch-yaw angles

Compatibility methods

isrot* returns true
ishomog* returns false
trprint* print single line representation
trplot* plot coordinate frame
tranimate* animate coordinate frame
tr2eul convert to Euler angles
tr2rpy convert to roll-pitch-yaw angles
trnorm normalize the rotation matrix

Static methods

check convert object or matrix to SO2 object
exp exponentiate an so(3) matrix
isa check if matrix is 3x3
angvec rotation about vector
eul rotation defined by Euler angles
oa rotation defined by o- and a-vectors
rpy rotation defined by roll-pitch-yaw angles
Rx rotation about x-axis
Ry rotation about y-axis
Rz rotation about z-axis

* means inherited from RTBPose

Operators

+ elementwise addition, result is a matrix
- elementwise subtraction, result is a matrix
* multiplication within group, also group x vector
.* multiplication within group followed by normalization
/ multiply by inverse
./ multiply by inverse followed by normalization
== test equality
~= test inequality

Properties

n normal (x) vector
o orientation (y) vector
a approach (z) vector

See also

SE2, SO2, SE3, RTBPose


SO3.SO3

Construct an SO(2) object

p = SO3() is an SO3 object representing null rotation.

p = SO3(R) is an SO3 object formed from the rotation matrix R (3x3)

p = SO3(T) is an SO3 object formed from the rotational part of the homogeneous transformation matrix T (4x4)

P = SO3(Q) is an SO3 object that is a copy of the SO3 object Q. %

See also

SE3, SO2


SO3.angvec

Construct an SO(3) object from angle and axis vector

R = SO3.angvec(theta, v) is an orthonormal rotation matrix (3x3) equivalent to a rotation of theta about the vector v.

Notes

See also

SE3.angvec, eul2r, rpy2r, tr2angvec


SO3.check

Convert to SO3

q = SO3.check(x) is an SO3 object where x is SO3 object or 3x3 orthonormal rotation matrix.


SO3.det

Determinant of SO3 object

det(p) is the determinant of the SO3 object p and should always be +1.


SO3.eig

Eigenvalues and eigenvectors

E = eig(p) is a column vector containing the eigenvalues of the the rotation matrix of the SO3 object p.

[v,d] = eig(p) produces a diagonal matrix d of eigenvalues and a full matrix v whose columns are the corresponding eigenvectors so that A*v = v*d.

See also

eig


SO3.eul

Construct an SO(3) object from Euler angles

p = SO3.eul(phi, theta, psi, options) is an SO3 object equivalent to the specified Euler angles. These correspond to rotations about the Z, Y, Z axes respectively. If phi, theta, psi are column vectors (Nx1) then they are assumed to represent a trajectory then p is a vector (1xN) of SO3 objects.

R = SO3.eul(eul, options) as above but the Euler angles are taken from consecutive columns of the passed matrix eul = [phi theta psi]. If eul is a matrix (Nx3) then they are assumed to represent a trajectory then p is a vector (1xN) of SO3 objects.

Options

'deg' Compute angles in degrees (radians default)

Note

See also

SO3.rpy, SE3.eul, eul2tr, rpy2tr, tr2eul


SO3.exp

Construct SO3 object from Lie algebra

p = SO3.exp(so2) creates an SO3 object by exponentiating the se(2) argument (2x2).


SO3.get.a

Get approach vector

P.a is the approach vector (3x1), the third column of the rotation matrix, which is the z-axis unit vector.

See also

SO3.n, SO3.o


SO3.get.n

Get normal vector

P.n is the normal vector (3x1), the first column of the rotation matrix, which is the x-axis unit vector.

See also

SO3.o, SO3.a


SO3.get.o

Get orientation vector

P.o is the orientation vector (3x1), the second column of the rotation matrix, which is the y-axis unit vector..

See also

SO3.n, SO3.a


SO3.interp

Interpolate between SO3 objects

P1.interp(p2, s) is an SO3 object representing a slerp interpolation between rotations represented by SO3 objects P1 and p2. s varies from 0 (P1) to 1 (p2). If s is a vector (1xN) then the result will be a vector of SO3 objects.

P1.interp(p2,n) as above but returns a vector (1xN) of SO3 objects interpolated between P1 and p2 in n steps.

Notes

See also

UnitQuaternion


SO3.inv

Inverse of SO3 object

q = inv(p) is the inverse of the SO3 object p. p*q will be the identity matrix.

Notes


SO3.isa

Test if a rotation matrix

SO3.ISA(R) is true (1) if the argument is of dimension 3x3 or 3x3xN, else false (0).

SO3.ISA(R, 'valid') as above, but also checks the validity of the rotation matrix.

Notes

See also

SE3.ISA, SE2.ISA, SO2.ISA


SO3.log

Lie algebra

se2 = P.log() is the Lie algebra augmented skew-symmetric matrix (3x3) corresponding to the SE2 object P.

See also

SE2.Twist, trlog


SO3.new

Construct a new object of the same type

p2 = P.new(x) creates a new object of the same type as P, by invoking the SO3 constructor on the matrix x (3x3).

p2 = P.new() as above but defines a null rotation.

Notes

See also

SE3.new, SO2.new, SE2.new


SO3.oa

Construct an SO(3) object from orientation and approach vectors

p = SO3.oa(o, a) is an SO3 object for the specified orientation and approach vectors (3x1) formed from 3 vectors such that R = [N o a] and N = o x a.

Notes

References

See also

rpy2r, eul2r, oa2tr, SE3.oa


SO3.R

Get rotation matrix

R = P.R() is the rotation matrix (3x3) associated with the SO3 object P. If P is a vector (1xN) then R (3x3xN) is a stack of rotation matrices, with the third dimension corresponding to the index of P.

See also

SO3.T


SO3.rand

Construct a random SO(3) object

SO3.rand() is an SO3 object with a uniform random RPY/ZYX orientation. Random numbers are in the interval 0 to 1.

See also

rand


SO3.rdivide

Compound SO3 object with inverse and normalize

P./Q is the composition, or matrix multiplication of SO3 object P by the inverse of SO3 object Q. If either of P or Q are vectors, then the result is a vector where each element is the product of the object scalar and the corresponding element in the object vector. If both P and Q are vectors they must be of the same length, and the result is the elementwise product of the two vectors.

See also

SO3.mrdivide, SO3.times, trnorm


SO3.rpy

Construct an SO(3) object from roll-pitch-yaw angles

p = SO3.rpy(roll, pitch, yaw, options) is an SO3 object equivalent to the specified roll, pitch, yaw angles angles. These correspond to rotations about the Z, Y, X axes respectively. If roll, pitch, yaw are column vectors (Nx1) then they are assumed to represent a trajectory then p is a vector (1xN) of SO3 objects.

p = SO3.rpy(rpy, options) as above but the roll, pitch, yaw angles angles angles are taken from consecutive columns of the passed matrix rpy = [roll, pitch, yaw]. If rpy is a matrix (Nx3) then they are assumed to represent a trajectory and p is a vector (1xN) of SO3 objects.

Options

'deg' Compute angles in degrees (radians default)
'xyz' Rotations about X, Y, Z axes (for a robot gripper)
'yxz' Rotations about Y, X, Z axes (for a camera)

See also

SO3.eul, SE3.rpy, tr2rpy, eul2tr


SO3.Rx

Rotation about X axis

p = SO3.Rx(theta) is an SO3 object representing a rotation of theta radians about the x-axis.

p = SO3.Rx(theta, 'deg') as above but theta is in degrees.

See also

SO3.Ry, SO3.Rz, rotx


SO3.Ry

Rotation about Y axis

p = SO3.Ry(theta) is an SO3 object representing a rotation of theta radians about the y-axis.

p = SO3.Ry(theta, 'deg') as above but theta is in degrees.

See also

SO3.Rx, SO3.Rz, roty


SO3.Rz

Rotation about Z axis

p = SO3.Rz(theta) is an SO3 object representing a rotation of theta radians about the z-axis.

p = SO3.Rz(theta, 'deg') as above but theta is in degrees.

See also

SO3.Rx, SO3.Ry, rotz


SO3.SE3

Convert to SEe object

q = P.SE3() is an SE3 object with a rotational component given by the SO3 object P, and with a zero translational component.

See also

SE3


SO3.T

Get homogeneous transformation matrix

T = P.T() is the homogeneous transformation matrix (4x4) associated with the SO3 object P, and has zero translational component. If P is a vector (1xN) then T (4x4xN) is a stack of rotation matrices, with the third dimension corresponding to the index of P.

See also

SO3.T


SO3.times

Compound SO3 objects and normalize

R = P.*Q is an SO3 object representing the composition of the two rotations described by the SO3 objects P and Q, which is matrix multiplication of their orthonormal rotation matrices followed by normalization.

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).

See also

RTBPose.mtimes, SO3.divide, trnorm


SO3.toangvec

Convert to angle-vector form

[theta,v] = P.toangvec(options) is rotation expressed in terms of an angle theta (1x1) about the axis v (1x3) equivalent to the rotational part of the SO3 object P.

If P is a vector (1xN) then theta (Kx1) is a vector of angles for corresponding elements of the vector and v (Kx3) are the corresponding axes, one per row.

Options

'deg' Return angle in degrees

Notes

See also

angvec2r, angvec2tr, trlog


SO3.toeul

Convert to Euler angles

eul = P.toeul(options) are the ZYZ Euler angles (1x3) corresponding to the rotational part of the SO3 object P. The 3 angles eul=[PHI,THETA,PSI] correspond to sequential rotations about the Z, Y and Z axes respectively.

If P is a vector (1xN) then each row of eul corresponds to an element of the vector.

Options

'deg' Compute angles in degrees (radians default)
'flip' Choose first Euler angle to be in quadrant 2 or 3.

Notes

See also

SO3.torpy, eul2tr, tr2rpy


SO3.torpy

Convert to roll-pitch-yaw angles

rpy = P.torpy(options) are the roll-pitch-yaw angles (1x3) corresponding to the rotational part of the SO3 object P. The 3 angles rpy=[R,P,Y] correspond to sequential rotations about the Z, Y and X axes respectively.

If P is a vector (1xN) then each row of rpy corresponds to an element of the vector.

Options

'deg' Compute angles in degrees (radians default)
'xyz' Return solution for sequential rotations about X, Y, Z axes
'yxz' Return solution for sequential rotations about Y, X, Z axes

Notes

See also

SO3.toeul, rpy2tr, tr2eul


SO3.tr2eul

Convert to Euler angles (compatibility)

rpy = P.tr2eul(options) is a vector (1x3) of ZYZ Euler angles equivalent to the rotation P (SO3 object).

Notes

See also

tr2eul


SO3.tr2rpy

Convert to RPY angles (compatibility)

rpy = P.tr2rpy(options) is a vector (1x3) of roll-pitch-yaw angles equivalent to the rotation P (SO3 object).

Notes

See also

tr2rpy


SO3.trnorm

Normalize rotation (compatibility)

R = P.trnorm() is an SO3 object equivalent to P but normalized (guaranteed to be orthogonal).

Notes

See also

trnorm


SO3.UnitQuaternion

Convert to UnitQuaternion object

q = P.UnitQuaternion() is a UnitQuaternion object equivalent to the rotation described by the SO3 object P.

See also

UnitQuaternion


 

© 1990-2014 Peter Corke.