Visual Servoing Platform  version 3.2.1 under development (2019-05-20)
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 
166 class VISP_EXPORT vpVelocityTwistMatrix : public vpArray2D<double>
167 {
168  friend class vpMatrix;
169 
170 public:
171  // basic constructor
173  // copy constructor
175  // constructor from an homogeneous transformation
176  explicit vpVelocityTwistMatrix(const vpHomogeneousMatrix &M, bool full = true);
177 
178  // Construction from Translation and rotation (matrix parameterization)
180  // Construction from Translation and rotation (ThetaU parameterization)
182  vpVelocityTwistMatrix(const double tx, const double ty, const double tz, const double tux, const double tuy,
183  const double tuz);
184 
186  vpVelocityTwistMatrix(const vpThetaUVector &thetau);
187 
192 
193  vpVelocityTwistMatrix buildFrom(const vpTranslationVector &t, const vpRotationMatrix &R);
194  vpVelocityTwistMatrix buildFrom(const vpTranslationVector &t, const vpThetaUVector &thetau);
195  vpVelocityTwistMatrix buildFrom(const vpHomogeneousMatrix &M, bool full = true);
196  vpVelocityTwistMatrix buildFrom(const vpRotationMatrix &R);
197  vpVelocityTwistMatrix buildFrom(const vpThetaUVector &thetau);
198 
199  void extract(vpRotationMatrix &R) const;
200  void extract(vpTranslationVector &t) const;
201 
202  // Basic initialisation (identity)
203  void eye();
204 
205  vpVelocityTwistMatrix inverse() const;
206  void inverse(vpVelocityTwistMatrix &V) const;
207 
209  vpMatrix operator*(const vpMatrix &M) const;
210  vpColVector operator*(const vpColVector &v) const;
211 
213 
214  int print(std::ostream &s, unsigned int length, char const *intro = 0) const;
215 
221  void resize(const unsigned int nrows, const unsigned int ncols, const bool flagNullify = true)
222  {
223  (void)nrows;
224  (void)ncols;
225  (void)flagNullify;
226  throw(vpException(vpException::fatalError, "Cannot resize a velocity twist matrix"));
227  };
228 
229 #if defined(VISP_BUILD_DEPRECATED_FUNCTIONS)
230 
238  vp_deprecated void init(){};
242  vp_deprecated void setIdentity();
244 #endif
245 };
246 
247 #endif
Implementation of a matrix and operations on matrices.
Definition: vpMatrix.h:164
vpArray2D< Type > & operator=(Type x)
Set all the elements of the array to x.
Definition: vpArray2D.h:406
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 base class for matrices and vectors. ...
Definition: vpArray2D.h:131
Implementation of a rotation matrix and operations on such kind of matrices.
int print(std::ostream &s, unsigned int length, const std::string &intro="") const
Definition: vpMatrix.cpp:4270
vp_deprecated void setIdentity(const double &val=1.0)
Definition: vpMatrix.cpp:5498
vpMatrix extract(unsigned int r, unsigned int c, unsigned int nrows, unsigned int ncols) const
Definition: vpMatrix.cpp:319
vp_deprecated void init()
vpMatrix t() const
Definition: vpMatrix.cpp:375
Implementation of column vector and the associated operations.
Definition: vpColVector.h:130
vpMatrix operator*(const vpMatrix &B) const
Definition: vpMatrix.cpp:1030
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.