Visual Servoing Platform  version 3.6.1 under development (2024-05-28)
vpForceTwistMatrix.h
1 /*
2  * ViSP, open source Visual Servoing Platform software.
3  * Copyright (C) 2005 - 2023 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  * Twist transformation matrix that allows to transform forces from one
32  * frame to an other.
33  */
34 
35 #ifndef vpForceTwistMatrix_h
36 #define vpForceTwistMatrix_h
37 
38 #include <visp3/core/vpConfig.h>
39 #include <visp3/core/vpArray2D.h>
40 #include <visp3/core/vpColVector.h>
41 #include <visp3/core/vpHomogeneousMatrix.h>
42 #include <visp3/core/vpRotationMatrix.h>
43 
162 class VISP_EXPORT vpForceTwistMatrix : public vpArray2D<double>
163 {
164 public:
165  // basic constructor
167  // copy constructor
169  // constructor from an homogeneous transformation
170  explicit vpForceTwistMatrix(const vpHomogeneousMatrix &M, bool full = true);
171 
172  // Construction from Translation and rotation (matrix parameterization)
174  // Construction from Translation and rotation (ThetaU parameterization)
175  vpForceTwistMatrix(const vpTranslationVector &t, const vpThetaUVector &thetau);
176  vpForceTwistMatrix(double tx, double ty, double tz, double tux, double tuy, double tuz);
177 
178  explicit vpForceTwistMatrix(const vpRotationMatrix &R);
179  explicit vpForceTwistMatrix(const vpThetaUVector &thetau);
180 
181 #if defined(VISP_BUILD_DEPRECATED_FUNCTIONS)
182  vp_deprecated vpForceTwistMatrix buildFrom(const vpTranslationVector &t, const vpRotationMatrix &R);
183  vp_deprecated vpForceTwistMatrix buildFrom(const vpTranslationVector &t, const vpThetaUVector &thetau);
184  vp_deprecated vpForceTwistMatrix buildFrom(const vpHomogeneousMatrix &M, bool full = true);
185 
186  vp_deprecated vpForceTwistMatrix buildFrom(const vpRotationMatrix &R);
187  vp_deprecated vpForceTwistMatrix buildFrom(const vpThetaUVector &thetau);
188 #endif
189  vpForceTwistMatrix &build(const vpTranslationVector &t, const vpRotationMatrix &R);
190  vpForceTwistMatrix &build(const vpTranslationVector &t, const vpThetaUVector &thetau);
191  vpForceTwistMatrix &build(const vpHomogeneousMatrix &M, bool full = true);
192 
193  vpForceTwistMatrix &build(const vpThetaUVector &thetau);
194  vpForceTwistMatrix &build(const vpRotationMatrix &R);
195 
196  // Basic initialisation (identity)
197  void eye();
198 
200  vpMatrix operator*(const vpMatrix &M) const;
201 
202  vpColVector operator*(const vpColVector &H) const;
203 
204  // copy operator from vpMatrix (handle with care)
206 
207  int print(std::ostream &s, unsigned int length, char const *intro = nullptr) const;
208 
214  void resize(unsigned int nrows, unsigned int ncols, bool flagNullify = true)
215  {
216  (void)nrows;
217  (void)ncols;
218  (void)flagNullify;
219  throw(vpException(vpException::fatalError, "Cannot resize a velocity twist matrix"));
220  }
221 
222 #if defined(VISP_BUILD_DEPRECATED_FUNCTIONS)
231  vp_deprecated void init() { }
235  vp_deprecated void setIdentity();
237 #endif
238 };
239 
240 #endif
Implementation of a generic 2D array used as base class for matrices and vectors.
Definition: vpArray2D.h:126
vpArray2D< Type > & operator=(Type x)
Set all the elements of the array to x.
Definition: vpArray2D.h:515
Implementation of column vector and the associated operations.
Definition: vpColVector.h:163
error that can be emitted by ViSP classes.
Definition: vpException.h:59
@ fatalError
Fatal error.
Definition: vpException.h:71
void resize(unsigned int nrows, unsigned int ncols, bool flagNullify=true)
vp_deprecated void init()
Implementation of an homogeneous matrix and operations on such kind of matrices.
Implementation of a matrix and operations on matrices.
Definition: vpMatrix.h:146
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.
vpMatrix operator*(const double &x, const vpMatrix &A)