8 #ifndef __RDL_MOTION_VECTOR_HPP__ 9 #define __RDL_MOTION_VECTOR_HPP__ 31 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.data()[0], v.data()[1], v.data()[2], v.data()[3], v.data()[4], v.data()[5];
93 EIGEN_STRONG_INLINE
double&
wx()
95 return this->data()[0];
102 EIGEN_STRONG_INLINE
double&
wy()
104 return this->data()[1];
111 EIGEN_STRONG_INLINE
double&
wz()
113 return this->data()[2];
120 EIGEN_STRONG_INLINE
double wx()
const 122 return this->data()[0];
129 EIGEN_STRONG_INLINE
double wy()
const 131 return this->data()[1];
138 EIGEN_STRONG_INLINE
double wz()
const 140 return this->data()[2];
147 EIGEN_STRONG_INLINE
double&
vx()
149 return this->data()[3];
156 EIGEN_STRONG_INLINE
double&
vy()
158 return this->data()[4];
165 EIGEN_STRONG_INLINE
double&
vz()
167 return this->data()[5];
174 EIGEN_STRONG_INLINE
double vx()
const 176 return this->data()[3];
183 EIGEN_STRONG_INLINE
double vy()
const 185 return this->data()[4];
192 EIGEN_STRONG_INLINE
double vz()
const 194 return this->data()[5];
203 Vector3d v_rxw(this->data()[3] - X.
r[1] * this->data()[2] + X.
r[2] * this->data()[1], this->data()[4] - X.
r[2] * this->data()[0] + X.
r[0] * this->data()[2],
204 this->data()[5] - X.
r[0] * this->data()[1] + X.
r[1] * this->data()[0]);
206 *
this << X.
E(0, 0) * this->data()[0] + X.
E(0, 1) * this->data()[1] + X.
E(0, 2) * this->data()[2],
207 X.
E(1, 0) * this->data()[0] + X.
E(1, 1) * this->data()[1] + X.
E(1, 2) * this->data()[2],
208 X.
E(2, 0) * this->data()[0] + X.
E(2, 1) * this->data()[1] + X.
E(2, 2) * this->data()[2], X.
E(0, 0) * v_rxw[0] + X.
E(0, 1) * v_rxw[1] + X.
E(0, 2) * v_rxw[2],
209 X.
E(1, 0) * v_rxw[0] + X.
E(1, 1) * v_rxw[1] + X.
E(1, 2) * v_rxw[2], X.
E(2, 0) * v_rxw[0] + X.
E(2, 1) * v_rxw[1] + X.
E(2, 2) * v_rxw[2];
268 return SpatialMatrix(0, -this->data()[2], this->data()[1], 0, 0, 0, this->data()[2], 0, -this->data()[0], 0, 0, 0, -this->data()[1], this->data()[0], 0, 0, 0, 0,
269 0, -this->data()[5], this->data()[4], 0, -this->data()[2], this->data()[1], this->data()[5], 0, -this->data()[3], this->data()[2], 0,
270 -this->data()[0], -this->data()[4], this->data()[3], 0, -this->data()[1], this->data()[0], 0);
279 return SpatialMatrix(0, -this->data()[2], this->data()[1], 0, -this->data()[5], this->data()[4], this->data()[2], 0, -this->data()[0], this->data()[5], 0,
280 -this->data()[3], -this->data()[1], this->data()[0], 0, -this->data()[4], this->data()[3], 0, 0, 0, 0, 0, -this->data()[2], this->data()[1],
281 0, 0, 0, this->data()[2], 0, -this->data()[0], 0, 0, 0, -this->data()[1], this->data()[0], 0);
292 return this->
cross(v);
303 return this->
cross(v);
312 (*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());
337 return v.MotionVector::operator%=(v2);
348 return v.MotionVector::operator%=(v2);
350 typedef std::vector<MotionVector, Eigen::aligned_allocator<MotionVector>>
MotionVectorV;
MotionVector operator%=(const MotionVector &v)
Operator for performing the RBDA operator for two motion vectors, i.e. .
EIGEN_STRONG_INLINE double wy() const
Get a copy of the angular-y component.
EIGEN_STRONG_INLINE double vy() const
Get a copy of the linear-y component.
SpatialMatrix crossm()
Get the spatial motion cross matrix, .
SpatialMatrix crossf()
Get the spatial force cross matrix.
ForceVector operator*(const SpatialTransform &X, ForceVector f)
Operator for transforming a ForceVector. Calls the ForceVector::transform method. ...
EIGEN_STRONG_INLINE SpatialVector toSpatialVector() const
Get a copy of a MotionVector as a SpatialVector.
MotionVector cross(const MotionVector &v)
See V. Duindum thesis p.25 for an explanation of what operator is. It is also in Featherstone p...
EIGEN_STRONG_INLINE double & vz()
Get a reference to the linear-z component.
void transform(const SpatialTransform &X)
Transforms a motion vector. Performs .
A ForceVector is a SpatialVector containing 3 moments and 3 linear forces.
MotionVector & operator=(const MotionVector &other)
Overload equal operator.
EIGEN_STRONG_INLINE double vx() const
Get a copy of the linear-x component.
MotionVector operator%(MotionVector v, const MotionVector &v2)
EIGEN_STRONG_INLINE double & wx()
Get a reference to the angular-x component.
EIGEN_STRONG_INLINE double & wy()
Get a reference to the angular-y component.
EIGEN_STRONG_INLINE double & vx()
Get a reference to the linear-x component.
EIGEN_STRONG_INLINE double wz() const
Get a copy of the angular-z component.
MotionVector(const Eigen::MatrixBase< OtherDerived > &other)
Constructor.
SpatialVector & operator=(const Eigen::MatrixBase< OtherDerived > &other)
MotionVector operator+=(const MotionVector &v)
Overloaded += operator for a MotionVector.
MotionVector(const double v0, const double v1, const double v2, const double v3, const double v4, const double v5)
Constructor.
EIGEN_STRONG_INLINE double vz() const
Get a copy of the linear-z component.
EIGEN_STRONG_INLINE double & wz()
Get a reference to the angular-z component.
EIGEN_STRONG_INLINE double & vy()
Get a reference to the linear-y component.
EIGEN_STRONG_INLINE double wx() const
Get a copy of the angular-x component.
ForceVector operator%=(const ForceVector &v)
Operator for performing the RBDA operator for a motion vector and a force vector, i.e. .
EIGEN_STRONG_INLINE MotionVector()
Empty constructor.
MotionVector transform_copy(const SpatialTransform &X) const
Copies, transforms, and returns a MotionVector. Performs .
std::vector< MotionVector, Eigen::aligned_allocator< MotionVector > > MotionVectorV
Namespace for all structures of the RobotDynamics library.