Ocean
Ocean::PoseT< T > Class Template Reference

This class implements a camera pose with six degrees of freedom (6-DOF). More...

Inheritance diagram for Ocean::PoseT< T >:

Public Member Functions

 PoseT ()
 Creates a new pose object with default values (no translation and no rotation). More...
 
template<typename U >
 PoseT (const PoseT< U > &pose)
 Copies a pose with different element data type than T. More...
 
 PoseT (const VectorT3< T > &translation)
 Creates a new pose object with a translation only. More...
 
 PoseT (const EulerT< T > &euler)
 Creates a new pose object with a rotation component on. More...
 
 PoseT (const QuaternionT< T > &quaternion)
 Creates a new pose object with a rotation component on. More...
 
 PoseT (const RotationT< T > &rotation)
 Creates a new pose object with a rotation component on. More...
 
 PoseT (const HomogenousMatrixT4< T > &transformation)
 Creates a new pose object by a specified 4x4 homogeneous transformation matrix. More...
 
 PoseT (const T *values)
 Creates a new pose by at least six pose values. More...
 
 PoseT (const T tx, const T ty, const T tz, const T rx, const T ry, const T rz)
 Creates a new pose by six pose parameters. More...
 
 PoseT (const VectorT3< T > &translation, const EulerT< T > &euler)
 Creates a new pose object. More...
 
 PoseT (const VectorT3< T > &translation, const QuaternionT< T > &quaternion)
 Creates a new pose object. More...
 
 PoseT (const VectorT3< T > &translation, const RotationT< T > &rotation)
 Creates a new pose object. More...
 
VectorT3< T > translation () const
 Returns the translation of this pose. More...
 
QuaternionT< T > orientation () const
 Returns the orientation of this pose. More...
 
HomogenousMatrixT4< T > transformation () const
 Returns the 4x4 homogeneous transformation matrix of this pose. More...
 
x () const
 Returns the translation value for the x-axis. More...
 
T & x ()
 Returns the translation value for the x-axis. More...
 
y () const
 Returns the translation value for the y-axis. More...
 
T & y ()
 Returns the translation value for the y-axis. More...
 
z () const
 Returns the translation value for the z-axis. More...
 
T & z ()
 Returns the translation value for the z-axis. More...
 
rx () const
 Returns the x parameter of the rotation. More...
 
T & rx ()
 Returns the x parameter of the rotation. More...
 
ry () const
 Returns the y parameter of the rotation. More...
 
T & ry ()
 Returns the y parameter of the rotation. More...
 
rz () const
 Returns the z parameter of the rotation. More...
 
T & rz ()
 Returns the z parameter of the rotation. More...
 
angle () const
 Returns the angle of the pose rotation. More...
 
bool isNull () const
 Returns whether this pose holds no translation and no rotation. More...
 
const T * data () const
 Data access operator. More...
 
T * data ()
 Data access operator. More...
 
bool operator== (const PoseT< T > &pose) const
 Returns whether two poses are identical up to a small epsilon. More...
 
bool operator!= (const PoseT< T > &pose) const
 Returns whether two poses are not identical up to a small epsilon. More...
 
PoseT< T > operator+ (const PoseT< T > &pose) const
 Returns a new pose created by the element wise sum of two poses. More...
 
PoseT< T > & operator+= (const PoseT< T > &pose)
 Adds element wise the six values of a second pose to this pose. More...
 
PoseT< T > operator- (const PoseT< T > &pose) const
 Returns a new pose created by the element wise subtraction of two poses. More...
 
PoseT< T > & operator-= (const PoseT< T > &pose)
 Subtracts element wise the six values of a second pose from this pose. More...
 
PoseT< T > operator* (const T value) const
 Multiplies this pose by a scalar value and returns the new result. More...
 
PoseT< T > & operator*= (const T value)
 Multiplies this pose by a scalar. More...
 
operator() (unsigned int index) const
 Element access operator. More...
 
T & operator() (unsigned int index)
 Element access operator. More...
 
operator[] (unsigned int index) const
 Element access operator. More...
 
T & operator[] (unsigned int index)
 Element access operator. More...
 
const T * operator() () const
 Access operator. More...
 
T * operator() ()
 Access operator. More...
 

Static Public Member Functions

static Indices32 representativePoses (const PosesT< T > &poses, const size_t subsetSize, const size_t explicitIndexOffset=0)
 Determines a subset of a set of given poses best representing the entire set of poses. More...
 
static Indices32 representativePoses (const HomogenousMatrixT4< T > *poseMatrices, const size_t size, const size_t subsetSize, const size_t explicitIndexOffset=0)
 Determines a subset of a set of given poses (defined as matrices) best representing the entire set of poses. More...
 
