|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.kuka.math.geometry.AbstractTransformation
com.kuka.math.geometry.MatrixTransformation
public final class MatrixTransformation
Immutable implementation of a spatial transformation in matrix form, that is the rotation part and the vector part of the homogeneous transformation matrix.
The Robotics API always assumes the translation part to be given in [mm].
| Field Summary | |
|---|---|
static MatrixTransformation |
IDENTITY
Immutable MatrixTransformation instance representing identity (i.e. unchanging) transformation. |
| Method Summary | |
|---|---|
MatrixTransformation |
compose(MatrixTransformation other)
The effect of A.compose(B) is that of the matrix multiplication A*B. |
boolean |
equals(Object obj)
|
void |
fillRowFirstArray(double[] elements)
Fills a "RowFirst" representation (double[3,4]) Array "Frame34" - represented as 12 element vector. |
MatrixRotation |
getRotation()
Returns the rotation corresponding to this transformation. |
Matrix |
getRotationMatrix()
Returns the rotational part of the transformation as a 3x3 matrix. |
Vector3D |
getTranslation()
Returns the translation part of the transformation, i.e. the upper-right 3x1 part of the corresponding homogeneous transformation matrix. |
double |
getX()
Returns the x element of the translation part of the transformation. |
double |
getY()
Returns the y element of the translation part of the transformation. |
double |
getZ()
Returns the z element of the translation part of the transformation. |
int |
hashCode()
|
MatrixTransformation |
invert()
Returns an inverted transformation, i.e. a transformation that reverses the effect of this one. |
static MatrixTransformation |
of(double x,
double y,
double z)
Returns an immutable MatrixTransformation instance, consisting of a translational part and no rotation. |
static MatrixTransformation |
of(ITransformation orig)
Returns an immutable MatrixTransformation instance with the same value as the given transformation. |
static MatrixTransformation |
of(Vector3D translation)
Returns an immutable MatrixTransformation instance, consisting of a translational part and no rotation. |
static MatrixTransformation |
of(Vector3D translation,
IRotation rot)
Returns an immutable MatrixTransformation instance, consisting of a rotational and a translational part. |
static MatrixTransformation |
of(Vector3D translation,
Matrix rotMatrix)
Returns an immutable MatrixTransformation instance, consisting of a rotational and a translational part. |
static MatrixTransformation |
ofRowFirst(double... elements)
Creates a Matrix Transform based on a "row first" matrix 3x4 -> 12 Elements... |
double[] |
toRowFirstArray()
Serialization Support Serialize the MatrixTransform to a linear 12 Vector to support "rowFirstArray" (double[3][4]) Frame34 representations. |
String |
toString()
Returns the transformation value as a homogeneous 4x4 matrix formatted in a way compatible with popular scientific numerical computing applications. |
String |
toString(NumberFormat fmt)
Returns the transformation value as a homogeneous 4x4 matrix formatted in a way similar to popular scientific numerical computing applications. |
MatrixTransformation |
withRotation(Matrix rotMatrix)
Returns an immutable MatrixTransformation instance, consisting of a rotational and a translational part. |
MatrixTransformation |
withRotation(MatrixRotation rotation)
Returns an immutable MatrixTransformation instance, consisting of a rotational and a translational part. |
MatrixTransformation |
withTranslation(Vector3D translation)
Returns a new instance (copy) of the transformation, with the translational part replaced by the given translation. |
| Methods inherited from class com.kuka.math.geometry.AbstractTransformation |
|---|
applyTo, applyTo, compose, distanceTo, rotationalDistanceTo, transformationTo, withRotation |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final MatrixTransformation IDENTITY
MatrixTransformation instance representing identity (i.e. unchanging) transformation.
| Method Detail |
|---|
public static MatrixTransformation of(Vector3D translation,
Matrix rotMatrix)
MatrixTransformation instance, consisting of a rotational and a translational part.
translation - the translational part of the transformation (the upper-right 3x1 part of a homogeneous transformation
matrix).rotMatrix - the rotational part of the transformation (the upper-left 3x3 part of a homogeneous transformation
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 epsilon used is 1e-3.
MatrixTransformation instance
public static MatrixTransformation of(Vector3D translation,
IRotation rot)
MatrixTransformation instance, consisting of a rotational and a translational part.
translation - the translational part of the transformation (the upper-right 3x1 part of a homogeneous transformation
matrix).rot - the rotational part of the transformation (the upper-left 3x3 part of a homogeneous transformation
matrix).
MatrixTransformation instancepublic static MatrixTransformation of(Vector3D translation)
MatrixTransformation instance, consisting of a translational part and no rotation.
translation - the translational part of the transformation (the upper-right 3x1 part of a homogeneous transformation
matrix).
MatrixTransformation instance
public static MatrixTransformation of(double x,
double y,
double z)
MatrixTransformation instance, consisting of a translational part and no rotation.
The translation is given by the three cartesian vector elements x, y, z.
x - x element of translationy - y element of translationz - z element of translation
MatrixTransformation instancepublic static MatrixTransformation of(ITransformation orig)
MatrixTransformation instance with the same value as the given transformation. If
the given transformation already is of a known immutable type then it is returned unchanged.
orig - The transformation whose value should be taken over.
MatrixTransformation instance
IllegalArgumentException - if orig is nullpublic MatrixRotation getRotation()
ITransformation
getRotation in interface ITransformationgetRotation in class AbstractTransformationpublic Vector3D getTranslation()
ITransformation
getTranslation in interface ITransformationgetTranslation in class AbstractTransformationpublic MatrixTransformation withRotation(Matrix rotMatrix)
MatrixTransformation instance, consisting of a rotational and a translational part.
rotMatrix - the rotational part of the transformation (the upper-left 3x3 part of a homogeneous transformation
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 epsilon used is 1e-3.
MatrixTransformation instancepublic MatrixTransformation withRotation(MatrixRotation rotation)
MatrixTransformation instance, consisting of a rotational and a translational part.
rotation - the rotational part of the transformation (the upper-left 3x3 part of a homogeneous transformation
matrix).
MatrixTransformation instancepublic MatrixTransformation withTranslation(Vector3D translation)
AbstractTransformation
withTranslation in class AbstractTransformationtranslation - the translational part of the transformation (the upper-right
3x1 part of a homogeneous transformation matrix).
public double getX()
x element of the translation part of the transformation.
x element of the translation part of the transformationpublic double getY()
y element of the translation part of the transformation.
y element of the translation part of the transformationpublic double getZ()
z element of the translation part of the transformation.
z element of the translation part of the transformationpublic Matrix getRotationMatrix()
public MatrixTransformation compose(MatrixTransformation other)
other - the transformation to combine with this one
public MatrixTransformation invert()
ITransformation
invert in interface ITransformationinvert in class AbstractTransformationpublic int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Objectpublic static MatrixTransformation ofRowFirst(double... elements)
elements - a double Array (row major) with exactly 12 Elements of the sequence: [rot00, rot01, rot02, transX,
rot10, rot11, rot12, transY, rot20,rot21,rot22,transZ]
Note: Elements of the rotational part (the upper-left 3x3 part of a homogeneous transformation matrix) represent a rotational matrix, which 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 epsilon used is 1e-3.
public double[] toRowFirstArray()
public void fillRowFirstArray(double[] elements)
elements - - a double vector with exactly 12 Elements It will be filled with the elements of the transformation
in the following sequence: [rot00, rot01, rot02, transX, rot10, rot11, rot12, transY,
rot20,rot21,rot22,transZ]public String toString()
MathUtils.getDefaultNumberFormat().
The following string can be regarded as typical:
[[0.0 0.0 -1.0 10.0]; [0.0 -1.0 0.0 20.0]; [-1.0 0.0 0.0 30.0]; [0.0 0.0 0.0 1.0]]
toString in class AbstractTransformationpublic String toString(NumberFormat fmt)
NumberFormat.format(double) method of the given formatter.
Example: The following code snippet, used on a given MatrixTransformation trafo
NumberFormat fmt = NumberFormat.getNumberInstance(Locale.US); fmt.setMinimumFractionDigits(1); fmt.setMaximumFractionDigits(3); System.out.println(trafo.toString(fmt));might give the following output:
[[0.707 -0.707 0.0 10.0]; [0.707 0.707 0.0 -10.0]; [0.0 0.0 1.0 50.0]; [0.0 0.0 0.0 1.0]]
fmt - the NumberFormat used to format the number values
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||