Visual Servoing Platform  version 3.2.0 under development (2019-01-22)
vpVelocityTwistMatrix.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  * Velocity twist transformation matrix.
33  *
34  * Authors:
35  * Eric Marchand
36  * Fabien Spindler
37  *
38  *****************************************************************************/
39 
40 #ifndef vpVelocityRwistMatrix_h
41 #define vpVelocityRwistMatrix_h
42 
43 #include <visp3/core/vpArray2D.h>
44 #include <visp3/core/vpColVector.h>
45 #include <visp3/core/vpHomogeneousMatrix.h>
46 #include <visp3/core/vpMatrix.h>
47 #include <visp3/core/vpRotationMatrix.h>
48 
50 class vpColVector;
51 
114 class VISP_EXPORT vpVelocityTwistMatrix : public vpArray2D<double>
115 {
116  friend class vpMatrix;
117 
118 public:
119  // basic constructor
121  // copy constructor
123  // constructor from an homogeneous transformation
124  explicit vpVelocityTwistMatrix(const vpHomogeneousMatrix &M, bool full = true);
125 
126  // Construction from Translation and rotation (matrix parameterization)
128  // Construction from Translation and rotation (ThetaU parameterization)
130  vpVelocityTwistMatrix(const double tx, const double ty, const double tz, const double tux, const double tuy,
131  const double tuz);
132 
134  vpVelocityTwistMatrix(const vpThetaUVector &thetau);
135 
140 
141  vpVelocityTwistMatrix buildFrom(const vpTranslationVector &t, const vpRotationMatrix &R);
142  vpVelocityTwistMatrix buildFrom(const vpTranslationVector &t, const vpThetaUVector &thetau);
143  vpVelocityTwistMatrix buildFrom(const vpHomogeneousMatrix &M, bool full = true);
144  vpVelocityTwistMatrix buildFrom(const vpRotationMatrix &R);
145  vpVelocityTwistMatrix buildFrom(const vpThetaUVector &thetau);
146 
147  void extract(vpRotationMatrix &R) const;
148  void extract(vpTranslationVector &t) const;
149 
150  // Basic initialisation (identity)
151  void eye();
152 
153  vpVelocityTwistMatrix inverse() const;
154  void inverse(vpVelocityTwistMatrix &V) const;
155 
157  vpMatrix operator*(const vpMatrix &M) const;
158  vpColVector operator*(const vpColVector &v) const;
159 
161 
162  int print(std::ostream &s, unsigned int length, char const *intro = 0) const;
163 
169  void resize(const unsigned int nrows, const unsigned int ncols, const bool flagNullify = true)
170  {
171  (void)nrows;
172  (void)ncols;
173  (void)flagNullify;
174  throw(vpException(vpException::fatalError, "Cannot resize a velocity twist matrix"));
175  };
176 
177 #if defined(VISP_BUILD_DEPRECATED_FUNCTIONS)
178 
186  vp_deprecated void init(){};
190  vp_deprecated void setIdentity();
192 #endif
193 };
194 
195 #endif
Implementation of a matrix and operations on matrices.
Definition: vpMatrix.h:104
vpArray2D< Type > & operator=(Type x)
Set all the elements of the array to x.
Definition: vpArray2D.h:247
void resize(const unsigned int nrows, const unsigned int ncols, const bool flagNullify=true)
Implementation of an homogeneous matrix and operations on such kind of matrices.
error that can be emited by ViSP classes.
Definition: vpException.h:71
Implementation of a generic 2D array used as vase class of matrices and vectors.
Definition: vpArray2D.h:70
Implementation of a rotation matrix and operations on such kind of matrices.
vp_deprecated void setIdentity(const double &val=1.0)
Definition: vpMatrix.cpp:5317
vpMatrix extract(unsigned int r, unsigned int c, unsigned int nrows, unsigned int ncols) const
Definition: vpMatrix.cpp:319
int print(std::ostream &s, unsigned int length, char const *intro=0) const
Definition: vpMatrix.cpp:4181
vp_deprecated void init()
vpMatrix t() const
Definition: vpMatrix.cpp:375
Implementation of column vector and the associated operations.
Definition: vpColVector.h:72
vpMatrix operator*(const vpMatrix &B) const
Definition: vpMatrix.cpp:941
Class that consider the case of a translation vector.
void eye()
Definition: vpMatrix.cpp:360
Implementation of a rotation vector as axis-angle minimal representation.