* This is a simple class to manage frame updates so that rotation and homogeneous matrices
* are computed only once for the lifetime of a specific TF parametrization.
*
* Unit quaternions are used for 3D orientation input. They require the real part at the end.
*/
classTF
{
private:
unsignedintepoch_;///< epoch counter to control updates automatically
protected:
Eigen::Vector3st_;///< Position vector
Eigen::Vector3sp_;///< Position vector
Eigen::Vector4sq_vector_;///< Orientation quaternion in vector form
Eigen::Quaternionsq_;///< Orientation quaternion in quaternion form
Eigen::Matrix3sR_;///< Rotation matrix
...
...
@@ -27,11 +35,11 @@ class TF
public:
/**
* Default constructor
* Default constructor to the origin, P=(0,0,0), Q=(0,0,0,1), R=identity, H=identity
*/
TF():epoch_(0),
t_(Eigen::Vector3s::Zero()),
q_vector_(0,0,0,0),// Impose a non-valid quaternion so that it will be updated for sure. This prevents a bad initialization due to different convention in the order of components.
p_(Eigen::Vector3s::Zero()),
q_vector_(0,0,0,1),// Impose an identity quaternion with real part at the end. This is Eigen compatible. TODO: check components order
q_(Eigen::Quaternions::Identity()),
R_(Eigen::Matrix3s::Identity()),
H_(Eigen::Matrix4s::Identity())
...
...
@@ -39,75 +47,82 @@ class TF
}
/**
*
* Initializer constuctor
* \param _p_ptr pointer to position vector
* \param _q_vec_ptr pointer to quaternion vector (real part at the end)