static HomogenousMatrixT4< T > linearPoseInterpolation (const HomogenousMatrixT4< T > &pose0, const HomogenousMatrixT4< T > &pose1, const T &factor)
 Interpolates two camera poses by a linear interpolation. More...
 

Protected Attributes

values_ [6]
 The six values of the pose, with element order: (Tx, Ty, Tz, Rx, Ry, Rz). More...
 

Detailed Description

template<typename T>
class Ocean::PoseT< T >

This class implements a camera pose with six degrees of freedom (6-DOF).

Three degrees for the translation or position and three for the orientation or rotation.
This object stores six elements. The first three elements define the translation.
The last three elements define the orientation as exponential map (rotation axis and angle as axis length).
The element order is defined as: (Tx, Ty, Tz, Rx, Ry, Rz).

Template Parameters
TThe scalar floating point data type to be used, either 'float' or 'double'

Constructor & Destructor Documentation

◆ PoseT() [1/12]

template<typename T >
Ocean::PoseT< T >::PoseT ( )

Creates a new pose object with default values (no translation and no rotation).

◆ PoseT() [2/12]

template<typename T >
template<typename U >
Ocean::PoseT< T >::PoseT ( const PoseT< U > &  pose)
inlineexplicit

Copies a pose with different element data type than T.

Parameters
poseThe pose object to be copied
Template Parameters
UThe element data type of the given pose

◆ PoseT() [3/12]

template<typename T >
Ocean::PoseT< T >::PoseT ( const VectorT3< T > &  translation)
explicit

Creates a new pose object with a translation only.

Parameters
translation3D vector defining the translation of the pose object

◆ PoseT() [4/12]

template<typename T >
Ocean::PoseT< T >::PoseT ( const EulerT< T > &  euler)
explicit

Creates a new pose object with a rotation component on.

Parameters
eulerThe Euler rotation defining the rotation of the pose object

◆ PoseT() [5/12]

template<typename T >
Ocean::PoseT< T >::PoseT ( const QuaternionT< T > &  quaternion)
explicit

Creates a new pose object with a rotation component on.

Parameters
quaternionUnit quaternion rotation defining the rotation of the pose object

◆ PoseT() [6/12]

template<typename T >
Ocean::PoseT< T >::PoseT ( const RotationT< T > &  rotation)
explicit

Creates a new pose object with a rotation component on.

Parameters
rotationAngle-axis rotation defining the rotation of the pose object

◆ PoseT() [7/12]

template<typename T >
Ocean::PoseT< T >::PoseT ( const HomogenousMatrixT4< T > &  transformation)
explicit

Creates a new pose object by a specified 4x4 homogeneous transformation matrix.

Parameters
transformationMatrix defining the position and rotation of the new pose

◆ PoseT() [8/12]

template<typename T >
Ocean::PoseT< T >::PoseT ( const T *  values)
explicit

Creates a new pose by at least six pose values.

The specified pose must have the following order: (Tx, Ty, Tz, Rx, Ry, Rz).
With (Tx, Ty, Tz) as translation vector, (Rx, Ry, Rz) as rotation axis and sqrt(Rx * Rx + Ry * Ry + Rz * Rz) as rotation angle.

Parameters
valuesThe six pose values specifying the new pose, must be valid

◆ PoseT() [9/12]

template<typename T >
Ocean::PoseT< T >::PoseT ( const T  tx,
const T  ty,
const T  tz,
const T  rx,
const T  ry,
const T  rz 
)

Creates a new pose by six pose parameters.

Parameters
txTranslation value for the x-axis
tyTranslation value for the y-axis
tzTranslation value for the z-axis
rxX parameter of the rotation
ryY parameter of the rotation
rzZ parameter of the rotation

◆ PoseT() [10/12]

template<typename T >
Ocean::PoseT< T >::PoseT ( const VectorT3< T > &  translation,
const EulerT< T > &  euler 
)

Creates a new pose object.

Parameters
translation3D vector defining the translation component of the pose object
eulerThe Euler rotation defining the rotation component of the pose object

◆ PoseT() [11/12]

template<typename T >
Ocean::PoseT< T >::PoseT ( const VectorT3< T > &  translation,
const QuaternionT< T > &  quaternion 
)

Creates a new pose object.

Parameters
translation3D vector defining the translation component of the pose object
quaternionUnit quaternion rotation defining the rotation component of the pose object

◆ PoseT() [12/12]

