33 #ifndef DART_DYNAMICS_INERTIA_HPP_
34 #define DART_DYNAMICS_INERTIA_HPP_
62 Inertia(
double _mass=1,
const Eigen::Vector3d& _com = Eigen::Vector3d::Zero(),
63 const Eigen::Matrix3d& _momentOfInertia = Eigen::Matrix3d::Identity());
68 double _comX,
double _comY,
double _comZ,
69 double _Ixx,
double _Iyy,
double _Izz,
70 double _Ixy,
double _Ixz,
double _Iyz);
93 void setMoment(
const Eigen::Matrix3d& _moment);
96 void setMoment(
double _Ixx,
double _Iyy,
double _Izz,
97 double _Ixy,
double _Ixz,
double _Iyz);
109 static bool verifyMoment(
const Eigen::Matrix3d& _moment,
110 bool _printWarnings =
true,
111 double _tolerance = 1e-8);
115 bool _printWarnings =
true,
116 double _tolerance = 1e-8);
119 bool verify(
bool _printWarnings =
true,
120 double _tolerance = 1e-8)
const;
147 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
Definition: Inertia.hpp:44
Eigen::Matrix6d mSpatialTensor
Cache for generalized spatial inertia of the Body.
Definition: Inertia.hpp:143
const Eigen::Matrix6d & getSpatialTensor() const
Get the spatial inertia tensor.
Definition: Inertia.cpp:194
void setParameter(Param _param, double _value)
Set an inertial parameter.
Definition: Inertia.cpp:67
Param
Enumeration for minimal inertia parameters.
Definition: Inertia.hpp:48
@ I_XY
Definition: Inertia.hpp:58
@ MASS
Definition: Inertia.hpp:51
@ COM_Y
Definition: Inertia.hpp:54
@ I_ZZ
Definition: Inertia.hpp:57
@ COM_X
Definition: Inertia.hpp:54
@ COM_Z
Definition: Inertia.hpp:54
@ I_XZ
Definition: Inertia.hpp:58
@ I_YY
Definition: Inertia.hpp:57
@ I_YZ
Definition: Inertia.hpp:58
@ I_XX
Definition: Inertia.hpp:57
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:240
void setMoment(const Eigen::Matrix3d &_moment)
Set the moment of inertia (about the center of mass).
Definition: Inertia.cpp:136
void setSpatialTensor(const Eigen::Matrix6d &_spatial)
Set the spatial tensor.
Definition: Inertia.cpp:182
void setLocalCOM(const Eigen::Vector3d &_com)
Set the center of mass with respect to the Body-fixed frame.
Definition: Inertia.cpp:123
std::array< double, 6 > mMoment
The six parameters of the moment of inertia located at the center of mass.
Definition: Inertia.hpp:140
const Eigen::Vector3d & getLocalCOM() const
Get the center of mass with respect to the Body-fixed frame.
Definition: Inertia.cpp:130
void setMass(double _mass)
Set the mass.
Definition: Inertia.cpp:110
void computeParameters()
Compute the inertial parameters from the spatial tensor.
Definition: Inertia.cpp:412
Eigen::Matrix3d getMoment() const
Get the moment of inertia.
Definition: Inertia.cpp:168
bool operator==(const Inertia &other) const
Check for equality.
Definition: Inertia.cpp:387
void computeSpatialTensor()
Compute the spatial tensor based on the inertial parameters.
Definition: Inertia.cpp:394
double getParameter(Param _param) const
Get an inertial parameter.
Definition: Inertia.cpp:93
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:200
double getMass() const
Get the mass.
Definition: Inertia.cpp:117
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:134
Eigen::Vector3d mCenterOfMass
Center of mass in the Body frame.
Definition: Inertia.hpp:137
bool verify(bool _printWarnings=true, double _tolerance=1e-8) const
Returns true iff this Inertia object is physically valid.
Definition: Inertia.cpp:381
Matrix< double, 6, 6 > Matrix6d
Definition: MathTypes.hpp:50
Definition: BulletCollisionDetector.cpp:63