31 mCenterOfMass (0., 0., 0.),
37 mCenterOfMass (body.mCenterOfMass),
38 mInertia (body.mInertia),
39 mIsVirtual (body.mIsVirtual)
72 gyration_radii[0], 0., 0.,
73 0., gyration_radii[1], 0.,
74 0., 0., gyration_radii[2]
95 mIsVirtual (false) { }
110#ifndef RBDL_USE_CASADI_MATH
112 if (other_body.
mMass == 0. && other_body.
mInertia == Math::Matrix3d::Zero()) {
120#ifndef RBDL_USE_CASADI_MATH
121 if (new_mass == 0.) {
128 Math::Vector3d new_com = (1 / new_mass ) * (mMass * mCenterOfMass + other_mass *
131 LOG <<
"other_com = " << std::endl << other_com.transpose() << std::endl;
132 LOG <<
"rotation = " << std::endl << transform.
E << std::endl;
152 LOG <<
"inertia_other = " << std::endl << inertia_other << std::endl;
157 Math::Matrix3d inertia_other_com = inertia_other - other_mass * other_com_cross
158 * other_com_cross.transpose();
159 LOG <<
"inertia_other_com = " << std::endl << inertia_other_com << std::endl;
163 inertia_other_com * transform.
E;
164 LOG <<
"inertia_other_com_rotated = " << std::endl << inertia_other_com_rotated
169 inertia_other_com_rotated, other_mass, other_com);
170 LOG <<
"inertia_other_com_rotated_this_origin = " << std::endl <<
171 inertia_other_com_rotated_this_origin << std::endl;
175 (0,0)) + inertia_other_com_rotated_this_origin;
176 LOG <<
"inertia_summed = " << std::endl << inertia_summed << std::endl;
181 new_com).transpose();
183 LOG <<
"new_mass = " << new_mass << std::endl;
184 LOG <<
"new_com = " << new_com.transpose() << std::endl;
185 LOG <<
"new_inertia = " << std::endl << new_inertia << std::endl;
187 *
this =
Body (new_mass, new_com, new_inertia);
Base class for all RBDL exceptions.
Matrix3d VectorCrossMatrix(const Vector3d &vector)
RBDL_DLLAPI Matrix3d parallel_axis(const Matrix3d &inertia, Scalar mass, const Vector3d &com)
Translates the inertia matrix to a new center.
Describes all properties of a single body.
Math::Matrix3d mInertia
Inertia matrix at the center of mass.
Body(const Math::Scalar &mass, const Math::Vector3d &com, const Math::Vector3d &gyration_radii)
Constructs a body from mass, center of mass and radii of gyration.
void Join(const Math::SpatialTransform &transform, const Body &other_body)
Joins inertial parameters of two bodies to create a composite body.
Math::Vector3d mCenterOfMass
The position of the center of mass in body coordinates.
Body(const Math::Scalar &mass, const Math::Vector3d &com, const Math::Matrix3d &inertia_C)
Constructs a body from mass, center of mass, and a 3x3 inertia matrix.
Math::Scalar mMass
The mass of the body.
Keeps the information of a body and how it is attached to another body.
Math::Matrix3d mInertia
The spatial inertia that contains both mass and inertia information.
static FixedBody CreateFromBody(const Body &body)
Math::SpatialTransform mBaseTransform
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.
Math::Vector3d mCenterOfMass
The position of the center of mass in body coordinates.
Math::Scalar mMass
The mass of the body.
Compact representation for Spatial Inertia.
static SpatialRigidBodyInertia createFromMassComInertiaC(Scalar mass, const Vector3d &com, const Matrix3d &inertia_C)
SpatialMatrix toMatrix() const
Compact representation of spatial transformations.