The physical meaning of an inertia is the distribution of a rigid body's mass about a particular point.
More...
|
| Inertia_ () |
| Default is a NaN-ed out mess to avoid accidents, even in Release mode. More...
|
|
| Inertia_ (const P &moment) |
| Create a principal inertia matrix with identical diagonal elements, like a sphere where moment=2/5 m r^2, or a cube where moment=1/6 m s^2, with m the total mass, r the sphere's radius and s the length of a side of the cube. More...
|
|
| Inertia_ (const Vec< 3, P > &p, const P &mass) |
| Create an Inertia matrix for a point mass at a given location, measured from the origin OF of the implicit frame F, and expressed in F. More...
|
|
| Inertia_ (const Vec< 3, P > &moments, const Vec< 3, P > &products=Vec< 3, P >(0)) |
| Create an inertia matrix from a vector of the moments of inertia (the inertia matrix diagonal) and optionally a vector of the products of inertia (the off-diagonals). More...
|
|
| Inertia_ (const P &xx, const P &yy, const P &zz) |
| Create a principal inertia matrix (only non-zero on diagonal). More...
|
|
| Inertia_ (const P &xx, const P &yy, const P &zz, const P &xy, const P &xz, const P &yz) |
| This is a general inertia matrix. More...
|
|
| Inertia_ (const SymMat< 3, P > &inertia) |
| Construct an Inertia from a symmetric 3x3 matrix. More...
|
|
| Inertia_ (const Mat< 3, 3, P > &m) |
| Construct an Inertia matrix from a 3x3 symmetric matrix. More...
|
|
Inertia_ & | setInertia (const P &xx, const P &yy, const P &zz) |
| Set an inertia matrix to have only principal moments (that is, it will be diagonal). More...
|
|
Inertia_ & | setInertia (const Vec< 3, P > &moments, const Vec< 3, P > &products=Vec< 3, P >(0)) |
| Set principal moments and optionally off-diagonal terms. More...
|
|
Inertia_ & | setInertia (const P &xx, const P &yy, const P &zz, const P &xy, const P &xz, const P &yz) |
| Set this Inertia to a general matrix. More...
|
|
Inertia_ & | operator+= (const Inertia_ &inertia) |
| Add in another inertia matrix. More...
|
|
Inertia_ & | operator-= (const Inertia_ &inertia) |
| Subtract off another inertia matrix. More...
|
|
Inertia_ & | operator*= (const P &s) |
| Multiply this inertia matrix by a scalar. Cost is 6 flops. More...
|
|
Inertia_ & | operator/= (const P &s) |
| Divide this inertia matrix by a scalar. More...
|
|
Inertia_ | shiftToMassCenter (const Vec< 3, P > &CF, const P &mass) const |
| Assume that the current inertia is about the F frame's origin OF, and expressed in F. More...
|
|
Inertia_ & | shiftToMassCenterInPlace (const Vec< 3, P > &CF, const P &mass) |
| Assume that the current inertia is about the F frame's origin OF, and expressed in F. More...
|
|
Inertia_ | shiftFromMassCenter (const Vec< 3, P > &p, const P &mass) const |
| Assuming that the current inertia I is a central inertia (that is, it is inertia about the body center of mass CF), shift it to some other point p measured from the center of mass. More...
|
|
Inertia_ & | shiftFromMassCenterInPlace (const Vec< 3, P > &p, const P &mass) |
| Assuming that the current inertia I is a central inertia (that is, it is inertia about the body center of mass CF), shift it to some other point p measured from the center of mass. More...
|
|
Inertia_ | reexpress (const Rotation_< P > &R_FB) const |
| Return a new inertia matrix like this one but re-expressed in another frame (leaving the origin point unchanged). More...
|
|
Inertia_ | reexpress (const InverseRotation_< P > &R_FB) const |
| Rexpress using an inverse rotation to avoid having to convert it. More...
|
|
Inertia_ & | reexpressInPlace (const Rotation_< P > &R_FB) |
| Re-express this inertia matrix in another frame, changing the object in place; see reexpress() if you want to leave this object unmolested and get a new one instead. More...
|
|
Inertia_ & | reexpressInPlace (const InverseRotation_< P > &R_FB) |
| Rexpress in place using an inverse rotation to avoid having to convert it. More...
|
|
P | trace () const |
|
| operator const SymMat< 3, P > & () const |
| This is an implicit conversion to a const SymMat33. More...
|
|
const SymMat< 3, P > & | asSymMat33 () const |
| Obtain a reference to the underlying symmetric matrix type. More...
|
|
Mat< 3, 3, P > | toMat33 () const |
| Expand the internal packed representation into a full 3x3 symmetric matrix with all elements set. More...
|
|
const Vec< 3, P > & | getMoments () const |
| Obtain the inertia moments (diagonal of the Inertia matrix) as a Vec3 ordered xx, yy, zz. More...
|
|
const Vec< 3, P > & | getProducts () const |
| Obtain the inertia products (off-diagonals of the Inertia matrix) as a Vec3 with elements ordered xy, xz, yz. More...
|
|
bool | isNaN () const |
|
bool | isInf () const |
|
bool | isFinite () const |
|
bool | isNumericallyEqual (const Inertia_< P > &other) const |
| Compare this inertia matrix with another one and return true if they are close to within a default numerical tolerance. More...
|
|
bool | isNumericallyEqual (const Inertia_< P > &other, double tol) const |
| Compare this inertia matrix with another one and return true if they are close to within a specified numerical tolerance. More...
|
|
|
static bool | isValidInertiaMatrix (const SymMat< 3, P > &m) |
| Test some conditions that must hold for a valid Inertia matrix. More...
|
|
static Inertia_ | pointMassAtOrigin () |
| Create an Inertia matrix for a point located at the origin – that is, an all-zero matrix. More...
|
|
static Inertia_ | pointMassAt (const Vec< 3, P > &p, const P &m) |
| Create an Inertia matrix for a point of a given mass, located at a given location measured from the origin of the implicit F frame. More...
|
|
|
These return UnitInertia matrices (inertias of unit-mass objects) converted to Inertias.
Multiply the result by the actual mass to get the Inertia of an actual object of this shape. See the UnitInertia class for more information.
|
static Inertia_ | sphere (const P &r) |
| Create a UnitInertia matrix for a unit mass sphere of radius r centered at the origin. More...
|
|
static Inertia_ | cylinderAlongZ (const P &r, const P &hz) |
| Unit-mass cylinder aligned along z axis; use radius and half-length. More...
|
|
static Inertia_ | cylinderAlongY (const P &r, const P &hy) |
| Unit-mass cylinder aligned along y axis; use radius and half-length. More...
|
|
static Inertia_ | cylinderAlongX (const P &r, const P &hx) |
| Unit-mass cylinder aligned along x axis; use radius and half-length. More...
|
|
static Inertia_ | brick (const P &hx, const P &hy, const P &hz) |
| Unit-mass brick given by half-lengths in each direction. More...
|
|
static Inertia_ | brick (const Vec< 3, P > &halfLengths) |
| Alternate interface to brick() that takes a Vec3 for the half lengths. More...
|
|
static Inertia_ | ellipsoid (const P &hx, const P &hy, const P &hz) |
| Unit-mass ellipsoid given by half-lengths in each direction. More...
|
|
static Inertia_ | ellipsoid (const Vec< 3, P > &halfLengths) |
| Alternate interface to ellipsoid() that takes a Vec3 for the half lengths. More...
|
|
|
(Note that these are not member functions.)
|
template<class P > |
Inertia_< P > | operator+ (const Inertia_< P > &l, const Inertia_< P > &r) |
| Add two compatible inertia matrices, meaning they must be taken about the same point and expressed in the same frame. More...
|
|
template<class P > |
Inertia_< P > | operator- (const Inertia_< P > &l, const Inertia_< P > &r) |
| Subtract from one inertia matrix another one which is compatible, meaning that both must be taken about the same point and expressed in the same frame. More...
|
|
template<class P > |
Inertia_< P > | operator* (const Inertia_< P > &i, const P &r) |
| Multiply an inertia matrix by a scalar. More...
|
|
template<class P > |
Inertia_< P > | operator* (const P &r, const Inertia_< P > &i) |
| Multiply an inertia matrix by a scalar. More...
|
|
template<class P > |
Inertia_< P > | operator* (const Inertia_< P > &i, int r) |
| Multiply an inertia matrix by a scalar given as an int. More...
|
|
template<class P > |
Inertia_< P > | operator* (int r, const Inertia_< P > &i) |
| Multiply an inertia matrix by a scalar given as an int. More...
|
|
template<class P > |
Inertia_< P > | operator/ (const Inertia_< P > &i, const P &r) |
| Divide an inertia matrix by a scalar. More...
|
|
template<class P > |
Inertia_< P > | operator/ (const Inertia_< P > &i, int r) |
| Divide an inertia matrix by a scalar provided as an int. More...
|
|
template<class P > |
Vec< 3, P > | operator* (const Inertia_< P > &I, const Vec< 3, P > &w) |
| Multiply an inertia matrix I on the right by a vector w giving the vector result I*w. More...
|
|
template<class P > |
bool | operator== (const Inertia_< P > &i1, const Inertia_< P > &i2) |
| Compare two inertia matrices for exact (bitwise) equality. More...
|
|
template<class P > |
std::ostream & | operator<< (std::ostream &o, const Inertia_< P > &inertia) |
| Output a human-readable representation of an inertia matrix to the indicated stream. More...
|
|
template<class P>
class SimTK::Inertia_< P >
The physical meaning of an inertia is the distribution of a rigid body's mass about a particular point.
If that point is the center of mass of the body, then the measured inertia is called the "central inertia" of that body. To write down the inertia, we need to calculate the six scalars of the inertia tensor, which is a symmetric 3x3 matrix. These scalars must be expressed in an arbitrary but specified coordinate system. So an Inertia is meaningful only in conjunction with a particular set of axes, fixed to the body, whose origin is the point about which the inertia is being measured, and in whose coordinate system this measurement is being expressed. Note that changing the reference point results in a new physical quantity, but changing the reference axes only affects the measure numbers of that quantity. For any reference point, there is a unique set of reference axes in which the inertia tensor is diagonal; those are called the "principal axes" of the body at that point, and the resulting diagonal elements are the "principal moments of inertia". When we speak of an inertia being "in" a frame, we mean the physical quantity measured about the frame's origin and then expressed in the frame's axes.
This low-level Inertia class does not attempt to keep track of which frame it is in. It provides construction and operations involving inertia that can proceed using only an implicit frame F. Clients of this class are responsible for keeping track of that frame. In particular, in order to shift the inertia's "measured-about" point one must know whether either the starting or final inertia is central, because we must always shift inertias by passing through the central inertia. So this class provides operations for doing the shifting, but expects to be told by the client where to find the center of mass.
Re-expressing an Inertia in a different coordinate system does not entail a change of physical meaning in the way that shifting it to a different point does. Note that because inertia is a tensor, there is a "left frame" and "right frame". For our purposes, these will always be the same so we'll only indicate the frame once, as in 'I_pt_frame'. This should be understood to mean 'frame_I_pt_frame' and re-expressing an Inertia requires both a left and right multiply by the rotation matrix. So I_OB_B is the inertia about body B's origin point OB, expressed in B, while I_OB_G is the same physical quantity but expressed in Ground (the latter is a component of the Spatial Inertia which we usually want in the Ground frame). Frame conversion is done logically like this:
I_OB_G = R_GB * I_OB_B * R_BG (R_BG=~R_GB)
but we can save computation time by performing this as a single operation.
The central inertia would be I_CB_B for body B.
A Inertia is a symmetric matrix and is positive definite for nonsingular bodies (that is, a body composed of at least three noncollinear point masses).
Some attempt is made to check the validity of an Inertia matrix, at least when running in Debug mode. Some conditions it must satisfy are:
- must be symmetric
- all diagonal elements must be nonnegative
- diagonal elements must satisfy the triangle inequality (sum of any two is greater than or equal the other one)
Abbreviations
Typedefs exist for the most common invocations of Inertia_<P>:
- Inertia for default Real precision (this is almost always used)
- fInertia for single (float) precision
- dInertia for double precision