Visual Servoing Platform  version 3.6.1 under development (2024-07-27)
vpForceTwistMatrix.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  * Twist transformation matrix that allows to transform forces from one
32  * frame to an other.
33  */
34 
35 #ifndef VP_FORCE_TWIST_MATRIX_H
36 #define VP_FORCE_TWIST_MATRIX_H
37 
38 #include <visp3/core/vpConfig.h>
39 
41 class vpMatrix;
42 END_VISP_NAMESPACE
43 
44 #include <visp3/core/vpConfig.h>
45 #include <visp3/core/vpArray2D.h>
46 #include <visp3/core/vpColVector.h>
47 #include <visp3/core/vpHomogeneousMatrix.h>
48 #include <visp3/core/vpRotationMatrix.h>
49 
181 class VISP_EXPORT vpForceTwistMatrix : public vpArray2D<double>
182 {
183 public:
184  // basic constructor
186  // copy constructor
188  // constructor from an homogeneous transformation
189  VP_EXPLICIT vpForceTwistMatrix(const vpHomogeneousMatrix &M, bool full = true);
190 
191  // Construction from Translation and rotation (matrix parameterization)
193  // Construction from Translation and rotation (ThetaU parameterization)
194  vpForceTwistMatrix(const vpTranslationVector &t, const vpThetaUVector &thetau);
195  vpForceTwistMatrix(double tx, double ty, double tz, double tux, double tuy, double tuz);
196 
197  VP_EXPLICIT vpForceTwistMatrix(const vpRotationMatrix &R);
198  VP_EXPLICIT vpForceTwistMatrix(const vpThetaUVector &thetau);
199 
200 #if defined(VISP_BUILD_DEPRECATED_FUNCTIONS)
201  VP_DEPRECATED vpForceTwistMatrix buildFrom(const vpTranslationVector &t, const vpRotationMatrix &R);
202  VP_DEPRECATED vpForceTwistMatrix buildFrom(const vpTranslationVector &t, const vpThetaUVector &thetau);
203  VP_DEPRECATED vpForceTwistMatrix buildFrom(const vpHomogeneousMatrix &M, bool full = true);
204 
205  VP_DEPRECATED vpForceTwistMatrix buildFrom(const vpRotationMatrix &R);
206  VP_DEPRECATED vpForceTwistMatrix buildFrom(const vpThetaUVector &thetau);
207 #endif
208  vpForceTwistMatrix &build(const vpTranslationVector &t, const vpRotationMatrix &R);
209  vpForceTwistMatrix &build(const vpTranslationVector &t, const vpThetaUVector &thetau);
210  vpForceTwistMatrix &build(const vpHomogeneousMatrix &M, bool full = true);
211 
212  vpForceTwistMatrix &build(const vpThetaUVector &thetau);
213  vpForceTwistMatrix &build(const vpRotationMatrix &R);
214 
215  // Basic initialisation (identity)
216  void eye();
217 
219  vpMatrix operator*(const vpMatrix &M) const;
220 
221  vpColVector operator*(const vpColVector &H) const;
222 
223  // copy operator from vpMatrix (handle with care)
225 
226  int print(std::ostream &s, unsigned int length, char const *intro = nullptr) const;
227 
233  void resize(unsigned int nrows, unsigned int ncols, bool flagNullify = true)
234  {
235  (void)nrows;
236  (void)ncols;
237  (void)flagNullify;
238  throw(vpException(vpException::fatalError, "Cannot resize a velocity twist matrix"));
239  }
240 
241 #if defined(VISP_BUILD_DEPRECATED_FUNCTIONS)
250  VP_DEPRECATED void init() { }
254  VP_DEPRECATED void setIdentity();
256 #endif
257 };
258 END_VISP_NAMESPACE
259 #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
VP_DEPRECATED void init()
void resize(unsigned int nrows, unsigned int ncols, bool flagNullify=true)
Implementation of an homogeneous matrix and operations on such kind of matrices.
Implementation of a matrix and operations on matrices.
Definition: vpMatrix.h:169
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)