Visual Servoing Platform  version 3.0.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
vpRotationMatrix.h
1 /****************************************************************************
2  *
3  * This file is part of the ViSP software.
4  * Copyright (C) 2005 - 2017 by Inria. All rights reserved.
5  *
6  * This software is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * ("GPL") version 2 as published by the Free Software Foundation.
9  * See the file LICENSE.txt at the root directory of this source
10  * distribution for additional information about the GNU GPL.
11  *
12  * For using ViSP with software that can not be combined with the GNU
13  * GPL, please contact Inria about acquiring a ViSP Professional
14  * Edition License.
15  *
16  * See http://visp.inria.fr for more information.
17  *
18  * This software was developed at:
19  * Inria Rennes - Bretagne Atlantique
20  * Campus Universitaire de Beaulieu
21  * 35042 Rennes Cedex
22  * France
23  *
24  * If you have questions regarding the use of this file, please contact
25  * Inria at visp@inria.fr
26  *
27  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
28  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
29  *
30  * Description:
31  * Rotation matrix.
32  *
33  * Authors:
34  * Eric Marchand
35  *
36  *****************************************************************************/
37 
38 
39 #ifndef vpROTATIONMATRIX_H
40 #define vpROTATIONMATRIX_H
41 
47 #include <visp3/core/vpHomogeneousMatrix.h>
48 #include <visp3/core/vpArray2D.h>
49 #include <visp3/core/vpRxyzVector.h>
50 #include <visp3/core/vpRzyxVector.h>
51 #include <visp3/core/vpRzyzVector.h>
52 #include <visp3/core/vpThetaUVector.h>
53 #include <visp3/core/vpTranslationVector.h>
54 #include <visp3/core/vpQuaternionVector.h>
55 #include <visp3/core/vpPoseVector.h>
56 
70 class VISP_EXPORT vpRotationMatrix : public vpArray2D<double>
71 {
72 public:
82  vpRotationMatrix(const double tux, const double tuy, const double tuz);
86  virtual ~vpRotationMatrix() {};
87 
88  vpRotationMatrix buildFrom(const vpHomogeneousMatrix &M);
89  vpRotationMatrix buildFrom(const vpThetaUVector &v) ;
90  vpRotationMatrix buildFrom(const vpPoseVector &p);
91  vpRotationMatrix buildFrom(const vpRzyzVector &v);
92  vpRotationMatrix buildFrom(const vpRxyzVector &v);
93  vpRotationMatrix buildFrom(const vpRzyxVector &v);
94  vpRotationMatrix buildFrom(const vpQuaternionVector& q);
95  vpRotationMatrix buildFrom(const double tux, const double tuy, const double tuz);
96 
97  void eye();
98 
99  vpColVector getCol(const unsigned int j) const;
100  vpThetaUVector getThetaUVector();
101 
102  vpRotationMatrix inverse() const;
103  void inverse(vpRotationMatrix &R) const;
104 
105  bool isARotationMatrix() const ;
106 
107  // copy operator from vpRotationMatrix
109  // copy operator from vpMatrix (handle with care)
111  // operation c = A * b (A is unchanged)
113  // operation C = A * B (A is unchanged)
115  // operation C = A * B (A is unchanged)
116  vpMatrix operator*(const vpMatrix &M) const;
117  // operation v2 = A * v1 (A is unchanged)
118  vpColVector operator*(const vpColVector &v) const;
119  vpRotationMatrix operator*(const double x) const;
120  vpRotationMatrix &operator*=(const double x);
121 
122  void printVector() ;
123 
129  void resize(const unsigned int nrows, const unsigned int ncols,
130  const bool flagNullify = true)
131  {
132  (void)nrows;
133  (void)ncols;
134  (void)flagNullify;
135  throw(vpException(vpException::fatalError, "Cannot resize a rotation matrix"));
136  };
137 
138  // transpose
139  vpRotationMatrix t() const;
140 
141 #if defined(VISP_BUILD_DEPRECATED_FUNCTIONS)
142 
150  vp_deprecated void init() {};
154  vp_deprecated void setIdentity();
156 #endif
157 
158 private:
159  static const double threshold;
160 };
161 
162 #ifndef DOXYGEN_SHOULD_SKIP_THIS
163 VISP_EXPORT
164 #endif
165 vpRotationMatrix operator*(const double &x, const vpRotationMatrix &R) ;
166 
167 #endif
Implementation of a matrix and operations on matrices.
Definition: vpMatrix.h:97
vpArray2D< Type > & operator=(Type x)
Set all the elements of the array to x.
Definition: vpArray2D.h:239
Implementation of an homogeneous matrix and operations on such kind of matrices.
vpColVector operator*(const double &x, const vpColVector &v)
error that can be emited by ViSP classes.
Definition: vpException.h:73
Implementation of a generic 2D array used as vase class of matrices and vectors.
Definition: vpArray2D.h:70
Implementation of a rotation vector as Euler angle minimal representation.
Definition: vpRzyxVector.h:152
Implementation of a rotation matrix and operations on such kind of matrices.
virtual ~vpRotationMatrix()
vpColVector operator*(const double &x, const vpColVector &v)
vp_deprecated void init()
void resize(const unsigned int nrows, const unsigned int ncols, const bool flagNullify=true)
Implementation of a rotation vector as quaternion angle minimal representation.
Implementation of column vector and the associated operations.
Definition: vpColVector.h:72
Implementation of a pose vector and operations on poses.
Definition: vpPoseVector.h:93
Implementation of a rotation vector as Euler angle minimal representation.
Definition: vpRxyzVector.h:154
Implementation of a rotation vector as Euler angle minimal representation.
Definition: vpRzyzVector.h:151
Class that consider the case of a translation vector.
Implementation of a rotation vector as axis-angle minimal representation.