Visual Servoing Platform  version 3.6.1 under development (2024-10-13)
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 
52 BEGIN_VISP_NAMESPACE
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  vpFeatureThetaU &buildFrom(const vpThetaUVector &tu);
265  // build from a rotation matrix
266  vpFeatureThetaU &buildFrom(const vpRotationMatrix &R);
267  // build from an homogeneous matrix
268  vpFeatureThetaU &buildFrom(const vpHomogeneousMatrix &M);
269 
270  void display(const vpCameraParameters &cam, const vpImage<unsigned char> &I, const vpColor &color = vpColor::green,
271  unsigned int thickness = 1) const VP_OVERRIDE;
272  void display(const vpCameraParameters &cam, const vpImage<vpRGBa> &I, const vpColor &color = vpColor::green,
273  unsigned int thickness = 1) const VP_OVERRIDE;
274 
276  vpFeatureThetaU *duplicate() const VP_OVERRIDE;
277 
278  // compute the error between two visual features from a subset
279  // a the possible features
280  vpColVector error(const vpBasicFeature &s_star, unsigned int select = FEATURE_ALL) VP_OVERRIDE;
281 
282  vpFeatureThetaURotationRepresentationType getFeatureThetaURotationType() const;
283 
284  double get_TUx() const;
285  double get_TUy() const;
286  double get_TUz() const;
287 
288  // Basic construction.
289  void init() VP_OVERRIDE;
290  // compute the interaction matrix from a subset a the possible features
291  vpMatrix interaction(unsigned int select = FEATURE_ALL) VP_OVERRIDE;
292  void print(unsigned int select = FEATURE_ALL) const VP_OVERRIDE;
293 
294  void set_TUx(double tu_x);
295  void set_TUy(double tu_y);
296  void set_TUz(double tu_z);
297 
298  void setFeatureThetaURotationType(const vpFeatureThetaURotationRepresentationType r);
299 
300 public:
301  /*
302  vpBasicFeature method instantiation
303  */
304  static unsigned int selectTUx();
305  static unsigned int selectTUy();
306  static unsigned int selectTUz();
307 
308 private:
309  vpFeatureThetaURotationRepresentationType rotation;
310 };
311 END_VISP_NAMESPACE
312 #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.