5 #ifndef __RDL_MOMENTUM_HPP__
6 #define __RDL_MOMENTUM_HPP__
31 Momentum(
const double kx,
const double ky,
const double kz,
const double lx,
const double ly,
const double lz) :
ForceVector(
kx,
ky,
kz,
lx,
ly,
lz)
76 EIGEN_STRONG_INLINE
double&
kx()
78 return this->operator[](0);
81 EIGEN_STRONG_INLINE
double&
ky()
83 return this->operator[](1);
86 EIGEN_STRONG_INLINE
double&
kz()
88 return this->operator[](2);
91 EIGEN_STRONG_INLINE
double kx()
const
93 return this->operator[](0);
96 EIGEN_STRONG_INLINE
double ky()
const
98 return this->operator[](1);
101 EIGEN_STRONG_INLINE
double kz()
const
103 return this->operator[](2);
106 EIGEN_STRONG_INLINE
double&
lx()
108 return this->operator[](3);
111 EIGEN_STRONG_INLINE
double&
ly()
113 return this->operator[](4);
116 EIGEN_STRONG_INLINE
double&
lz()
118 return this->operator[](5);
121 EIGEN_STRONG_INLINE
double lx()
const
123 return this->operator[](3);
126 EIGEN_STRONG_INLINE
double ly()
const
128 return this->operator[](4);
131 EIGEN_STRONG_INLINE
double lz()
const
133 return this->operator[](5);
142 (*this) << (this->
mx() += v.
mx()), (this->
my() += v.
my()), (this->
mz() += v.
mz()), (this->
fx() += v.
fx()), (this->
fy() += v.
fy()), (this->
fz() += v.
fz());
152 (*this) << (this->
mx() -= v.
mx()), (this->
my() -= v.
my()), (this->
mz() -= v.
mz()), (this->
fx() -= v.
fx()), (this->
fy() -= v.
fy()), (this->
fz() -= v.
fz());
164 return this->dot(vector) * 0.5;
174 return Momentum(I.
Ixx * v[0] + I.
Iyx * v[1] + I.
Izx * v[2] + I.
h[1] * v[5] - I.
h[2] * v[4],
175 I.
Iyx * v[0] + I.
Iyy * v[1] + I.
Izy * v[2] - I.
h[0] * v[5] + I.
h[2] * v[3],
176 I.
Izx * v[0] + I.
Izy * v[1] + I.
Izz * v[2] + I.
h[0] * v[4] - I.
h[1] * v[3], -I.
h[1] * v[2] + I.
h[2] * v[1] + I.
m * v[3],
177 I.
h[0] * v[2] - I.
h[2] * v[0] + I.
m * v[4], -I.
h[0] * v[1] + I.
h[1] * v[0] + I.
m * v[5]);
Contains various geometric objects that have methods for transforming themselves into different frame...
Contains various geometric objects that have methods for transforming themselves into different frame...
See V. Duindum p39-40 & Featherstone p32-33.
A ForceVector is a SpatialVector containing 3 moments and 3 linear forces.
Definition: ForceVector.hpp:23
EIGEN_STRONG_INLINE double & fx()
Get reference to x-linear component.
Definition: ForceVector.hpp:145
EIGEN_STRONG_INLINE double & my()
Get reference to y-angular component.
Definition: ForceVector.hpp:100
EIGEN_STRONG_INLINE double & fy()
Get reference to y-linear component.
Definition: ForceVector.hpp:154
EIGEN_STRONG_INLINE double & mz()
Get reference to z-angular component.
Definition: ForceVector.hpp:109
EIGEN_STRONG_INLINE double & fz()
Get reference to z-linear component.
Definition: ForceVector.hpp:163
void transform(const SpatialTransform &X)
Performs the following in place transform.
Definition: ForceVector.hpp:206
EIGEN_STRONG_INLINE double & mx()
Get reference to x-angular component.
Definition: ForceVector.hpp:91
Momentum is mass/inertia multiplied by velocity.
Definition: Momentum.hpp:25
Momentum & operator=(const Momentum &m)
Definition: Momentum.hpp:47
Momentum(const double kx, const double ky, const double kz, const double lx, const double ly, const double lz)
Definition: Momentum.hpp:31
Momentum operator-=(const Momentum &v)
Overloaded plus-equals operator.
Definition: Momentum.hpp:150
EIGEN_STRONG_INLINE double kx() const
Definition: Momentum.hpp:91
EIGEN_STRONG_INLINE double & kz()
Definition: Momentum.hpp:86
EIGEN_STRONG_INLINE double & lz()
Definition: Momentum.hpp:116
static Momentum computeMomentum(const RigidBodyInertia &I, const MotionVector &v)
Computes momentum from inertia and velocity.
Definition: Momentum.hpp:172
EIGEN_STRONG_INLINE double operator*(const MotionVector &vector)
Operator for computing kinetic energy. With momentum, and Math::MotionVector, this performs perform...
Definition: Momentum.hpp:162
Momentum(const ForceVector &forceVector)
Definition: Momentum.hpp:43
EIGEN_STRONG_INLINE double & lx()
Definition: Momentum.hpp:106
EIGEN_STRONG_INLINE double ky() const
Definition: Momentum.hpp:96
Momentum(const RigidBodyInertia &inertia, const MotionVector &vector)
Definition: Momentum.hpp:53
Momentum operator+=(const Momentum &v)
Overloaded plus-equals operator.
Definition: Momentum.hpp:140
Momentum(const Vector3d &k, const Vector3d l)
Definition: Momentum.hpp:35
Momentum()
Definition: Momentum.hpp:27
EIGEN_STRONG_INLINE double lz() const
Definition: Momentum.hpp:131
EIGEN_STRONG_INLINE double & kx()
Definition: Momentum.hpp:76
Momentum(const Momentum &momentum)
Definition: Momentum.hpp:39
Momentum transform_copy(const SpatialTransform &X) const
Copy then transform a ForceVector by.
Definition: Momentum.hpp:69
EIGEN_STRONG_INLINE double & ky()
Definition: Momentum.hpp:81
EIGEN_STRONG_INLINE double lx() const
Definition: Momentum.hpp:121
EIGEN_STRONG_INLINE double & ly()
Definition: Momentum.hpp:111
EIGEN_STRONG_INLINE double kz() const
Definition: Momentum.hpp:101
EIGEN_STRONG_INLINE double ly() const
Definition: Momentum.hpp:126
Definition: MotionVector.hpp:21
This class stores a bodies mass, center of mass, and inertia information. The inertia elements are st...
Definition: RigidBodyInertia.hpp:42
Vector3d h
Definition: RigidBodyInertia.hpp:218
double Iyx
Definition: RigidBodyInertia.hpp:221
double Izz
Definition: RigidBodyInertia.hpp:225
double m
Definition: RigidBodyInertia.hpp:216
double Izy
Definition: RigidBodyInertia.hpp:224
double Iyy
Definition: RigidBodyInertia.hpp:222
double Izx
Definition: RigidBodyInertia.hpp:223
double Ixx
Definition: RigidBodyInertia.hpp:220
SpatialVector & operator=(const Eigen::MatrixBase< OtherDerived > &other)
Definition: rdl_eigenmath.hpp:198
Definition: rdl_eigenmath.hpp:54
FramePoint operator-(FramePoint p, const FrameVector &v)
Definition: FramePoint.hpp:410
FramePoint operator+(FramePoint p, const FrameVector &v)
Definition: FramePoint.hpp:404
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