|
DART 6.12.2
|
#include <Inertia.hpp>
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. More... | |
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). | |
| 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. | |
| dart::dynamics::Inertia::Inertia | ( | double | _mass = 1, |
| const Eigen::Vector3d & | _com = Eigen::Vector3d::Zero(), |
||
| const Eigen::Matrix3d & | _momentOfInertia = Eigen::Matrix3d::Identity() |
||
| ) |
| dart::dynamics::Inertia::Inertia | ( | const Eigen::Matrix6d & | _spatialInertiaTensor | ) |
| dart::dynamics::Inertia::Inertia | ( | double | _mass, |
| double | _comX, | ||
| double | _comY, | ||
| double | _comZ, | ||
| double | _Ixx, | ||
| double | _Iyy, | ||
| double | _Izz, | ||
| double | _Ixy, | ||
| double | _Ixz, | ||
| double | _Iyz | ||
| ) |
|
protected |
Compute the inertial parameters from the spatial tensor.
|
protected |
Compute the spatial tensor based on the inertial parameters.
| const Eigen::Vector3d & dart::dynamics::Inertia::getLocalCOM | ( | ) | const |
Get the center of mass with respect to the Body-fixed frame.
| double dart::dynamics::Inertia::getMass | ( | ) | const |
Get the mass.
| Eigen::Matrix3d dart::dynamics::Inertia::getMoment | ( | ) | const |
Get the moment of inertia.
| double dart::dynamics::Inertia::getParameter | ( | Param | _param | ) | const |
Get an inertial parameter.
| const Eigen::Matrix6d & dart::dynamics::Inertia::getSpatialTensor | ( | ) | const |
Get the spatial inertia tensor.
| bool dart::dynamics::Inertia::operator== | ( | const Inertia & | other | ) | const |
Check for equality.
| void dart::dynamics::Inertia::setLocalCOM | ( | const Eigen::Vector3d & | _com | ) |
Set the center of mass with respect to the Body-fixed frame.
| void dart::dynamics::Inertia::setMass | ( | double | _mass | ) |
Set the mass.
| 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.
| void dart::dynamics::Inertia::setMoment | ( | double | _Ixx, |
| double | _Iyy, | ||
| double | _Izz, | ||
| double | _Ixy, | ||
| double | _Ixz, | ||
| double | _Iyz | ||
| ) |
Set the moment of inertia (about the center of mass)
| void dart::dynamics::Inertia::setParameter | ( | Param | _param, |
| double | _value | ||
| ) |
Set an inertial parameter.
| void dart::dynamics::Inertia::setSpatialTensor | ( | const Eigen::Matrix6d & | _spatial | ) |
Set the spatial tensor.
| bool dart::dynamics::Inertia::verify | ( | bool | _printWarnings = true, |
| double | _tolerance = 1e-8 |
||
| ) | const |
Returns true iff this Inertia object is physically valid.
|
static |
Returns true iff _moment is a physically valid moment of inertia.
|
static |
Returns true iff _spatial is a physically valid spatial inertia tensor.
|
protected |
Center of mass in the Body frame.
|
protected |
Overall mass.
|
protected |
The six parameters of the moment of inertia located at the center of mass.
|
protected |
Cache for generalized spatial inertia of the Body.