|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.kuka.roboticsAPI.geometricModel.math.AbstractRotation
com.kuka.roboticsAPI.geometricModel.math.Rotation
public final class Rotation
Immutable representation of a spatial rotation as Z-Y-X Euler angles and/or 3x3 rotation matrix.
Note: The angles α (alpha), β (beta), γ (gamma) are the same as the angles A, B, C in KUKA notation, respectively.
| Field Summary | |
|---|---|
static Rotation |
NONE
Immutable Rotation instance representing no rotation. |
| Method Summary | |
|---|---|
Rotation |
compose(IRotation other)
If the rotations A and B are represented as matrices, then the effect of A.compose(B) is corresponding to the matrix multiplication A*B. |
boolean |
equals(Object obj)
|
double |
getAlphaRad()
Returns the α (alpha) angle of the rotation in [rad]. |
double |
getBetaRad()
Returns the β (beta) angle of the rotation in [rad]. |
double |
getGammaRad()
Returns the γ (gamma) angle of the rotation in [rad]. |
Matrix |
getMatrix()
Returns a matrix representing this rotation. |
Vector |
getUnitVectorX()
Returns the x unit vector after it has been rotated by this rotation. |
Vector |
getUnitVectorY()
Returns the y unit vector after it has been rotated by this rotation. |
Vector |
getUnitVectorZ()
Returns the z unit vector after it has been rotated by this rotation. |
int |
hashCode()
|
Rotation |
invert()
Returns an inverted rotation, i.e. a rotation that reverses the effect of this one. |
static Rotation |
of(IRotation orig)
Returns an immutable Rotation instance from the values of the
provided rotation. |
static Rotation |
of(Matrix matrix)
Checked creation of a Rotation from a given rotation matrix. |
static Rotation |
ofRad(double alpha,
double beta,
double gamma)
Returns an immutable Rotation instance with the given angle
values. |
static Rotation |
ofUnchecked(Matrix matrix)
Unchecked creation of a Rotation from a given rotation matrix. |
Rotation |
rotationTo(IRotation other)
Calculates the rotation needed to turn this rotation into the other rotation. |
String |
toString()
Returns a textual description of the rotation. |
Rotation |
withAlphaRad(double value)
Returns a new instance (copy) of the rotation, with the α (alpha) angle replaced by the new value. |
Rotation |
withBetaRad(double value)
Returns a new instance (copy) of the rotation, with the β (beta) angle replaced by the new value. |
Rotation |
withGammaRad(double value)
Returns a new instance (copy) of the rotation, with the γ (gamma) angle replaced by the new value. |
| Methods inherited from class com.kuka.roboticsAPI.geometricModel.math.AbstractRotation |
|---|
applyTo, applyTo, rotationalDistanceTo |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final Rotation NONE
Rotation instance representing no rotation.
| Method Detail |
|---|
public static Rotation ofRad(double alpha,
double beta,
double gamma)
Rotation instance with the given angle
values.
alpha - the α (alpha) angle of the rotation in [rad]. Note: This
is the same as the angle A in KUKA notation.beta - the β (beta) angle of the rotation in [rad]. Note: This
is the same as the angle B in KUKA notation.gamma - the γ (gamma) angle of the rotation in [rad]. Note: This
is the same as the angle C in KUKA notation.
public static Rotation of(Matrix matrix)
Rotation from a given rotation matrix. The
matrix must be a rotation matrix, i.e. it must fulfill the following
conditions:
equal(matrix.determinant(), 1, epsilon);
equal(matrix.transpose(), matrix.invert(), epsilon);
where equal(a, b, epsilon) is an element-wise test of approximate
equality (small epsilon test).
The above conditions will be checked upon creation of the rotation.
matrix - a rotation matrix. Will be checked.
IllegalArgumentException - if the matrix is null or not a rotation matrixpublic static Rotation ofUnchecked(Matrix matrix)
Rotation from a given rotation matrix.
The matrix must be a rotation matrix, i.e. it must fulfill the following
conditions:
equal(matrix.determinant(), 1, epsilon);
equal(matrix.transpose(), matrix.invert(), epsilon);
where equal(a, b, epsilon) is an element-wise test of approximate
equality (small epsilon test).
Caution: Don't use this method unless you are absolutely sure that
the matrix is a valid rotation matrix! If in doubt, use
of(Matrix).
matrix - a rotation matrix. Will be checked if (and only if) assertions
are enabled in the VM.
IllegalArgumentException - if matrix is nullpublic static Rotation of(IRotation orig)
Rotation instance from the values of the
provided rotation.
orig - the instance from which to take over the rotation
IllegalArgumentException - if orig is nullpublic Matrix getMatrix()
IRotation
getMatrix in interface IRotationgetMatrix in class AbstractRotationMatrix representing this rotation. This is potentially
a costly conversionpublic Rotation compose(IRotation other)
IRotation
compose in interface IRotationcompose in class AbstractRotationother - the rotation to combine with this one
public Rotation invert()
IRotation
invert in interface IRotationinvert in class AbstractRotationpublic Rotation rotationTo(IRotation other)
IRotation
rot1.compose(rot1.rotationTo(rot2)) is equal to rot2
rotationTo in interface IRotationrotationTo in class AbstractRotationother - another rotation
public double getAlphaRad()
Note: This is the same as the angle A in KUKA notation.
public double getBetaRad()
Note: This is the same as the angle B in KUKA notation.
public double getGammaRad()
Note: This is the same as the angle C in KUKA notation.
public Rotation withAlphaRad(double value)
value - the α (alpha) angle of the rotation in [rad]. Note: This
is the same as the angle A in KUKA notation.
public Rotation withBetaRad(double value)
value - the β (beta) angle of the rotation in [rad]. Note: This
is the same as the angle B in KUKA notation.
public Rotation withGammaRad(double value)
value - the γ (gamma) angle of the rotation in [rad]. Note: This
is the same as the angle C in KUKA notation.
public Vector getUnitVectorX()
getUnitVectorY(),
getUnitVectorZ()public Vector getUnitVectorY()
getUnitVectorX(),
getUnitVectorZ()public Vector getUnitVectorZ()
getUnitVectorX(),
getUnitVectorY()public int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Objectpublic String toString()
AbstractRotationThis implementation will return a description in Euler Z-Y-X angles in [rad] with KUKA notation (A, B, C). The following string can be regarded as typical:
"[A=1.23 B=3.14 C=-0.13]"
toString in class AbstractRotation
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||