This class contains the mass, center of mass, and unit inertia matrix of a rigid body B.
More...
|
| MassProperties_ () |
| Create a mass properties object in which the mass, mass center, and inertia are meaningless; you must assign values before using this. More...
|
|
| MassProperties_ (const RealP &m, const Vec3P &com, const InertiaP &inertia) |
| Create a mass properties object from individually supplied mass, mass center, and inertia matrix. More...
|
|
| MassProperties_ (const RealP &m, const Vec3P &com, const UnitInertiaP &gyration) |
| Create a mass properties object from individually supplied mass, mass center, and unit inertia (gyration) matrix. More...
|
|
MassProperties_ & | setMassProperties (const RealP &m, const Vec3P &com, const InertiaP &inertia) |
| Set mass, center of mass, and inertia. More...
|
|
MassProperties_ & | setMassProperties (const RealP &m, const Vec3P &com, const UnitInertiaP &gyration) |
| Set mass, center of mass, and unit inertia. More...
|
|
const RealP & | getMass () const |
| Return the mass currently stored in this MassProperties object. More...
|
|
const Vec3P & | getMassCenter () const |
| Return the mass center currently stored in this MassProperties object; this is expressed in an implicit frame we call "B", and measured from B's origin, but you have to know what that frame is in order to interpret the returned vector. More...
|
|
const UnitInertiaP & | getUnitInertia () const |
| Return the unit inertia currently stored in this MassProperties object; this is expressed in an implicit frame we call "B", and measured about B's origin, but you have to know what that frame is in order to interpret the returned value correctly. More...
|
|
const InertiaP | calcInertia () const |
| Return the inertia matrix for this MassProperties object; this is equal to the unit inertia times the mass and costs 6 flops. More...
|
|
const InertiaP | getInertia () const |
| OBSOLETE – this is just here for compatibility with 2.2; since the UnitInertia is stored now the full inertia must be calculated at a cost of 6 flops, hence the method name should be calcInertia() and that's what you should use unless you want getUnitInertia(). More...
|
|
InertiaP | calcCentralInertia () const |
| Return the inertia of this MassProperties object, but measured about the mass center rather than about the (implicit) B frame origin. More...
|
|
InertiaP | calcShiftedInertia (const Vec3P &newOriginB) const |
| Return the inertia of this MassProperties object, but with the "measured
about" point shifted from the (implicit) B frame origin to a new point that is supplied in newOriginB which must be a vector measured from the B frame origin and expressed in B. More...
|
|
InertiaP | calcTransformedInertia (const TransformP &X_BC) const |
| Return the inertia of this MassProperties object, but transformed to from the implicit B frame to a new frame C whose pose relative to B is supplied. More...
|
|
MassProperties_ | calcShiftedMassProps (const Vec3P &newOriginB) const |
| Return a new MassProperties object that is the same as this one but with the origin point shifted from the (implicit) B frame origin to a new point that is supplied in newOriginB which must be a vector measured from the B frame origin and expressed in B. More...
|
|
MassProperties_ | calcTransformedMassProps (const TransformP &X_BC) const |
| Transform these mass properties from the current frame "B" to a new frame "C", given the pose of C in B. Caution: this shifts the point from which the mass properties are measured from the origin of B to the origin of C. More...
|
|
MassProperties_ | reexpress (const RotationP &R_BC) const |
| Re-express these mass properties from the current frame "B" to a new frame "C", given the orientation of C in B. Caution: this does not shift the point from which the mass properties are measured, it just uses a different frame to express that measurement. More...
|
|
bool | isExactlyMassless () const |
| Return true only if the mass stored here is exactly zero. If the mass resulted from a computation, you should use isNearlyMassless() instead. More...
|
|
bool | isNearlyMassless (const RealP &tol=SignificantReal) const |
| Return true if the mass stored here is zero to within a small tolerance. More...
|
|
bool | isExactlyCentral () const |
| Return true only if the mass center stored here is exactly zero. If the mass center resulted from a computation, you should use isNearlyCentral() instead. More...
|
|
bool | isNearlyCentral (const RealP &tol=SignificantReal) const |
| Return true if the mass center stored here is zero to within a small tolerance. More...
|
|
bool | isNaN () const |
| Return true if any element of this MassProperties object is NaN. More...
|
|
bool | isInf () const |
| Return true only if there are no NaN's in this MassProperties object, and at least one of the elements is Infinity. Ground's mass properties satisfy these conditions. More...
|
|
bool | isFinite () const |
| Return true if none of the elements of this MassProperties object are NaN or Infinity. Note that Ground's mass properties are not finite. More...
|
|
SpatialMatP | toSpatialMat () const |
| Convert this MassProperties object to a spatial inertia matrix and return it as a SpatialMat, which is a 2x2 matrix of 3x3 submatrices. More...
|
|
Mat66P | toMat66 () const |
| Convert this MassProperties object to a spatial inertia matrix in the form of an ordinary 6x6 matrix, not a SpatialMat. More...
|
|
template<class P>
class SimTK::MassProperties_< P >
This class contains the mass, center of mass, and unit inertia matrix of a rigid body B.
The center of mass is a vector from B's origin, expressed in the B frame. The inertia is taken about the B origin, and expressed in B. The frame B is implicit; only the measurements are stored here. The unit inertia can be multiplied by the mass to get the inertia matrix for the body.
Abbreviations
Typedefs exist for the most common invocations of MassProperties_<P>:
template<class P >
static std::ostream & operator<< |
( |
std::ostream & |
o, |
|
|
const MassProperties_< P > & |
mp |
|
) |
| |
|
related |
Output a human-readable representation of a MassProperties object to the given output stream.
This is assumed to be the mass properties of some body B. We'll show B's mass, center of mass as a vector from B's origin, expressed in B, and unit inertia, abbreviated Uxx, Uyy, and so on so that you won't accidentally think these are mass-scaled inertias normally designated Ixx, Iyy, etc. Note that I=mass*U in these terms. Also note that the unit inertia is taken about the body frame origin, not about the center of mass. And of course the unit inertia is expressed in B.