66 mInertia =
Math::Matrix3d(gyration_radii[0], 0., 0., 0., gyration_radii[1], 0., 0., 0., gyration_radii[2]);
101 if ((other_body.
mMass == 0.) && (other_body.
mInertia == Math::Matrix3d::Zero()))
106 double other_mass = other_body.
mMass;
107 double new_mass =
mMass + other_mass;
111 throw RdlException(
"Error: cannot join bodies as both have zero mass!");
134 Math::Matrix3d inertia_other_com = inertia_other - other_mass * other_com_cross * other_com_cross.transpose();
137 Math::Matrix3d inertia_other_com_rotated = transform.
E.transpose() * inertia_other_com * transform.
E;
148 *
this =
Body(new_mass, new_com, new_inertia);
205 #endif // ifndef RDL_BODY_H Body(const double &mass, const Math::Vector3d &com, const Math::Vector3d &gyration_radii)
Constructs a body from mass, center of mass and radii of gyration.
Describes all properties of a single body.
Math::Vector3d mCenterOfMass
The position of the center of mass in body coordinates.
Math::Matrix3d mInertia
The spatial inertia that contains both mass and inertia information.
Keeps the information of a body and how it is attached to another body.
Body & operator=(const Body &body)
void join(const Math::SpatialTransform &transform, const Body &other_body)
Joins inertial parameters of two bodies to create a composite body.
See V. Duindum p39-40 & Featherstone p32-33.
static Matrix3d toTildeForm(const Point3d &p)
double mMass
The mass of the body.
Math::Matrix3d mInertia
Inertia matrix at the center of mass.
double mMass
The mass of the body.
This class stores a bodies mass, center of mass, and inertia information. The inertia elements are st...
Body(const double &mass, const Math::Vector3d &com, const Math::Matrix3d &inertia_C)
Constructs a body from mass, center of mass, and a 3x3 inertia matrix.
Math::SpatialTransform mBaseTransform
Math::Vector3d mCenterOfMass
The position of the center of mass in body coordinates.
SpatialMatrix toMatrix() const
Matrix3d parallel_axis(const Matrix3d &inertia, double mass, const Vector3d &com)
Translates the inertia matrix to a new center.
unsigned int mMovableParent
Id of the movable body that this fixed body is attached to.
Math::SpatialTransform mParentTransform
Transforms spatial quantities expressed for the parent to the.
Namespace for all structures of the RobotDynamics library.
static FixedBody CreateFromBody(const Body &body)
static RigidBodyInertia createFromMassComInertiaC(double mass, const Vector3d &com, const Matrix3d &inertia_C)