Visual Servoing Platform  version 3.6.1 under development (2023-10-03)
vpThetaUVector.h
1 /*
2  * ViSP, open source Visual Servoing Platform software.
3  * Copyright (C) 2005 - 2023 by Inria. All rights reserved.
4  *
5  * This software is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
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 https://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  * Theta U parameterization for the rotation.
32  */
33 
34 #ifndef _vpThetaUVector_h_
35 #define _vpThetaUVector_h_
36 
44 class vpRotationMatrix;
45 class vpPoseVector;
46 class vpRzyxVector;
47 class vpRxyzVector;
48 class vpRzyzVector;
49 class vpColVector;
50 class vpRotationVector;
51 class vpQuaternionVector;
52 
53 #include <visp3/core/vpColVector.h>
54 #include <visp3/core/vpHomogeneousMatrix.h>
55 #include <visp3/core/vpQuaternionVector.h>
56 #include <visp3/core/vpRotationMatrix.h>
57 #include <visp3/core/vpRotationVector.h>
58 #include <visp3/core/vpRxyzVector.h>
59 #include <visp3/core/vpRzyxVector.h>
60 
167 class VISP_EXPORT vpThetaUVector : public vpRotationVector
168 {
169 private:
170  static const double minimum;
171 
172 public:
173  vpThetaUVector();
174  vpThetaUVector(const vpThetaUVector &tu);
175 
176  // constructor initialize a Theta U vector from a homogeneous matrix
177  explicit vpThetaUVector(const vpHomogeneousMatrix &M);
178  // constructor initialize a Theta U vector from a pose vector
179  explicit vpThetaUVector(const vpPoseVector &p);
180  // constructor initialize a Theta U vector from a rotation matrix
181  explicit vpThetaUVector(const vpRotationMatrix &R);
182  // constructor initialize a Theta U vector from a RzyxVector
183  explicit vpThetaUVector(const vpRzyxVector &rzyx);
184  // constructor initialize a Theta U vector from a RzyzVector
185  explicit vpThetaUVector(const vpRzyzVector &rzyz);
186  // constructor initialize a Theta U vector from a RxyzVector
187  explicit vpThetaUVector(const vpRxyzVector &rxyz);
188  explicit vpThetaUVector(const vpQuaternionVector &q);
189  explicit vpThetaUVector(const vpColVector &tu);
190  explicit vpThetaUVector(const std::vector<double> &tu);
191 
192  vpThetaUVector(double tux, double tuy, double tuz);
194  virtual ~vpThetaUVector(){}
195 
196  // convert an homogeneous matrix into Theta U vector
197  vpThetaUVector buildFrom(const vpHomogeneousMatrix &M);
198  // convert a pose vector into Theta U vector
199  vpThetaUVector buildFrom(const vpPoseVector &p);
200  // convert a rotation matrix into Theta U vector
201  vpThetaUVector buildFrom(const vpRotationMatrix &R);
202  // convert an Rzyx vector into Theta U vector
203  vpThetaUVector buildFrom(const vpRzyxVector &rzyx);
204  // convert an Rzyz vector into Theta U vector
205  vpThetaUVector buildFrom(const vpRzyzVector &zyz);
206  // convert an Rxyz vector into Theta U vector
207  vpThetaUVector buildFrom(const vpRxyzVector &xyz);
208  vpThetaUVector buildFrom(const vpQuaternionVector &q);
209  vpThetaUVector buildFrom(const vpColVector &tu);
210  vpThetaUVector buildFrom(const std::vector<double> &tu);
211 
212  void buildFrom(double tux, double tuy, double tuz);
213 
214  // extract the angle and the axis from the ThetaU representation
215  void extract(double &theta, vpColVector &u) const;
216  double getTheta() const;
217  vpColVector getU() const;
218 
220  vpThetaUVector &operator=(double x);
221  vpThetaUVector operator*(const vpThetaUVector &tu_b) const;
222 
223 #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
224  vpThetaUVector &operator=(const std::initializer_list<double> &list);
225 #endif
226 };
227 
228 #endif
Implementation of column vector and the associated operations.
Definition: vpColVector.h:167
Implementation of an homogeneous matrix and operations on such kind of matrices.
Implementation of a pose vector and operations on poses.
Definition: vpPoseVector.h:192
Implementation of a rotation vector as quaternion angle minimal representation.
Implementation of a rotation matrix and operations on such kind of matrices.
Implementation of a generic rotation vector.
vpRotationVector & operator=(const vpRotationVector &v)
vpColVector operator*(double x) const
Implementation of a rotation vector as Euler angle minimal representation.
Definition: vpRxyzVector.h:178
Implementation of a rotation vector as Euler angle minimal representation.
Definition: vpRzyxVector.h:180
Implementation of a rotation vector as Euler angle minimal representation.
Definition: vpRzyzVector.h:177
Implementation of a rotation vector as axis-angle minimal representation.
virtual ~vpThetaUVector()
Destructor.