Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
CovTransformPose.hh
1 #ifndef __COVTRANSFORMPOSE_HH__
2 #define __COVTRANSFORMPOSE_HH__
3 
4 #include <MathAlgo/UnscentedTransform.hh>
5 
6 namespace BIAS {
7 
8  //forward declaration (reduce number of included headers)
9  template <class T> class BIASMathBase_EXPORT Vector;
10  template <class T> class BIASMathBase_EXPORT Vector3;
11  template <class T> class BIASMathBase_EXPORT Matrix;
12  template<class T> class BIASGeometryBase_EXPORT Quaternion;
13 
14  //types of transformations available (feel free to add some more!)
17 
18  /** @class CovTransformPose
19 
20  @brief Transformations between different representations of poses and
21  their covariances (e.g. convert a pose with given cov. represented
22  by position and euler-angles to a pose with according cov.
23  represented by position and a unit-quaternion).
24 
25  @Author apetersen 04/2008
26  */
27  class BIASGeometry_EXPORT CovTransformPose : public BIAS::UnscentedTransform
28  {
29  public:
30  /** @brief Standard Ctor, no params needed */
32 
33  virtual ~CovTransformPose(){}
34 
35  /** @brief Convert a pose given as a position, a quaternion and the
36  according 7x7-covariance-matrix to a pose given as position (same
37  as bevor), rotation in euler-angles (order of rotation-axis:
38  ZYX) and the according 6x6-covariance-matrix.
39  | pos rotXpos |
40  cov-Mat = | posXrot rot |
41 
42  @return 0 in case of success
43  -1 in case of any error
44  */
45  int PoseQuatToEulerZYX(const Vector3<double> &posQ,
46  const Quaternion<double> &rotQ,
47  const Matrix<double> &covQ,
48  Vector3<double> &posE, Vector3<double> &rotE,
49  Matrix<double> &covE);
50 
51  /** @brief Same as above, just other way around!
52 
53  @return 0 in case of success
54  -1 in case of any error
55  */
56  int PoseEulerZYXToQuat(const Vector3<double> &posE,
57  const Vector3<double> &rotE,
58  const Matrix<double> &covE,
59  Vector3<double> &posQ,
60  Quaternion<double> &rotQ,
61  Matrix<double> &covQ);
62 
63  /** @brief Transforms a pose Q,C by a rigid transformation dQ,dt such
64  that the resulting pose is dQ*Q, dQ*C*dQ' + dt.
65 
66  @return 0 in case of success
67  -1 in case of any error
68  */
69  int TransformPose(const Vector3<double> &inputPos,
70  const Quaternion<double> &inputRot,
71  const Matrix<double> &inputCov,
72  const Vector3<double> &translate,
73  const Quaternion<double> &rotate,
74  const Matrix<double> &transformCov,
75  Vector3<double> &resultPos,
76  Quaternion<double> &resultRot,
77  Matrix<double> &resultCov);
78 
79  /** @brief Transforms a 3D point X by a rigid transformation Q,t such
80  that the resulting 3D point is Q*X*Q' + t.
81 
82  @return 0 in case of success
83  -1 in case of any error
84  */
85  int TransformPoint3D(const Vector3<double> &point3D,
86  const Matrix3x3<double> &cov3D,
87  const Vector3<double> &translate,
88  const Quaternion<double> &rotate,
89  const Matrix<double> &transformCov,
90  Vector3<double> &resultPoint3D,
91  Matrix3x3<double> &resultCov3D);
92 
93  protected:
94  //Performs the point transition for unscented transform
95  virtual int Transform_(const Vector<double>& src,
96  Vector<double>& dst) const;
97 
98  //Tells Transform_ what transformation is to be used
100  };
101 
102 
103 } // namespace
104 
105 #endif // __COVTRANSFORMPOSE_HH__
class BIASGeometryBase_EXPORT Quaternion
Definition: RMatrixBase.hh:37
class BIASMathBase_EXPORT Vector3
Definition: Operators.hh:44
class BIASMathBase_EXPORT Matrix
Definition: Operators.hh:37
Transformations between different representations of poses and their covariances (e.g.
uses the unscented transformation to map a normal distribututed random variable using a nonlinear tra...
class BIASMathBase_EXPORT Vector