Robotics Library  0.6.2
PlueckerTransform.h
Go to the documentation of this file.
1 //
2 // Copyright (c) 2009, Markus Rickert
3 // All rights reserved.
4 //
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are met:
7 //
8 // * Redistributions of source code must retain the above copyright notice,
9 // this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright notice,
11 // this list of conditions and the following disclaimer in the documentation
12 // and/or other materials provided with the distribution.
13 //
14 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
18 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24 // POSSIBILITY OF SUCH DAMAGE.
25 //
26 
27 #ifndef _RL_MATH_PLUECKERTRANSFORM_H_
28 #define _RL_MATH_PLUECKERTRANSFORM_H_
29 
30 #include <Eigen/Core>
31 #include <Eigen/Geometry>
32 
33 namespace rl
34 {
35  namespace math
36  {
37  namespace spatial
38  {
39  template< typename Scalar > class ArticulatedBodyInertia;
40  template< typename Scalar > class ForceVector;
41  template< typename Scalar > class MotionVector;
42  template< typename Scalar > class RigidBodyInertia;
43 
44  template< typename Scalar >
46  {
47  public:
48  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
49 
50  typedef Scalar ScalarType;
51 
52  typedef ::Eigen::Matrix< Scalar, 6, 6 > MatrixType;
53 
54  typedef ::Eigen::Matrix< Scalar, 3, 3 > RotationType;
55 
57 
58  typedef ::Eigen::Transform< Scalar, 3, ::Eigen::Affine > TransformType;
59 
60  typedef ::Eigen::Matrix< Scalar, 3, 1 > TranslationType;
61 
63 
65  {
66  }
67 
69  {
70  }
71 
73  {
75  res.rotation() = rotation().transpose();
76  res.translation() = -rotation() * translation();
77  return res;
78  }
79 
81  {
82  MatrixType res;
83  res.template topLeftCorner< 3, 3 >() = rotation().transpose();
84  res.template topRightCorner< 3, 3 >() = translation().cross33() * rotation().transpose();
85  res.template bottomLeftCorner< 3, 3 >().setZero();
86  res.template bottomRightCorner< 3, 3 >() = rotation().transpose();
87  return res;
88  }
89 
91  {
92  MatrixType res;
93  res.template topLeftCorner< 3, 3 >() = rotation().transpose();
94  res.template topRightCorner< 3, 3 >().setZero();
95  res.template bottomLeftCorner< 3, 3 >() = translation().cross33() * rotation().transpose();
96  res.template bottomRightCorner< 3, 3 >() = rotation().transpose();
97  return res;
98  }
99 
101  {
102  MatrixType res;
103  res.template topLeftCorner< 3, 3 >() = rotation();
104  res.template topRightCorner< 3, 3 >() = -rotation() * translation().cross33();
105  res.template bottomLeftCorner< 3, 3 >().setZero();
106  res.template bottomRightCorner< 3, 3 >() = rotation();
107  return res;
108  }
109 
111  {
112  MatrixType res;
113  res.template topLeftCorner< 3, 3 >() = rotation();
114  res.template topRightCorner< 3, 3 >().setZero();
115  res.template bottomLeftCorner< 3, 3 >() = -rotation() * translation().cross33();
116  res.template bottomRightCorner< 3, 3 >() = rotation();
117  return res;
118  }
119 
120  template< typename OtherScalar >
122 
123  template< typename OtherScalar >
125 
127  {
128  PlueckerTransform res;
129  res.rotation() = rotation() * other.rotation();
130  res.translation() = other.translation() + other.rotation().transpose() * translation();
131  return res;
132  }
133 
134  template< typename OtherScalar >
136 
137  template< typename OtherScalar >
139 
140  template< typename OtherScalar >
142 
143  template< typename OtherScalar >
145 
146  template< typename OtherScalar >
148 
149  template< typename OtherScalar >
151 
153  {
154  return rotationData;
155  }
156 
158  {
159  return rotationData;
160  }
161 
162  void setIdentity()
163  {
164  rotation().setIdentity();
165  translation().setZero();
166  }
167 
169  {
170  TransformType res;
171  res.linear() = rotation();
172  res.translation() = -rotation() * translation();
173 //res.linear() = rotation().transpose();
174 //res.translation() = translation();
175  return res;
176  }
177 
179  {
180  return translationData;
181  }
182 
184  {
185  return translationData;
186  }
187 
188  protected:
189 
190  private:
192 
194  };
195  }
196  }
197 }
198 
199 #endif // _RL_MATH_PLUECKERTRANSFORM_H_
rl::math::spatial::PlueckerTransform::inverseForce
MatrixType inverseForce() const
Definition: PlueckerTransform.h:80
rl::math::spatial::PlueckerTransform::RotationType
::Eigen::Matrix< Scalar, 3, 3 > RotationType
Definition: PlueckerTransform.h:54
rl::math::spatial::PlueckerTransform::operator*
PlueckerTransform operator*(const PlueckerTransform &other) const
Definition: PlueckerTransform.h:126
rl::math::spatial::PlueckerTransform::ConstRotationType
const RotationType ConstRotationType
Definition: PlueckerTransform.h:56
rl::math::spatial::ArticulatedBodyInertia
Definition: ArticulatedBodyInertia.h:44
rl::math::spatial::RigidBodyInertia
Definition: RigidBodyInertia.h:44
rl::math::spatial::PlueckerTransform::translationData
TranslationType translationData
Definition: PlueckerTransform.h:193
rl::math::spatial::PlueckerTransform::translation
TranslationType & translation()
Definition: PlueckerTransform.h:178
rl::math::spatial::PlueckerTransform::TransformType
::Eigen::Transform< Scalar, 3, ::Eigen::Affine > TransformType
Definition: PlueckerTransform.h:58
rl::math::spatial::PlueckerTransform::rotationData
RotationType rotationData
Definition: PlueckerTransform.h:191
rl::math::spatial::PlueckerTransform::~PlueckerTransform
virtual ~PlueckerTransform()
Definition: PlueckerTransform.h:68
rl::math::spatial::PlueckerTransform::ScalarType
Scalar ScalarType
Definition: PlueckerTransform.h:50
rl::math::spatial::PlueckerTransform::inverseMotion
MatrixType inverseMotion() const
Definition: PlueckerTransform.h:90
rl::math::spatial::PlueckerTransform::matrixForce
MatrixType matrixForce() const
Definition: PlueckerTransform.h:100
rl::math::spatial::PlueckerTransform::rotation
RotationType & rotation()
Definition: PlueckerTransform.h:152
rl::math::RigidBodyInertia
spatial::RigidBodyInertia< Real > RigidBodyInertia
Definition: Spatial.h:59
rl::math::ForceVector
spatial::ForceVector< Real > ForceVector
Definition: Spatial.h:53
rl::math::MotionVector
spatial::MotionVector< Real > MotionVector
Definition: Spatial.h:55
rl::math::spatial::PlueckerTransform::transform
TransformType transform() const
Definition: PlueckerTransform.h:168
rl::math::spatial::PlueckerTransform::ConstTranslationType
const TranslationType ConstTranslationType
Definition: PlueckerTransform.h:62
rl::math::spatial::PlueckerTransform::operator/
ForceVector< OtherScalar > operator/(const ForceVector< OtherScalar > &other) const
Definition: PlueckerTransform.hxx:90
rl::math::spatial::PlueckerTransform::TranslationType
::Eigen::Matrix< Scalar, 3, 1 > TranslationType
Definition: PlueckerTransform.h:60
rl::math::spatial::PlueckerTransform::operator*
ForceVector< OtherScalar > operator*(const ForceVector< OtherScalar > &other) const
Definition: PlueckerTransform.hxx:40
rl::math::spatial::PlueckerTransform::MatrixType
::Eigen::Matrix< Scalar, 6, 6 > MatrixType
Definition: PlueckerTransform.h:52
rl::math::ArticulatedBodyInertia
spatial::ArticulatedBodyInertia< Real > ArticulatedBodyInertia
Definition: Spatial.h:51
rl::math::spatial::PlueckerTransform
Definition: PlueckerTransform.h:46
rl::math::spatial::ForceVector
Definition: ForceVector.h:43
rl::math::spatial::PlueckerTransform::inverse
PlueckerTransform inverse() const
Definition: PlueckerTransform.h:72
rl::math::spatial::PlueckerTransform::translation
ConstTranslationType & translation() const
Definition: PlueckerTransform.h:183
rl::math::spatial::MotionVector
Definition: MotionVector.h:42
rl::math::spatial::PlueckerTransform::rotation
ConstRotationType & rotation() const
Definition: PlueckerTransform.h:157
rl::math::spatial::PlueckerTransform::matrixMotion
MatrixType matrixMotion() const
Definition: PlueckerTransform.h:110
rl::math::spatial::PlueckerTransform::PlueckerTransform
PlueckerTransform()
Definition: PlueckerTransform.h:64
rl::math::spatial::PlueckerTransform::setIdentity
void setIdentity()
Definition: PlueckerTransform.h:162
rl
Definition: Ati.cpp:35