dart
|
Public Types | |
enum | Param { MASS = 0, COM_X, COM_Y, COM_Z, I_XX, I_YY, I_ZZ, I_XY, I_XZ, I_YZ } |
Enumeration for minimal inertia parameters. | |
Public Member Functions | |
Inertia (double _mass=1, const Eigen::Vector3d &_com=Eigen::Vector3d::Zero(), const Eigen::Matrix3d &_momentOfInertia=Eigen::Matrix3d::Identity()) | |
Inertia (const Eigen::Matrix6d &_spatialInertiaTensor) | |
Inertia (double _mass, double _comX, double _comY, double _comZ, double _Ixx, double _Iyy, double _Izz, double _Ixy, double _Ixz, double _Iyz) | |
void | setParameter (Param _param, double _value) |
Set an inertial parameter. | |
double | getParameter (Param _param) const |
Get an inertial parameter. | |
void | setMass (double _mass) |
Set the mass. | |
double | getMass () const |
Get the mass. | |
void | setLocalCOM (const Eigen::Vector3d &_com) |
Set the center of mass with respect to the Body-fixed frame. | |
const Eigen::Vector3d & | getLocalCOM () const |
Get the center of mass with respect to the Body-fixed frame. | |
void | setMoment (const Eigen::Matrix3d &_moment) |
Set the moment of inertia (about the center of mass). More... | |
void | setMoment (double _Ixx, double _Iyy, double _Izz, double _Ixy, double _Ixz, double _Iyz) |
Set the moment of inertia (about the center of mass) | |
Eigen::Matrix3d | getMoment () const |
Get the moment of inertia. | |
void | setSpatialTensor (const Eigen::Matrix6d &_spatial) |
Set the spatial tensor. | |
const Eigen::Matrix6d & | getSpatialTensor () const |
Get the spatial inertia tensor. | |
bool | verify (bool _printWarnings=true, double _tolerance=1e-8) const |
Returns true iff this Inertia object is physically valid. | |
bool | operator== (const Inertia &other) const |
Check for equality. | |
Static Public Member Functions | |
static bool | verifyMoment (const Eigen::Matrix3d &_moment, bool _printWarnings=true, double _tolerance=1e-8) |
Returns true iff _moment is a physically valid moment of inertia. | |
static bool | verifySpatialTensor (const Eigen::Matrix6d &_spatial, bool _printWarnings=true, double _tolerance=1e-8) |
Returns true iff _spatial is a physically valid spatial inertia tensor. | |
Protected Member Functions | |
void | computeSpatialTensor () |
Compute the spatial tensor based on the inertial parameters. | |
void | computeParameters () |
Compute the inertial parameters from the spatial tensor. | |
Protected Attributes | |
double | mMass |
Overall mass. | |
Eigen::Vector3d | mCenterOfMass |
Center of mass in the Body frame. | |
std::array< double, 6 > | mMoment |
The six parameters of the moment of inertia located at the center of mass. | |
Eigen::Matrix6d | mSpatialTensor |
Cache for generalized spatial inertia of the Body. | |
void dart::dynamics::Inertia::setMoment | ( | const Eigen::Matrix3d & | _moment | ) |
Set the moment of inertia (about the center of mass).
Note that only the top-right corner of the matrix will be used, because a well-formed inertia matrix is always symmetric.