Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
CovEuler2Quaternion.cpp
1 #include <Geometry/CovEuler2Quaternion.hh>
2 #include <Base/Debug/Exception.hh>
3 #include <Base/Geometry/RMatrixBase.hh>
4 #include <Base/Geometry/RMatrixBase.hh>
5 #include <Base/Geometry/Quaternion.hh>
6 
7 using namespace BIAS;
8 using namespace std;
9 
12  const Vector<double>& pose)
13 {
14  Matrix<double> ncov;
15  Vector<double> npos;
16  if (UnscentedTransform::Transform(pose, cov_pose, npos, ncov)!=0){
17  BEXCEPTION("unable to transform");
18  }
19  return ncov;
20 }
21 
22 int
24  Vector<double>& dst) const
25 {
26  Vector3<double> euler(src[3], src[4], src[5]);
27  RMatrixBase R;
28  R.SetZYX(euler);
29  Quaternion<double> quat;
30  R.GetQuaternion(quat);
31  dst.newsize(7);
32  for (int i=0; i<3; i++){
33  dst[i] = src[i];
34  }
35  for (int i=3; i<7; i++){
36  dst[i] = quat[i-3];
37  }
38  return 0;
39 }
void SetZYX(ROTATION_MATRIX_TYPE PhiX, ROTATION_MATRIX_TYPE PhiY, ROTATION_MATRIX_TYPE PhiZ)
Set Euler angles (in rad) in order ZYX.
int GetQuaternion(Quaternion< ROTATION_MATRIX_TYPE > &quat) const
Calculates quaternion representation for this rotation matrix.
Vector< T > & newsize(Subscript N)
Definition: vec.h:220
virtual int Transform_(const BIAS::Vector< double > &src, BIAS::Vector< double > &dst) const
implements a point transformation
int Transform(const Vector< double > &src_mean, const Matrix< double > &src_cov, Vector< double > &dst_mean, Matrix< double > &dst_cov) const
computes the second order approximation of the transformations of the mean and the associated covaria...
BIAS::PoseParametrizationCovariance CTransform(const BIAS::Matrix< double > &cov_pose, const BIAS::Vector< double > &pose)
Implements a 3D rotation matrix.
Definition: RMatrixBase.hh:44
class encapsulating the transfromations between different pose parametrizations