Visual Servoing Platform  version 3.6.1 under development (2024-07-27)
vpFeatureThetaU.h
1 /****************************************************************************
2  *
3  * ViSP, open source Visual Servoing Platform software.
4  * Copyright (C) 2005 - 2023 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 https://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 *****************************************************************************/
35 
41 #ifndef vpFeatureThetaU_H
42 #define vpFeatureThetaU_H
43 
44 #include <visp3/core/vpConfig.h>
45 #include <visp3/core/vpMatrix.h>
46 #include <visp3/core/vpThetaUVector.h>
47 #include <visp3/visual_features/vpBasicFeature.h>
48 
49 #include <visp3/core/vpHomogeneousMatrix.h>
50 #include <visp3/core/vpRGBa.h>
51 
228 class VISP_EXPORT vpFeatureThetaU : public vpBasicFeature
229 {
230 public:
231  typedef enum
232  {
233  TUx = 1,
235  TUy = 2,
237  TUz = 4
239  } vpFeatureThetaUType;
240  typedef enum
241  {
242  cdRc,
246  cRcd
250  } vpFeatureThetaURotationRepresentationType;
251  /*
252  attributes and members directly related to the vpBasicFeature needs
253  other functionalities are useful but not mandatory
254  */
255 
256 public:
257  // Basic constructor.
258  vpFeatureThetaU();
259  VP_EXPLICIT vpFeatureThetaU(vpFeatureThetaURotationRepresentationType r);
260  vpFeatureThetaU(vpThetaUVector &tu, vpFeatureThetaURotationRepresentationType r);
261  vpFeatureThetaU(vpRotationMatrix &R, vpFeatureThetaURotationRepresentationType r);
262  vpFeatureThetaU(vpHomogeneousMatrix &M, vpFeatureThetaURotationRepresentationType r);
263 
264 #ifdef VISP_BUILD_DEPRECATED_FUNCTIONS
265  void buildFrom(vpThetaUVector &tu);
266  // build from a rotation matrix
267  void buildFrom(const vpRotationMatrix &R);
268  // build from an homogeneous matrix
269  void buildFrom(const vpHomogeneousMatrix &M);
270 #endif
271  vpFeatureThetaU &build(const vpThetaUVector &tu);
272  // build from a rotation matrix
273  vpFeatureThetaU &build(const vpRotationMatrix &R);
274  // build from an homogeneous matrix
275  vpFeatureThetaU &build(const vpHomogeneousMatrix &M);
276 
277  void display(const vpCameraParameters &cam, const vpImage<unsigned char> &I, const vpColor &color = vpColor::green,
278  unsigned int thickness = 1) const VP_OVERRIDE;
279  void display(const vpCameraParameters &cam, const vpImage<vpRGBa> &I, const vpColor &color = vpColor::green,
280  unsigned int thickness = 1) const VP_OVERRIDE;
281 
283  vpFeatureThetaU *duplicate() const VP_OVERRIDE;
284 
285  // compute the error between two visual features from a subset
286  // a the possible features
287  vpColVector error(const vpBasicFeature &s_star, unsigned int select = FEATURE_ALL) VP_OVERRIDE;
288 
289  vpFeatureThetaURotationRepresentationType getFeatureThetaURotationType() const;
290 
291  double get_TUx() const;
292  double get_TUy() const;
293  double get_TUz() const;
294 
295  // Basic construction.
296  void init() VP_OVERRIDE;
297  // compute the interaction matrix from a subset a the possible features
298  vpMatrix interaction(unsigned int select = FEATURE_ALL) VP_OVERRIDE;
299  void print(unsigned int select = FEATURE_ALL) const VP_OVERRIDE;
300 
301  void set_TUx(double tu_x);
302  void set_TUy(double tu_y);
303  void set_TUz(double tu_z);
304 
305  void setFeatureThetaURotationType(const vpFeatureThetaURotationRepresentationType r);
306 
307 public:
308  /*
309  vpBasicFeature method instantiation
310  */
311  static unsigned int selectTUx();
312  static unsigned int selectTUy();
313  static unsigned int selectTUz();
314 
315 private:
316  vpFeatureThetaURotationRepresentationType rotation;
317 };
318 END_VISP_NAMESPACE
319 #endif
class that defines what is a visual feature
virtual void display(const vpCameraParameters &cam, const vpImage< unsigned char > &I, const vpColor &color=vpColor::green, unsigned int thickness=1) const =0
Generic class defining intrinsic camera parameters.
Implementation of column vector and the associated operations.
Definition: vpColVector.h:191
Class to define RGB colors available for display functionalities.
Definition: vpColor.h:157
static const vpColor green
Definition: vpColor.h:220
Class that defines a 3D visual feature from a axis/angle parametrization that represent the rotatio...
Implementation of an homogeneous matrix and operations on such kind of matrices.
Implementation of a matrix and operations on matrices.
Definition: vpMatrix.h:169
Definition: vpRGBa.h:65
Implementation of a rotation matrix and operations on such kind of matrices.
Implementation of a rotation vector as axis-angle minimal representation.