template<typename T >
Ocean::PoseT< T >::PoseT ( const VectorT3< T > &  translation,
const RotationT< T > &  rotation 
)

Creates a new pose object.

Parameters
translation3D vector defining the translation component of the pose object
rotationAngle-axis rotation defining the rotation component of the pose object

Member Function Documentation

◆ angle()

template<typename T >
T Ocean::PoseT< T >::angle ( ) const

Returns the angle of the pose rotation.

Returns
Rotation angle in radian

◆ data() [1/2]

template<typename T >
T * Ocean::PoseT< T >::data
inline

Data access operator.

Returns
Pointer to the internal elements.

◆ data() [2/2]

template<typename T >
const T * Ocean::PoseT< T >::data
inline

Data access operator.

Returns
Pointer to the internal elements.

◆ isNull()

template<typename T >
bool Ocean::PoseT< T >::isNull ( ) const

Returns whether this pose holds no translation and no rotation.

Returns
True, if so

◆ linearPoseInterpolation()

template<typename T >
static HomogenousMatrixT4<T> Ocean::PoseT< T >::linearPoseInterpolation ( const HomogenousMatrixT4< T > &  pose0,
const HomogenousMatrixT4< T > &  pose1,
const T &  factor 
)
static

Interpolates two camera poses by a linear interpolation.

Parameters
pose0The first camera pose
pose1The second camera pose
factorThe interpolation factor which is applied as follows: pose0 * (1 - factor) + pose1 * factor, with range [0, 1]
Returns
The resulting interpolated camera pose

◆ operator!=()

template<typename T >
bool Ocean::PoseT< T >::operator!= ( const PoseT< T > &  pose) const
inline

Returns whether two poses are not identical up to a small epsilon.

Parameters
poseRight pose to compare
Returns
True, if so

◆ operator()() [1/4]

template<typename T >
T * Ocean::PoseT< T >::operator()
inline

Access operator.

Returns
Pointer to the internal elements.

◆ operator()() [2/4]

template<typename T >
const T * Ocean::PoseT< T >::operator()
inline

Access operator.

Returns
Pointer to the internal elements.

◆ operator()() [3/4]

template<typename T >
T & Ocean::PoseT< T >::operator() ( unsigned int  index)
inline

Element access operator.

Beware: No range check will be done!

Parameters
indexThe index of the element to return, with range [0, 5]
Returns
Internal element

◆ operator()() [4/4]

template<typename T >
T Ocean::PoseT< T >::operator() ( unsigned int  index) const
inline

Element access operator.

Beware: No range check will be done!

Parameters
indexThe index of the element to return, with range [0, 5]
Returns
Internal element

◆ operator*()

template<typename T >
PoseT<T> Ocean::PoseT< T >::operator* ( const T  value) const

Multiplies this pose by a scalar value and returns the new result.

The multiplication is done element wise.

Parameters
valueScalar value for multiplication
Returns
New resulting pose

◆ operator*=()

template<typename T >
PoseT<T>& Ocean::PoseT< T >::operator*= ( const T  value)

Multiplies this pose by a scalar.

The multiplication is done element wise.

Parameters
valueScalar value for multiplication
Returns
Reference to this object

◆ operator+()

template<typename T >
PoseT<T> Ocean::PoseT< T >::operator+ ( const PoseT< T > &  pose) const

Returns a new pose created by the element wise sum of two poses.

Parameters
poseSecond pose to add
Returns
New pose

◆ operator+=()

template<typename T >
PoseT<T>& Ocean::PoseT< T >::operator+= ( const PoseT< T > &  pose)

Adds element wise the six values of a second pose to this pose.

Parameters
poseSecond pose to add the six values
Returns
Reference to this object

◆ operator-()

template<typename T >
PoseT<T> Ocean::PoseT< T >::operator- ( const PoseT< T > &  pose) const

Returns a new pose created by the element wise subtraction of two poses.

Parameters
poseSecond pose to subtract
Returns
New pose

◆ operator-=()

template<typename T >
PoseT<T>& Ocean::PoseT< T >::operator-= ( const PoseT< T > &  pose)

Subtracts element wise the six values of a second pose from this pose.

Parameters
poseSecond pose to subtract the six values
Returns
Reference to this object

◆ operator==()

template<typename T >
bool Ocean::PoseT< T >::operator== ( const PoseT< T > &  pose) const
inline

Returns whether two poses are identical up to a small epsilon.

Parameters
poseRight pose to compare
Returns
True, if so

◆ operator[]() [1/2]

template<typename T >
T & Ocean::PoseT< T >::operator[] ( unsigned int  index)
inline

Element access operator.

Beware: No range check will be done!

