Rotation ParameterizationsΒΆ

Simple example of how to convert a rotation matrix into equivalent formats.

ExampleRotationParameterizations.java

 1   public static void main(String[] args) {
 2
 3       // Euler to rotation matrix
 4       DMatrixRMaj R = ConvertRotation3D_F64.eulerToMatrix(EulerType.XYZ,0.5,-1,-0.45,null);
 5
 6       // matrix to Rodrigues
 7       Rodrigues_F64 rod = ConvertRotation3D_F64.matrixToRodrigues(R,(Rodrigues_F64)null);
 8
 9       // Rodrigues to Quaternion
10       Quaternion_F64 quat = ConvertRotation3D_F64.rodriguesToQuaternion(rod,null);
11
12       // Quaternion to Rotation Matrix
13       DMatrixRMaj T = ConvertRotation3D_F64.quaternionToMatrix(quat,null);
14
15       // see if you get the same answer
16       R.print();
17       T.print();
18   }