Visual Servoing Platform  version 3.6.1 under development (2024-07-27)
vpVelocityTwistMatrix.h
1 /*
2  * ViSP, open source Visual Servoing Platform software.
3  * Copyright (C) 2005 - 2024 by Inria. All rights reserved.
4  *
5  * This software is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  * See the file LICENSE.txt at the root directory of this source
10  * distribution for additional information about the GNU GPL.
11  *
12  * For using ViSP with software that can not be combined with the GNU
13  * GPL, please contact Inria about acquiring a ViSP Professional
14  * Edition License.
15  *
16  * See https://visp.inria.fr for more information.
17  *
18  * This software was developed at:
19  * Inria Rennes - Bretagne Atlantique
20  * Campus Universitaire de Beaulieu
21  * 35042 Rennes Cedex
22  * France
23  *
24  * If you have questions regarding the use of this file, please contact
25  * Inria at visp@inria.fr
26  *
27  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
28  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
29  *
30  * Description:
31  * Velocity twist transformation matrix.
32  */
33 
34 #ifndef VP_VELOCITY_TWIST_MATRIX_H
35 #define VP_VELOCITY_TWIST_MATRIX_H
36 
37 #include <visp3/core/vpConfig.h>
38 #include <visp3/core/vpArray2D.h>
39 #include <visp3/core/vpColVector.h>
40 #include <visp3/core/vpHomogeneousMatrix.h>
41 #include <visp3/core/vpRotationMatrix.h>
42 
44 class vpColVector;
46 class vpMatrix;
47 
174 class VISP_EXPORT vpVelocityTwistMatrix : public vpArray2D<double>
175 {
176  friend class vpMatrix;
177 
178 public:
179  // basic constructor
181  // copy constructor
183  // constructor from an homogeneous transformation
184  VP_EXPLICIT vpVelocityTwistMatrix(const vpHomogeneousMatrix &M, bool full = true);
185 
186  // Construction from Translation and rotation (matrix parameterization)
188  // Construction from Translation and rotation (ThetaU parameterization)
190  vpVelocityTwistMatrix(double tx, double ty, double tz, double tux, double tuy, double tuz);
191 
192  VP_EXPLICIT vpVelocityTwistMatrix(const vpRotationMatrix &R);
193  VP_EXPLICIT vpVelocityTwistMatrix(const vpThetaUVector &thetau);
194 
195 #ifdef VISP_BUILD_DEPRECATED_FUNCTIONS
196  VP_DEPRECATED vpVelocityTwistMatrix buildFrom(const vpTranslationVector &t, const vpRotationMatrix &R);
197  VP_DEPRECATED vpVelocityTwistMatrix buildFrom(const vpTranslationVector &t, const vpThetaUVector &thetau);
198  VP_DEPRECATED vpVelocityTwistMatrix buildFrom(const vpHomogeneousMatrix &M, bool full = true);
199  VP_DEPRECATED vpVelocityTwistMatrix buildFrom(const vpRotationMatrix &R);
200  VP_DEPRECATED vpVelocityTwistMatrix buildFrom(const vpThetaUVector &thetau);
201 #endif
203  vpVelocityTwistMatrix &build(const vpTranslationVector &t, const vpThetaUVector &thetau);
204  vpVelocityTwistMatrix &build(const vpHomogeneousMatrix &M, bool full = true);
205  vpVelocityTwistMatrix &build(const vpRotationMatrix &R);
206  vpVelocityTwistMatrix &build(const vpThetaUVector &thetau);
207 
208  void extract(vpRotationMatrix &R) const;
209  void extract(vpTranslationVector &t) const;
210 
211  // Basic initialisation (identity)
212  void eye();
213 
214  vpVelocityTwistMatrix inverse() const;
215  void inverse(vpVelocityTwistMatrix &V) const;
216 
218  vpMatrix operator*(const vpMatrix &M) const;
219  vpColVector operator*(const vpColVector &v) const;
220 
222 
223  int print(std::ostream &s, unsigned int length, char const *intro = 0) const;
224 
230  void resize(unsigned int nrows, unsigned int ncols, bool flagNullify = true)
231  {
232  (void)nrows;
233  (void)ncols;
234  (void)flagNullify;
235  throw(vpException(vpException::fatalError, "Cannot resize a velocity twist matrix"));
236  }
237 
238 #if defined(VISP_BUILD_DEPRECATED_FUNCTIONS)
247  VP_DEPRECATED void init() { }
251  VP_DEPRECATED void setIdentity();
253 #endif
254 };
255 END_VISP_NAMESPACE
256 #endif
Implementation of a generic 2D array used as base class for matrices and vectors.
Definition: vpArray2D.h:145
vpArray2D< Type > & operator=(Type x)
Set all the elements of the array to x.
Definition: vpArray2D.h:523
Implementation of column vector and the associated operations.
Definition: vpColVector.h:191
error that can be emitted by ViSP classes.
Definition: vpException.h:60
@ fatalError
Fatal error.
Definition: vpException.h:72
Implementation of an homogeneous matrix and operations on such kind of matrices.
Implementation of a matrix and operations on matrices.
Definition: vpMatrix.h:169
VP_DEPRECATED void setIdentity(const double &val=1.0)
Definition: vpMatrix.cpp:2062
int print(std::ostream &s, unsigned int length, const std::string &intro="") const
Definition: vpMatrix.cpp:824
vpMatrix operator*(const vpMatrix &B) const
vpMatrix t() const
vpMatrix extract(unsigned int r, unsigned int c, unsigned int nrows, unsigned int ncols) const
Definition: vpMatrix.cpp:424
Implementation of a rotation matrix and operations on such kind of matrices.
Implementation of a rotation vector as axis-angle minimal representation.
Class that consider the case of a translation vector.
VP_DEPRECATED void init()
void resize(unsigned int nrows, unsigned int ncols, bool flagNullify=true)