Package org.robwork.sdurw
Class Rotation3Dd
- java.lang.Object
-
- org.robwork.sdurw.Rotation3Dd
-
public class Rotation3Dd extends java.lang.ObjectA 3x3 rotation matrix \mathbf{R}\in SO(3)
\mathbf{R}= \left[ \begin{array}{ccc} {}^A\hat{X}_B {}^A\hat{Y}_B {}^A\hat{Z}_B \end{array} \right] = \left[ \begin{array}{ccc} r_{11} r_{12} r_{13} \\ r_{21} r_{22} r_{23} \\ r_{31} r_{32} r_{33} \end{array} \right]
-
-
Constructor Summary
Constructors Constructor Description Rotation3Dd()A rotation matrix with uninitialized storage.Rotation3Dd(double v0, double v1, double v2, double v3, double v4, double v5, double v6, double v7, double v8)Constructs an initialized 3x3 rotation matrix
\mathbf{R} = \left[ \begin{array}{ccc} r_{11} r_{12} r_{13} \\ r_{21} r_{22} r_{23} \\ r_{31} r_{32} r_{33} \end{array} \right]Rotation3Dd(long cPtr, boolean cMemoryOwn)Rotation3Dd(Rotation3Dd R)Rotation3Dd(Vector3Dd i, Vector3Dd j, Vector3Dd k)Constructs an initialized 3x3 rotation matrix
\robabx{a}{b}{\mathbf{R}} = \left[ \begin{array}{ccc} \robabx{a}{b}{\mathbf{i}} \robabx{a}{b}{\mathbf{j}} \robabx{a}{b}{\mathbf{k}} \end{array} \right]
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddelete()EigenMatrix3de()Returns a Eigen 3x3 matrix \mathbf{M}\in SO(3) that represents this rotation
booleanequal(Rotation3Dd rot, double precision)Compares rotations with a given precision
Performs an element wise comparison.booleanequals(Rotation3Dd rhs)Comparison operator.
The comparison operator makes a element wise comparison.
Returns true only if all elements are equal.
doubleget(long row, long column)Vector3DdgetCol(long i)Returns the i'th column of the rotation matrixstatic longgetCPtr(Rotation3Dd obj)Vector3DdgetRow(long i)Returns the i'th row of the rotation matrix
static Rotation3Ddidentity()Constructs a 3x3 rotation matrix set to identityRotation3Ddinverse()Calculate the inverse.
Note: This function changes the object that it is invoked on, but this is about x5 faster
than rot = inverse( rot )
Note: see inverse(const rw::math::Rotation3D< T > &) for the (slower) version that does not change the
rotation object itself.booleanisProperRotation()Verify that this rotation is a proper rotation
booleanisProperRotation(double precision)Verify that this rotation is a proper rotation
EAAdmultiply(EAAd bTKc)InertiaMatrixdmultiply(InertiaMatrixd bRc)static Rotation3Ddmultiply(Rotation3Dd aRb, Rotation3Dd bRc)Calculates \robabx{a}{c}{\mathbf{R}} = \robabx{a}{b}{\mathbf{R}} \robabx{b}{c}{\mathbf{R}}
static voidmultiply(Rotation3Dd a, Rotation3Dd b, Rotation3Dd result)Write to result the product a * b.static Vector3Ddmultiply(Rotation3Dd aRb, Vector3Dd bVc)Calculates \robabx{a}{c}{\mathbf{v}} = \robabx{a}{b}{\mathbf{R}} \robabx{b}{c}{\mathbf{v}}
static voidmultiply(Rotation3Dd a, Vector3Dd b, Vector3Dd result)Write to result the product a * b.voidnormalize()Normalizes the rotation matrix to satisfy SO(3).
Makes a normalization of the rotation matrix such that the columns
are normalized and othogonal s.t.voidset(long row, long column, double d)static Rotation3Ddskew(Vector3Dd v)Creates a skew symmetric matrix from a Vector3D.java.lang.StringtoString()
-
-
-
Constructor Detail
-
Rotation3Dd
public Rotation3Dd(long cPtr, boolean cMemoryOwn)
-
Rotation3Dd
public Rotation3Dd()
A rotation matrix with uninitialized storage.
-
Rotation3Dd
public Rotation3Dd(double v0, double v1, double v2, double v3, double v4, double v5, double v6, double v7, double v8)Constructs an initialized 3x3 rotation matrix
\mathbf{R} = \left[ \begin{array}{ccc} r_{11} r_{12} r_{13} \\ r_{21} r_{22} r_{23} \\ r_{31} r_{32} r_{33} \end{array} \right]
-
Rotation3Dd
public Rotation3Dd(Vector3Dd i, Vector3Dd j, Vector3Dd k)
Constructs an initialized 3x3 rotation matrix
\robabx{a}{b}{\mathbf{R}} = \left[ \begin{array}{ccc} \robabx{a}{b}{\mathbf{i}} \robabx{a}{b}{\mathbf{j}} \robabx{a}{b}{\mathbf{k}} \end{array} \right]
- Parameters:
i- \robabx{a}{b}{\mathbf{i}}j- \robabx{a}{b}{\mathbf{j}}k- \robabx{a}{b}{\mathbf{k}}
-
Rotation3Dd
public Rotation3Dd(Rotation3Dd R)
-
-
Method Detail
-
getCPtr
public static long getCPtr(Rotation3Dd obj)
-
delete
public void delete()
-
identity
public static Rotation3Dd identity()
Constructs a 3x3 rotation matrix set to identity- Returns:
- a 3x3 identity rotation matrix
\mathbf{R} = \left[ \begin{array}{ccc} 1 0 0 \\ 0 1 0 \\ 0 0 1 \end{array} \right]
-
normalize
public void normalize()
Normalizes the rotation matrix to satisfy SO(3).
Makes a normalization of the rotation matrix such that the columns
are normalized and othogonal s.t. it belongs to SO(3).
-
getRow
public Vector3Dd getRow(long i)
Returns the i'th row of the rotation matrix
- Parameters:
i- [in] Index of the row to return. Only valid indices are 0, 1 and 2.
-
getCol
public Vector3Dd getCol(long i)
Returns the i'th column of the rotation matrix- Parameters:
i- [in] Index of the column to return. Only valid indices are 0, 1 and 2.
-
equals
public boolean equals(Rotation3Dd rhs)
Comparison operator.
The comparison operator makes a element wise comparison.
Returns true only if all elements are equal.
- Parameters:
rhs- [in] Rotation to compare with- Returns:
- True if equal.
-
equal
public boolean equal(Rotation3Dd rot, double precision)
Compares rotations with a given precision
Performs an element wise comparison. Two elements are considered equal if the difference
are less than precision.
- Parameters:
rot- [in] Rotation to compare withprecision- [in] The precision to use for testing
- Returns:
- True if all elements are less than precision apart.
-
isProperRotation
public boolean isProperRotation()
Verify that this rotation is a proper rotation
- Returns:
- True if this rotation is considered a proper rotation
-
isProperRotation
public boolean isProperRotation(double precision)
Verify that this rotation is a proper rotation
- Returns:
- True if this rotation is considered a proper rotation
-
e
public EigenMatrix3d e()
Returns a Eigen 3x3 matrix \mathbf{M}\in SO(3) that represents this rotation
- Returns:
- \mathbf{M}\in SO(3)
-
skew
public static Rotation3Dd skew(Vector3Dd v)
Creates a skew symmetric matrix from a Vector3D. Also
known as the cross product matrix of v.
- Parameters:
v- [in] vector to create Skew matrix from
-
multiply
public static void multiply(Rotation3Dd a, Rotation3Dd b, Rotation3Dd result)
Write to result the product a * b.
-
multiply
public static void multiply(Rotation3Dd a, Vector3Dd b, Vector3Dd result)
Write to result the product a * b.
-
multiply
public static Rotation3Dd multiply(Rotation3Dd aRb, Rotation3Dd bRc)
Calculates \robabx{a}{c}{\mathbf{R}} = \robabx{a}{b}{\mathbf{R}} \robabx{b}{c}{\mathbf{R}}
- Parameters:
aRb- [in] \robabx{a}{b}{\mathbf{R}}
bRc- [in] \robabx{b}{c}{\mathbf{R}}
- Returns:
- \robabx{a}{c}{\mathbf{R}}
-
multiply
public static Vector3Dd multiply(Rotation3Dd aRb, Vector3Dd bVc)
Calculates \robabx{a}{c}{\mathbf{v}} = \robabx{a}{b}{\mathbf{R}} \robabx{b}{c}{\mathbf{v}}
- Parameters:
aRb- [in] \robabx{a}{b}{\mathbf{R}}bVc- [in] \robabx{b}{c}{\mathbf{v}}- Returns:
- \robabx{a}{c}{\mathbf{v}}
-
inverse
public Rotation3Dd inverse()
Calculate the inverse.
Note: This function changes the object that it is invoked on, but this is about x5 faster
than rot = inverse( rot )
Note: see inverse(const rw::math::Rotation3D< T > &) for the (slower) version that does not change the
rotation object itself.- Returns:
- the inverse rotation.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
get
public double get(long row, long column)
-
set
public void set(long row, long column, double d)
-
multiply
public InertiaMatrixd multiply(InertiaMatrixd bRc)
-
-