Visual Servoing Platform  version 3.5.0 under development (2022-02-15)
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(double tx, double ty, double tz, double tux, double tuy, double tuz);
183 
185  vpVelocityTwistMatrix(const vpThetaUVector &thetau);
186 
191 
192  vpVelocityTwistMatrix buildFrom(const vpTranslationVector &t, const vpRotationMatrix &R);
193  vpVelocityTwistMatrix buildFrom(const vpTranslationVector &t, const vpThetaUVector &thetau);
194  vpVelocityTwistMatrix buildFrom(const vpHomogeneousMatrix &M, bool full = true);
195  vpVelocityTwistMatrix buildFrom(const vpRotationMatrix &R);
196  vpVelocityTwistMatrix buildFrom(const vpThetaUVector &thetau);
197 
198  void extract(vpRotationMatrix &R) const;
199  void extract(vpTranslationVector &t) const;
200 
201  // Basic initialisation (identity)
202  void eye();
203 
204  vpVelocityTwistMatrix inverse() const;
205  void inverse(vpVelocityTwistMatrix &V) const;
206 
208  vpMatrix operator*(const vpMatrix &M) const;
209  vpColVector operator*(const vpColVector &v) const;
210 
212 
213  int print(std::ostream &s, unsigned int length, char const *intro = 0) const;
214 
220  void resize(unsigned int nrows, unsigned int ncols, bool flagNullify = true)
221  {
222  (void)nrows;
223  (void)ncols;
224  (void)flagNullify;
225  throw(vpException(vpException::fatalError, "Cannot resize a velocity twist matrix"));
226  };
227 
228 #if defined(VISP_BUILD_DEPRECATED_FUNCTIONS)
229 
237  vp_deprecated void init(){};
241  vp_deprecated void setIdentity();
243 #endif
244 };
245 
246 #endif
vpMatrix extract(unsigned int r, unsigned int c, unsigned int nrows, unsigned int ncols) const
Definition: vpMatrix.cpp:407
Implementation of a matrix and operations on matrices.
Definition: vpMatrix.h:153
vpArray2D< Type > & operator=(Type x)
Set all the elements of the array to x.
Definition: vpArray2D.h:413
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.
vpMatrix t() const
Definition: vpMatrix.cpp:464
vp_deprecated void setIdentity(const double &val=1.0)
Definition: vpMatrix.cpp:6977
void resize(unsigned int nrows, unsigned int ncols, bool flagNullify=true)
int print(std::ostream &s, unsigned int length, const std::string &intro="") const
Definition: vpMatrix.cpp:5598
vp_deprecated void init()
vpMatrix operator*(const vpMatrix &B) const
Definition: vpMatrix.cpp:1168
Implementation of column vector and the associated operations.
Definition: vpColVector.h:130
Class that consider the case of a translation vector.
void eye()
Definition: vpMatrix.cpp:449
Implementation of a rotation vector as axis-angle minimal representation.