Parameters
indexThe index of the element to return, with range [0, 5]
Returns
Internal element

◆ operator[]() [2/2]

template<typename T >
T Ocean::PoseT< T >::operator[] ( unsigned int  index) const
inline

Element access operator.

Beware: No range check will be done!

Parameters
indexThe index of the element to return, with range [0, 5]
Returns
Internal element

◆ orientation()

template<typename T >
QuaternionT<T> Ocean::PoseT< T >::orientation ( ) const

Returns the orientation of this pose.

Returns
Unit quaternion defining the pose orientation

◆ representativePoses() [1/2]

template<typename T >
static Indices32 Ocean::PoseT< T >::representativePoses ( const HomogenousMatrixT4< T > *  poseMatrices,
const size_t  size,
const size_t  subsetSize,
const size_t  explicitIndexOffset = 0 
)
static

Determines a subset of a set of given poses (defined as matrices) best representing the entire set of poses.

Parameters
poseMatricesThe entire set of given pose matrices from which a subset is extracted, must be valid
sizeThe number of provided set of pose matrices, with range [1, infinity)
subsetSizeThe number of poses in the resulting subset, with range [1, size]
explicitIndexOffsetThe explicit offset which is added to each index of the resulting (pose) subset allowing to add an explicit index shift
Returns
The indices of the poses defining the subset

◆ representativePoses() [2/2]

template<typename T >
static Indices32 Ocean::PoseT< T >::representativePoses ( const PosesT< T > &  poses,
const size_t  subsetSize,
const size_t  explicitIndexOffset = 0 
)
static

Determines a subset of a set of given poses best representing the entire set of poses.

Parameters
posesThe entire set of given poses from which a subset is extracted, must be valid
subsetSizeThe number of poses in the resulting subset, with range [1, poses.size()]
explicitIndexOffsetThe explicit offset which is added to each index of the resulting (pose) subset allowing to add an explicit index shift
Returns
The indices of the poses defining the subset

◆ rx() [1/2]

template<typename T >
T & Ocean::PoseT< T >::rx
inline

Returns the x parameter of the rotation.

Returns
Rotation x parameter

◆ rx() [2/2]

template<typename T >
T Ocean::PoseT< T >::rx
inline

Returns the x parameter of the rotation.

Returns
Rotation x parameter

◆ ry() [1/2]

template<typename T >
T & Ocean::PoseT< T >::ry
inline

Returns the y parameter of the rotation.

Returns
Rotation y parameter

◆ ry() [2/2]

template<typename T >
T Ocean::PoseT< T >::ry
inline

Returns the y parameter of the rotation.

Returns
Rotation y parameter

◆ rz() [1/2]

template<typename T >
T & Ocean::PoseT< T >::rz
inline

Returns the z parameter of the rotation.

Returns
Rotation z parameter

◆ rz() [2/2]

template<typename T >
T Ocean::PoseT< T >::rz
inline

Returns the z parameter of the rotation.

Returns
Rotation z parameter

◆ transformation()

template<typename T >
HomogenousMatrixT4<T> Ocean::PoseT< T >::transformation ( ) const

Returns the 4x4 homogeneous transformation matrix of this pose.

Returns
Transformation matrix

◆ translation()

template<typename T >
VectorT3< T > Ocean::PoseT< T >::translation
inline

Returns the translation of this pose.

Returns
3D translation vector

◆ x() [1/2]

template<typename T >
T & Ocean::PoseT< T >::x
inline

Returns the translation value for the x-axis.

Returns
Translation value for x-axis

◆ x() [2/2]

template<typename T >
T Ocean::PoseT< T >::x
inline

Returns the translation value for the x-axis.

Returns
Translation value for x-axis

◆ y() [1/2]

template<typename T >
T & Ocean::PoseT< T >::y
inline

Returns the translation value for the y-axis.

Returns
Translation value for y-axis

◆ y() [2/2]

template<typename T >
T Ocean::PoseT< T >::y
inline

Returns the translation value for the y-axis.

Returns
Translation value for y-axis

◆ z() [1/2]

template<typename T >
T & Ocean::PoseT< T >::z
inline

Returns the translation value for the z-axis.

Returns
Translation value for z-axis

◆ z() [2/2]

template<typename T >
T Ocean::PoseT< T >::z
inline

Returns the translation value for the z-axis.

Returns
Translation value for z-axis

Field Documentation

◆ values_

template<typename T >
T Ocean::PoseT< T >::values_[6]
protected

The six values of the pose, with element order: (Tx, Ty, Tz, Rx, Ry, Rz).


The documentation for this class was generated from the following file: