33 #ifndef DART_DYNAMICS_INERTIA_HPP_ 34 #define DART_DYNAMICS_INERTIA_HPP_ 38 #include "dart/math/MathTypes.hpp" 70 const Eigen::Vector3d& _com = Eigen::Vector3d::Zero(),
71 const Eigen::Matrix3d& _momentOfInertia = Eigen::Matrix3d::Identity());
73 Inertia(
const Eigen::Matrix6d& _spatialInertiaTensor);
108 void setMoment(
const Eigen::Matrix3d& _moment);
130 const Eigen::Matrix3d& _moment,
131 bool _printWarnings =
true,
132 double _tolerance = 1e-8);
136 const Eigen::Matrix6d& _spatial,
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
173 #endif // DART_DYNAMICS_INERTIA_HPP_ void setLocalCOM(const Eigen::Vector3d &_com)
Set the center of mass with respect to the Body-fixed frame.
Definition: Inertia.cpp:132
void setMoment(const Eigen::Matrix3d &_moment)
Set the moment of inertia (about the center of mass).
Definition: Inertia.cpp:145
void setMass(double _mass)
Set the mass.
Definition: Inertia.cpp:119
void setParameter(Param _param, double _value)
Set an inertial parameter.
Definition: Inertia.cpp:76
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
void computeSpatialTensor()
Compute the spatial tensor based on the inertial parameters.
Definition: Inertia.cpp:410
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
bool verify(bool _printWarnings=true, double _tolerance=1e-8) const
Returns true iff this Inertia object is physically valid.
Definition: Inertia.cpp:397
Definition: Inertia.hpp:43
std::array< double, 6 > mMoment
The six parameters of the moment of inertia located at the center of mass.
Definition: Inertia.hpp:160
Definition: Aspect.cpp:40
Param
Enumeration for minimal inertia parameters.
Definition: Inertia.hpp:47
double getParameter(Param _param) const
Get an inertial parameter.
Definition: Inertia.cpp:102
const Eigen::Matrix6d & getSpatialTensor() const
Get the spatial inertia tensor.
Definition: Inertia.cpp:208
void computeParameters()
Compute the inertial parameters from the spatial tensor.
Definition: Inertia.cpp:428
Eigen::Vector3d mCenterOfMass
Center of mass in the Body frame.
Definition: Inertia.hpp:157
double mMass
Overall mass.
Definition: Inertia.hpp:154
Eigen::Matrix6d mSpatialTensor
Cache for generalized spatial inertia of the Body.
Definition: Inertia.hpp:163
bool operator==(const Inertia &other) const
Check for equality.
Definition: Inertia.cpp:403
Eigen::Matrix3d getMoment() const
Get the moment of inertia.
Definition: Inertia.cpp:182
const Eigen::Vector3d & getLocalCOM() const
Get the center of mass with respect to the Body-fixed frame.
Definition: Inertia.cpp:139
double getMass() const
Get the mass.
Definition: Inertia.cpp:126
void setSpatialTensor(const Eigen::Matrix6d &_spatial)
Set the spatial tensor.
Definition: Inertia.cpp:196