Visual Servoing Platform  version 3.2.0 under development (2019-01-22)
vpFeatureThetaU.h
1 /****************************************************************************
2  *
3  * ViSP, open source Visual Servoing Platform software.
4  * Copyright (C) 2005 - 2019 by Inria. All rights reserved.
5  *
6  * This software is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  * See the file LICENSE.txt at the root directory of this source
11  * distribution for additional information about the GNU GPL.
12  *
13  * For using ViSP with software that can not be combined with the GNU
14  * GPL, please contact Inria about acquiring a ViSP Professional
15  * Edition License.
16  *
17  * See http://visp.inria.fr for more information.
18  *
19  * This software was developed at:
20  * Inria Rennes - Bretagne Atlantique
21  * Campus Universitaire de Beaulieu
22  * 35042 Rennes Cedex
23  * France
24  *
25  * If you have questions regarding the use of this file, please contact
26  * Inria at visp@inria.fr
27  *
28  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
29  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
30  *
31  * Description:
32  * ThetaU visual feature.
33  *
34  * Authors:
35  * Eric Marchand
36  * Fabien Spindler
37  *
38  *****************************************************************************/
39 
40 #ifndef vpFeatureThetaU_H
41 #define vpFeatureThetaU_H
42 
48 #include <visp3/core/vpMatrix.h>
49 #include <visp3/core/vpThetaUVector.h>
50 #include <visp3/visual_features/vpBasicFeature.h>
51 
52 #include <visp3/core/vpHomogeneousMatrix.h>
53 #include <visp3/core/vpRGBa.h>
54 
224 class VISP_EXPORT vpFeatureThetaU : public vpBasicFeature
225 {
226 public:
227  typedef enum {
228  TUx = 1,
230  TUy = 2,
232  TUz = 4
235  typedef enum {
236  cdRc,
240  cRcd
245  /*
246  attributes and members directly related to the vpBasicFeature needs
247  other functionalities are useful but not mandatory
248  */
249 
250 public:
251  // Basic constructor.
252  vpFeatureThetaU();
253  explicit vpFeatureThetaU(vpFeatureThetaURotationRepresentationType r);
254  vpFeatureThetaU(vpThetaUVector &tu, vpFeatureThetaURotationRepresentationType r);
255  vpFeatureThetaU(vpRotationMatrix &R, vpFeatureThetaURotationRepresentationType r);
256  vpFeatureThetaU(vpHomogeneousMatrix &M, vpFeatureThetaURotationRepresentationType r);
258  virtual ~vpFeatureThetaU() {}
259 
260  void buildFrom(vpThetaUVector &tu);
261  // build from a rotation matrix
262  void buildFrom(const vpRotationMatrix &R);
263  // build from an homogeneous matrix
264  void buildFrom(const vpHomogeneousMatrix &M);
265 
266  void display(const vpCameraParameters &cam, const vpImage<unsigned char> &I, const vpColor &color = vpColor::green,
267  unsigned int thickness = 1) const;
268  void display(const vpCameraParameters &cam, const vpImage<vpRGBa> &I, const vpColor &color = vpColor::green,
269  unsigned int thickness = 1) const;
270 
272  vpFeatureThetaU *duplicate() const;
273 
274  // compute the error between two visual features from a subset
275  // a the possible features
276  vpColVector error(const vpBasicFeature &s_star, const unsigned int select = FEATURE_ALL);
277 
278  vpFeatureThetaURotationRepresentationType getFeatureThetaURotationType() const;
279 
280  double get_TUx() const;
281  double get_TUy() const;
282  double get_TUz() const;
283 
284  // Basic construction.
285  void init();
286  // compute the interaction matrix from a subset a the possible features
287  vpMatrix interaction(const unsigned int select = FEATURE_ALL);
288 
289  void print(const unsigned int select = FEATURE_ALL) const;
290 
291  void set_TUx(const double tu_x);
292  void set_TUy(const double tu_y);
293  void set_TUz(const double tu_z);
294 
295  void setFeatureThetaURotationType(const vpFeatureThetaURotationRepresentationType r);
296 
297 public:
298  /*
299  vpBasicFeature method instantiation
300  */
301  static unsigned int selectTUx();
302  static unsigned int selectTUy();
303  static unsigned int selectTUz();
304 
305 private:
306  vpFeatureThetaURotationRepresentationType rotation;
307 };
308 
309 #endif
Implementation of a matrix and operations on matrices.
Definition: vpMatrix.h:104
Implementation of an homogeneous matrix and operations on such kind of matrices.
virtual void print(const unsigned int select=FEATURE_ALL) const =0
Print the name of the feature.
Class to define colors available for display functionnalities.
Definition: vpColor.h:120
virtual vpColVector error(const vpBasicFeature &s_star, const unsigned int select=FEATURE_ALL)
static const vpColor green
Definition: vpColor.h:183
Implementation of a rotation matrix and operations on such kind of matrices.
vpFeatureThetaURotationRepresentationType
class that defines what is a visual feature
virtual vpMatrix interaction(const unsigned int select=FEATURE_ALL)=0
Compute the interaction matrix from a subset of the possible features.
Generic class defining intrinsic camera parameters.
virtual void init()=0
Implementation of column vector and the associated operations.
Definition: vpColVector.h:72
Class that defines a 3D visual feature from a axis/angle parametrization that represent the rotatio...
virtual vpBasicFeature * duplicate() const =0
virtual void display(const vpCameraParameters &cam, const vpImage< unsigned char > &I, const vpColor &color=vpColor::green, unsigned int thickness=1) const =0
Implementation of a rotation vector as axis-angle minimal representation.
virtual ~vpFeatureThetaU()
Destructor. Does nothing.