5 #ifndef __RDL_MOTION_VECTOR_HPP__
6 #define __RDL_MOTION_VECTOR_HPP__
27 template <
typename OtherDerived>
64 MotionVector(
const double v0,
const double v1,
const double v2,
const double v3,
const double v4,
const double v5)
66 Base::_check_template_params();
68 (*this) << v0, v1, v2, v3, v4, v5;
86 (*this) << v[0], v[1], v[2], v[3], v[4], v[5];
93 EIGEN_STRONG_INLINE
double&
wx()
95 return this->operator[](0);
102 EIGEN_STRONG_INLINE
double&
wy()
104 return this->operator[](1);
111 EIGEN_STRONG_INLINE
double&
wz()
113 return this->operator[](2);
120 EIGEN_STRONG_INLINE
double wx()
const
122 return this->operator[](0);
129 EIGEN_STRONG_INLINE
double wy()
const
131 return this->operator[](1);
138 EIGEN_STRONG_INLINE
double wz()
const
140 return this->operator[](2);
147 EIGEN_STRONG_INLINE
double&
vx()
149 return this->operator[](3);
156 EIGEN_STRONG_INLINE
double&
vy()
158 return this->operator[](4);
165 EIGEN_STRONG_INLINE
double&
vz()
167 return this->operator[](5);
174 EIGEN_STRONG_INLINE
double vx()
const
176 return this->operator[](3);
183 EIGEN_STRONG_INLINE
double vy()
const
185 return this->operator[](4);
192 EIGEN_STRONG_INLINE
double vz()
const
194 return this->operator[](5);
203 this->
setLinearPart(-X.
E * X.
r.cross(this->getAngularPart()) + X.
E * this->getLinearPart());
263 return SpatialMatrix(0, -this->
operator[](2), this->
operator[](1), 0, 0, 0, this->
operator[](2), 0, -this->
operator[](0), 0, 0, 0, -this->
operator[](1),
264 this->
operator[](0), 0, 0, 0, 0, 0, -this->
operator[](5), this->
operator[](4), 0, -this->
operator[](2), this->
operator[](1),
265 this->
operator[](5), 0, -this->
operator[](3), this->
operator[](2), 0, -this->
operator[](0), -this->
operator[](4), this->
operator[](3), 0,
266 -this->
operator[](1), this->
operator[](0), 0);
275 return SpatialMatrix(0, -this->
operator[](2), this->
operator[](1), 0, -this->
operator[](5), this->
operator[](4), this->
operator[](2), 0, -this->
operator[](0),
276 this->
operator[](5), 0, -this->
operator[](3), -this->
operator[](1), this->
operator[](0), 0, -this->
operator[](4), this->
operator[](3), 0, 0,
277 0, 0, 0, -this->
operator[](2), this->
operator[](1), 0, 0, 0, this->
operator[](2), 0, -this->
operator[](0), 0, 0, 0, -this->
operator[](1),
278 this->
operator[](0), 0);
289 return this->
cross(v);
300 return this->
cross(v);
309 (*this) << (this->
wx() += v.
wx()), (this->
wy() += v.
wy()), (this->
wz() += v.
wz()), (this->
vx() += v.
vx()), (this->
vy() += v.
vy()), (this->
vz() += v.
vz());
334 return v.MotionVector::operator%=(v2);
345 return v.MotionVector::operator%=(v2);
347 typedef std::vector<MotionVector, Eigen::aligned_allocator<MotionVector>>
MotionVectorV;
Contains various geometric objects that have methods for transforming themselves into different frame...
A ForceVector is a SpatialVector containing 3 moments and 3 linear forces.
Definition: ForceVector.hpp:23
Definition: MotionVector.hpp:21
MotionVector(const Eigen::MatrixBase< OtherDerived > &other)
Constructor.
Definition: MotionVector.hpp:29
EIGEN_STRONG_INLINE double vx() const
Get a copy of the linear-x component.
Definition: MotionVector.hpp:174
EIGEN_STRONG_INLINE double & vy()
Get a reference to the linear-y component.
Definition: MotionVector.hpp:156
SpatialMatrix crossm()
Get the spatial motion cross matrix,.
Definition: MotionVector.hpp:261
MotionVector operator%=(const MotionVector &v)
Operator for performing the RBDA operator for two motion vectors, i.e. .
Definition: MotionVector.hpp:287
EIGEN_STRONG_INLINE double vy() const
Get a copy of the linear-y component.
Definition: MotionVector.hpp:183
EIGEN_STRONG_INLINE double & wy()
Get a reference to the angular-y component.
Definition: MotionVector.hpp:102
ForceVector operator%=(const ForceVector &v)
Operator for performing the RBDA operator for a motion vector and a force vector,...
Definition: MotionVector.hpp:298
MotionVector(const double v0, const double v1, const double v2, const double v3, const double v4, const double v5)
Constructor.
Definition: MotionVector.hpp:64
EIGEN_STRONG_INLINE double & vx()
Get a reference to the linear-x component.
Definition: MotionVector.hpp:147
EIGEN_STRONG_INLINE double vz() const
Get a copy of the linear-z component.
Definition: MotionVector.hpp:192
EIGEN_STRONG_INLINE SpatialVector toSpatialVector() const
Get a copy of a MotionVector as a SpatialVector.
Definition: MotionVector.hpp:75
MotionVector & operator=(const MotionVector &other)
Overload equal operator.
Definition: MotionVector.hpp:42
MotionVector operator+=(const MotionVector &v)
Overloaded += operator for a MotionVector.
Definition: MotionVector.hpp:307
EIGEN_STRONG_INLINE double wz() const
Get a copy of the angular-z component.
Definition: MotionVector.hpp:138
SpatialMatrix crossf()
Get the spatial force cross matrix.
Definition: MotionVector.hpp:273
void transform(const SpatialTransform &X)
Transforms a motion vector. Performs .
Definition: MotionVector.hpp:201
EIGEN_STRONG_INLINE MotionVector()
Empty constructor.
Definition: MotionVector.hpp:51
EIGEN_STRONG_INLINE double wy() const
Get a copy of the angular-y component.
Definition: MotionVector.hpp:129
EIGEN_STRONG_INLINE double wx() const
Get a copy of the angular-x component.
Definition: MotionVector.hpp:120
EIGEN_STRONG_INLINE double & vz()
Get a reference to the linear-z component.
Definition: MotionVector.hpp:165
MotionVector cross(const MotionVector &v)
See V. Duindum thesis p.25 for an explanation of what operator is. It is also in Featherstone p....
Definition: MotionVector.cpp:11
MotionVector transform_copy(const SpatialTransform &X) const
Copies, transforms, and returns a MotionVector. Performs .
Definition: MotionVector.hpp:212
MotionVector(const MotionVector &v)
Definition: MotionVector.hpp:33
EIGEN_STRONG_INLINE void set(const MotionVector &v)
Setter.
Definition: MotionVector.hpp:84
EIGEN_STRONG_INLINE double & wz()
Get a reference to the angular-z component.
Definition: MotionVector.hpp:111
EIGEN_STRONG_INLINE double & wx()
Get a reference to the angular-x component.
Definition: MotionVector.hpp:93
Definition: rdl_eigenmath.hpp:354
Definition: rdl_eigenmath.hpp:187
SpatialVector & operator=(const Eigen::MatrixBase< OtherDerived > &other)
Definition: rdl_eigenmath.hpp:198
void setLinearPart(const Vector3d &v)
Definition: rdl_eigenmath.hpp:266
void setAngularPart(const Vector3d &v)
Definition: rdl_eigenmath.hpp:254
MotionVector operator%(MotionVector v, const MotionVector &v2)
Definition: MotionVector.hpp:332
std::vector< MotionVector, Eigen::aligned_allocator< MotionVector > > MotionVectorV
Definition: MotionVector.hpp:347
ForceVector operator*(const SpatialTransform &X, ForceVector f)
Operator for transforming a ForceVector. Calls the ForceVector::transform method.
Definition: ForceVector.hpp:248
Namespace for all structures of the RobotDynamics library.
Definition: examples.hpp:19