8 #ifndef __RDL_RIGID_BODY_INERTIA_HPP__ 9 #define __RDL_RIGID_BODY_INERTIA_HPP__ 62 :
m(mass),
h(com_mass),
Ixx(inertia(0, 0)),
Iyx(inertia(1, 0)),
Iyy(inertia(1, 1)),
Izx(inertia(2, 0)),
Izy(inertia(2, 1)),
Izz(inertia(2, 2))
78 : m(m), h(h), Ixx(Ixx), Iyx(Iyx), Iyy(Iyy), Izx(Izx), Izy(Izy), Izz(Izz)
97 this->
set(I.m, I.h, I.Ixx, I.Iyx, I.Iyy, I.Izx, I.Izy, I.Izz);
175 return SpatialMatrix(Ixx -
m(0, 0), Iyx -
m(0, 1), Izx -
m(0, 2), -
m(0, 3), -h[2] -
m(0, 4), h[1] -
m(0, 5), Iyx -
m(1, 0), Iyy -
m(1, 1), Izy -
m(1, 2),
176 h[2] -
m(1, 3), -
m(1, 4), -h[0] -
m(1, 5), Izx -
m(2, 0), Izy -
m(2, 1),
Izz -
m(2, 2), -h[1] -
m(2, 3), h[0] -
m(2, 4), -
m(2, 5), -
m(3, 0),
177 h[2] -
m(3, 1), -h[1] -
m(3, 2), this->m -
m(3, 3), -
m(3, 4), -
m(3, 5), -h[2] -
m(4, 0), -
m(4, 1), h[0] -
m(4, 2), -
m(4, 3),
178 this->m -
m(4, 4), -
m(4, 5), h[1] -
m(5, 0), -h[0] -
m(5, 1), -
m(5, 2), -
m(5, 3), -
m(5, 4), this->m -
m(5, 5));
189 return SpatialVector(Ixx * v[0] + Iyx * v[1] + Izx * v[2] + h[1] * v[5] - h[2] * v[4], Iyx * v[0] + Iyy * v[1] + Izy * v[2] - h[0] * v[5] + h[2] * v[3],
190 Izx * v[0] + Izy * v[1] +
Izz * v[2] + h[0] * v[4] - h[1] * v[3], -h[1] * v[2] + h[2] * v[1] + m * v[3],
191 h[0] * v[2] - h[2] * v[0] + m * v[4], -h[0] * v[1] + h[1] * v[0] + m * v[5]);
278 result.
h = com * mass;
280 result.
Ixx = I(0, 0);
281 result.
Iyx = I(1, 0);
282 result.
Iyy = I(1, 1);
283 result.
Izx = I(2, 0);
284 result.
Izy = I(2, 1);
285 result.
Izz = I(2, 2);
290 typedef std::vector<RigidBodyInertia, Eigen::aligned_allocator<RigidBodyInertia>>
RigidBodyInertiaV;
294 #endif //__SPATIAL_INERTIA_HPP__ RigidBodyInertia transform_copy(const SpatialTransform &X) const
Copy, transform, and return a Math::RigidBodyInertia.
Matrix63 multiplyMatrix63(Matrix63 m) const
A helper method that returns a 6x3 matrix that is a Math::RigidBodyInertia multiplied by a 6x3 matrix...
RigidBodyInertia(double mass, const Vector3d &com_mass, const Matrix3d &inertia)
Constructor.
ForceVector operator*(const SpatialTransform &X, ForceVector f)
Operator for transforming a ForceVector. Calls the ForceVector::transform method. ...
void operator+=(const RigidBodyInertia &rbi)
Overloaded plus-equals operator. Adds two inertia matrices.
FramePoint operator+(FramePoint p, const FrameVector &v)
static Matrix3d toTildeForm(const Point3d &p)
RigidBodyInertia & operator=(const RigidBodyInertia &other)
void createFromMatrix(const SpatialMatrix &Ic)
Create a Math::RigidBodyInertia object from a 6x6 Math::SpatialMatrix.
RigidBodyInertia(double m, const Vector3d &h, const double Ixx, const double Iyx, const double Iyy, const double Izx, const double Izy, const double Izz)
Constructor.
This class stores a bodies mass, center of mass, and inertia information. The inertia elements are st...
SpatialMatrix subtractSpatialMatrix(const SpatialMatrix &m) const
Given Math::RigidBodyInertia ad Math::SpatialMatrix , returns Math::SpatialMatrix such that ...
RigidBodyInertia()
Constructor.
void transform(const SpatialTransform &X)
Transform a Math::RigidBodyInertia matrix.
Eigen::Matrix< double, 6, 3 > Matrix63
SpatialMatrix toMatrix() const
RigidBodyInertia(const RigidBodyInertia &inertia)
Copy constructor.
void setSpatialMatrix(SpatialMatrix &mat) const
Store a Math::RigidBodyInertia in the Math::SpatialMatrix.
Namespace for all structures of the RobotDynamics library.
std::vector< RigidBodyInertia, Eigen::aligned_allocator< RigidBodyInertia > > RigidBodyInertiaV
static RigidBodyInertia createFromMassComInertiaC(double mass, const Vector3d &com, const Matrix3d &inertia_C)
SpatialVector timesSpatialVector(const SpatialVector &v) const
Multiply a Math::RigidBodyInertia by a Math::SpatialVector and return the result as a new Math::Spati...