8 #ifndef META_OCEAN_MATH_TOON_UTILITIES_H
9 #define META_OCEAN_MATH_TOON_UTILITIES_H
13 #include <TooN/TooN.h>
34 template <
typename TSource,
typename TTarget>
44 template <
typename TSource,
typename TTarget>
48 template <
typename TSource,
typename TTarget>
51 const auto& translation = toonSE.get_translation();
52 const auto& rotationMatrix = toonSE.get_rotation().get_matrix();
56 for (
unsigned int r = 0u; r < 3u; ++r)
58 for (
unsigned int c = 0u; c < 3u; ++c)
60 result(r, c) = TTarget(rotationMatrix(r, c));
64 result(0, 3) = TTarget(translation[0]);
65 result(1, 3) = TTarget(translation[1]);
66 result(2, 3) = TTarget(translation[2]);
71 template <
typename TSource,
typename TTarget>
74 TooN::Matrix<3, 3, TTarget> toonRotationMatrix;
76 for (
unsigned int r = 0u; r < 3u; ++r)
78 for (
unsigned int c = 0u; c < 3u; ++c)
80 toonRotationMatrix(r, c) = TTarget(matrix(r, c));
84 const TooN::Vector<3, TTarget> toonTranslationVector = TooN::makeVector<TTarget>(TTarget(matrix(0, 3)), TTarget(matrix(1, 3)), TTarget(matrix(2, 3)));
86 return TooN::SE3<TTarget>(TooN::SO3<TTarget>(toonRotationMatrix), toonTranslationVector);
This class implements a 4x4 homogeneous transformation matrix using floating point values with the pr...
Definition: HomogenousMatrix4.h:110
This class implements utilitiy functions for TooN.
Definition: ToonUtilities.h:24
static TooN::SE3< TTarget > toSE3(const HomogenousMatrixT4< TSource > &matrix)
Converts an Ocean HomogenousMatrix4 object to a TooN::SE3 object.
Definition: ToonUtilities.h:72
static HomogenousMatrixT4< TTarget > toHomogenousMatrix4(const TooN::SE3< TSource > &toonSE)
Converts a TooN::SE3 object to an Ocean HomogenousMatrix4 object.
Definition: ToonUtilities.h:49
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15