33 #ifndef DART_DYNAMICS_INERTIA_HPP_
34 #define DART_DYNAMICS_INERTIA_HPP_
70 const Eigen::Vector3d& _com = Eigen::Vector3d::Zero(),
71 const Eigen::Matrix3d& _momentOfInertia = Eigen::Matrix3d::Identity());
108 void setMoment(
const Eigen::Matrix3d& _moment);
130 const Eigen::Matrix3d& _moment,
131 bool _printWarnings =
true,
132 double _tolerance = 1e-8);
137 bool _printWarnings =
true,
138 double _tolerance = 1e-8);
141 bool verify(
bool _printWarnings =
true,
double _tolerance = 1e-8)
const;
167 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
Definition: Inertia.hpp:44
Eigen::Matrix6d mSpatialTensor
Cache for generalized spatial inertia of the Body.
Definition: Inertia.hpp:163
const Eigen::Matrix6d & getSpatialTensor() const
Get the spatial inertia tensor.
Definition: Inertia.cpp:208
void setParameter(Param _param, double _value)
Set an inertial parameter.
Definition: Inertia.cpp:76
Param
Enumeration for minimal inertia parameters.
Definition: Inertia.hpp:48
@ I_XY
Definition: Inertia.hpp:62
@ MASS
Definition: Inertia.hpp:51
@ COM_Y
Definition: Inertia.hpp:55
@ I_ZZ
Definition: Inertia.hpp:61
@ COM_X
Definition: Inertia.hpp:54
@ COM_Z
Definition: Inertia.hpp:56
@ I_XZ
Definition: Inertia.hpp:63
@ I_YY
Definition: Inertia.hpp:60
@ I_YZ
Definition: Inertia.hpp:64
@ I_XX
Definition: Inertia.hpp:59
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.
Definition: Inertia.cpp:254
void setMoment(const Eigen::Matrix3d &_moment)
Set the moment of inertia (about the center of mass).
Definition: Inertia.cpp:145
void setSpatialTensor(const Eigen::Matrix6d &_spatial)
Set the spatial tensor.
Definition: Inertia.cpp:196
void setLocalCOM(const Eigen::Vector3d &_com)
Set the center of mass with respect to the Body-fixed frame.
Definition: Inertia.cpp:132
const Eigen::Vector3d & getLocalCOM() const
Get the center of mass with respect to the Body-fixed frame.
Definition: Inertia.cpp:139
void setMass(double _mass)
Set the mass.
Definition: Inertia.cpp:119
void computeParameters()
Compute the inertial parameters from the spatial tensor.
Definition: Inertia.cpp:428
Eigen::Matrix3d getMoment() const
Get the moment of inertia.
Definition: Inertia.cpp:182
bool operator==(const Inertia &other) const
Check for equality.
Definition: Inertia.cpp:403
void computeSpatialTensor()
Compute the spatial tensor based on the inertial parameters.
Definition: Inertia.cpp:410
std::array< double, 6 > mMoment
The six parameters of the moment of inertia located at the center of mass.
Definition: Inertia.hpp:160
double getParameter(Param _param) const
Get an inertial parameter.
Definition: Inertia.cpp:102
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.
Definition: Inertia.cpp:214
double getMass() const
Get the mass.
Definition: Inertia.cpp:126
Inertia(double _mass=1, const Eigen::Vector3d &_com=Eigen::Vector3d::Zero(), const Eigen::Matrix3d &_momentOfInertia=Eigen::Matrix3d::Identity())
Definition: Inertia.cpp:41
double mMass
Overall mass.
Definition: Inertia.hpp:154
Eigen::Vector3d mCenterOfMass
Center of mass in the Body frame.
Definition: Inertia.hpp:157
bool verify(bool _printWarnings=true, double _tolerance=1e-8) const
Returns true iff this Inertia object is physically valid.
Definition: Inertia.cpp:397
Matrix< double, 6, 6 > Matrix6d
Definition: MathTypes.hpp:50
Definition: BulletCollisionDetector.cpp:65