Visual Servoing Platform  version 3.6.1 under development (2024-07-27)
vpThetaUVector.h
1 /*
2  * ViSP, open source Visual Servoing Platform software.
3  * Copyright (C) 2005 - 2024 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 
40 #ifndef VP_THETAU_VECTOR_H
41 #define VP_THETAU_VECTOR_H
42 
43 #include <visp3/core/vpColVector.h>
44 #include <visp3/core/vpHomogeneousMatrix.h>
45 #include <visp3/core/vpQuaternionVector.h>
46 #include <visp3/core/vpRotationMatrix.h>
47 #include <visp3/core/vpRotationVector.h>
48 #include <visp3/core/vpRxyzVector.h>
49 #include <visp3/core/vpRzyxVector.h>
50 
52 
54 class vpRotationMatrix;
55 class vpPoseVector;
56 class vpRzyxVector;
57 class vpRxyzVector;
58 class vpRzyzVector;
59 class vpColVector;
60 class vpRotationVector;
61 class vpQuaternionVector;
62 
171 class VISP_EXPORT vpThetaUVector : public vpRotationVector
172 {
173 public:
174  vpThetaUVector();
175  vpThetaUVector(const vpThetaUVector &tu);
176 
177  // constructor initialize a Theta U vector from a homogeneous matrix
178  VP_EXPLICIT vpThetaUVector(const vpHomogeneousMatrix &M);
179  // constructor initialize a Theta U vector from a pose vector
180  VP_EXPLICIT vpThetaUVector(const vpPoseVector &p);
181  // constructor initialize a Theta U vector from a rotation matrix
182  VP_EXPLICIT vpThetaUVector(const vpRotationMatrix &R);
183  // constructor initialize a Theta U vector from a RzyxVector
184  VP_EXPLICIT vpThetaUVector(const vpRzyxVector &rzyx);
185  // constructor initialize a Theta U vector from a RzyzVector
186  VP_EXPLICIT vpThetaUVector(const vpRzyzVector &rzyz);
187  // constructor initialize a Theta U vector from a RxyzVector
188  VP_EXPLICIT vpThetaUVector(const vpRxyzVector &rxyz);
189  VP_EXPLICIT vpThetaUVector(const vpQuaternionVector &q);
190  VP_EXPLICIT vpThetaUVector(const vpColVector &tu);
191  VP_EXPLICIT vpThetaUVector(const std::vector<double> &tu);
192 
193  vpThetaUVector(double tux, double tuy, double tuz);
194 
195 #ifdef VISP_BUILD_DEPRECATED_FUNCTIONS
196  // convert an homogeneous matrix into Theta U vector
197  VP_DEPRECATED vpThetaUVector buildFrom(const vpHomogeneousMatrix &M);
198  // convert a pose vector into Theta U vector
199  VP_DEPRECATED vpThetaUVector buildFrom(const vpPoseVector &p);
200  // convert a rotation matrix into Theta U vector
201  VP_DEPRECATED vpThetaUVector buildFrom(const vpRotationMatrix &R);
202  // convert an Rzyx vector into Theta U vector
203  VP_DEPRECATED vpThetaUVector buildFrom(const vpRzyxVector &rzyx);
204  // convert an Rzyz vector into Theta U vector
205  VP_DEPRECATED vpThetaUVector buildFrom(const vpRzyzVector &zyz);
206  // convert an Rxyz vector into Theta U vector
207  VP_DEPRECATED vpThetaUVector buildFrom(const vpRxyzVector &xyz);
208  VP_DEPRECATED vpThetaUVector buildFrom(const vpQuaternionVector &q);
209  VP_DEPRECATED vpThetaUVector buildFrom(const vpColVector &tu);
210  VP_DEPRECATED vpThetaUVector buildFrom(const std::vector<double> &tu);
211 
212  VP_DEPRECATED void buildFrom(double tux, double tuy, double tuz);
213 #endif
214  // convert an homogeneous matrix into Theta U vector
215  vpThetaUVector &build(const vpHomogeneousMatrix &M);
216  // convert a pose vector into Theta U vector
217  vpThetaUVector &build(const vpPoseVector &p);
218  // convert a rotation matrix into Theta U vector
219  vpThetaUVector &build(const vpRotationMatrix &R);
220  // convert an Rzyx vector into Theta U vector
221  vpThetaUVector &build(const vpRzyxVector &rzyx);
222  // convert an Rzyz vector into Theta U vector
223  vpThetaUVector &build(const vpRzyzVector &zyz);
224  // convert an Rxyz vector into Theta U vector
225  vpThetaUVector &build(const vpRxyzVector &xyz);
226  vpThetaUVector &build(const vpQuaternionVector &q);
227  vpThetaUVector &build(const vpColVector &tu);
228  vpThetaUVector &build(const std::vector<double> &tu);
229 
230  vpThetaUVector &build(const double &tux, const double &tuy, const double &tuz);
231 
232  // extract the angle and the axis from the ThetaU representation
233  void extract(double &theta, vpColVector &u) const;
234  double getTheta() const;
235  vpColVector getU() const;
236 
238  vpThetaUVector &operator=(double x);
239  vpThetaUVector operator*(const vpThetaUVector &tu_b) const;
240 
241 #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
242  vpThetaUVector &operator=(const std::initializer_list<double> &list);
243 #endif
244 
245 private:
246  static const double minimum;
247 
248 };
249 END_VISP_NAMESPACE
250 #endif
Implementation of column vector and the associated operations.
Definition: vpColVector.h:191
Implementation of an homogeneous matrix and operations on such kind of matrices.
Implementation of a pose vector and operations on poses.
Definition: vpPoseVector.h:203
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:183
Implementation of a rotation vector as Euler angle minimal representation.
Definition: vpRzyxVector.h:184
Implementation of a rotation vector as Euler angle minimal representation.
Definition: vpRzyzVector.h:182
Implementation of a rotation vector as axis-angle minimal representation.