A class for inertial information about a rigid body consisting of the scalar mass, a 3x3 symmetric moment of inertia matrix, and center of mass reference frame pose. More...
#include <ignition/math/Inertial.hh>
Public Member Functions | |
Inertial () | |
Default Constructor. More... | |
Inertial (const MassMatrix3< T > &_massMatrix, const Pose3< T > &_pose) | |
Constructor. More... | |
Inertial (const Inertial< T > &_inertial) | |
Copy constructor. More... | |
virtual | ~Inertial () |
Destructor. More... | |
const MassMatrix3< T > & | MassMatrix () const |
Get the mass and inertia matrix. More... | |
Matrix3< T > | MOI () const |
Get the moment of inertia matrix expressed in the base coordinate frame. More... | |
bool | operator!= (const Inertial< T > &_inertial) const |
Inequality test operator. More... | |
const Inertial< T > | operator+ (const Inertial< T > &_inertial) const |
Adds inertial properties to current object. The mass, center of mass location, and inertia matrix are updated as long as the total mass is positive. More... | |
Inertial< T > & | operator+= (const Inertial< T > &_inertial) |
Adds inertial properties to current object. The mass, center of mass location, and inertia matrix are updated as long as the total mass is positive. More... | |
Inertial & | operator= (const Inertial< T > &_inertial) |
Equal operator. More... | |
bool | operator== (const Inertial< T > &_inertial) const |
Equality comparison operator. More... | |
const Pose3< T > & | Pose () const |
Get the pose of center of mass reference frame. More... | |
bool | SetInertialRotation (const Quaternion< T > &_q) |
Set the inertial pose rotation without affecting the MOI in the base coordinate frame. More... | |
bool | SetMassMatrix (const MassMatrix3< T > &_m) |
Set the mass and inertia matrix. More... | |
bool | SetMassMatrixRotation (const Quaternion< T > &_q, const T _tol=1e-6) |
Set the MassMatrix rotation (eigenvectors of inertia matrix) without affecting the MOI in the base coordinate frame. Note that symmetries in inertia matrix may prevent the output of MassMatrix3::PrincipalAxesOffset to match this function's input _q, but it is guaranteed that the MOI in the base frame will not change. A negative value of _tol (such as -1e-6) can be passed to ensure that diagonal values are always sorted. More... | |
bool | SetPose (const Pose3< T > &_pose) |
Set the pose of center of mass reference frame. More... | |
Detailed Description
template<typename T>
class ignition::math::Inertial< T >
A class for inertial information about a rigid body consisting of the scalar mass, a 3x3 symmetric moment of inertia matrix, and center of mass reference frame pose.
Constructor & Destructor Documentation
◆ Inertial() [1/3]
|
inline |
Default Constructor.
◆ Inertial() [2/3]
|
inline |
Constructor.
- Parameters
-
[in] _massMatrix Mass and inertia matrix. [in] _pose Pose of center of mass reference frame.
◆ Inertial() [3/3]
Copy constructor.
- Parameters
-
[in] _inertial Inertial element to copy
◆ ~Inertial()
|
inlinevirtual |
Destructor.
Member Function Documentation
◆ MassMatrix()
|
inline |
Get the mass and inertia matrix.
- Returns
- The MassMatrix3 object.
Referenced by Inertial< T >::operator+=(), Inertial< T >::operator=(), Inertial< T >::operator==(), and Inertial< T >::SetMassMatrixRotation().
◆ MOI()
|
inline |
Get the moment of inertia matrix expressed in the base coordinate frame.
- Returns
- Rotated moment of inertia matrix.
Referenced by Inertial< T >::operator+=(), and Inertial< T >::SetInertialRotation().
◆ operator!=()
|
inline |
Inequality test operator.
- Parameters
-
[in] _inertial Inertial<T> to test
- Returns
- True if not equal (using the default tolerance of 1e-6)
◆ operator+()
Adds inertial properties to current object. The mass, center of mass location, and inertia matrix are updated as long as the total mass is positive.
- Parameters
-
[in] _inertial Inertial to add.
- Returns
- Sum of inertials as new object.
◆ operator+=()
Adds inertial properties to current object. The mass, center of mass location, and inertia matrix are updated as long as the total mass is positive.
- Parameters
-
[in] _inertial Inertial to add.
- Returns
- Reference to this object.
References Inertial< T >::MassMatrix(), Inertial< T >::MOI(), Inertial< T >::Pose(), std::pow(), Vector3< T >::X(), Vector3< T >::Y(), and Vector3< T >::Z().
◆ operator=()
Equal operator.
- Parameters
-
[in] _inertial Inertial to copy.
- Returns
- Reference to this object.
References Inertial< T >::MassMatrix(), and Inertial< T >::Pose().
◆ operator==()
|
inline |
Equality comparison operator.
- Parameters
-
[in] _inertial Inertial to copy.
- Returns
- true if each component is equal within a default tolerance, false otherwise
References Inertial< T >::MassMatrix(), and Inertial< T >::Pose().
◆ Pose()
|
inline |
Get the pose of center of mass reference frame.
- Returns
- The pose of center of mass reference frame.
Referenced by Inertial< T >::operator+=(), Inertial< T >::operator=(), and Inertial< T >::operator==().
◆ SetInertialRotation()
|
inline |
Set the inertial pose rotation without affecting the MOI in the base coordinate frame.
- Parameters
-
[in] _q New rotation for inertial pose.
- Returns
- True if the MassMatrix3 is valid.
References Inertial< T >::MOI().
◆ SetMassMatrix()
|
inline |
Set the mass and inertia matrix.
- Parameters
-
[in] _m New MassMatrix3 object.
- Returns
- True if the MassMatrix3 is valid.
◆ SetMassMatrixRotation()
|
inline |
Set the MassMatrix rotation (eigenvectors of inertia matrix) without affecting the MOI in the base coordinate frame. Note that symmetries in inertia matrix may prevent the output of MassMatrix3::PrincipalAxesOffset to match this function's input _q, but it is guaranteed that the MOI in the base frame will not change. A negative value of _tol (such as -1e-6) can be passed to ensure that diagonal values are always sorted.
- Parameters
-
[in] _q New rotation. [in] _tol Relative tolerance given by absolute value of _tol. This is passed to the MassMatrix3 PrincipalMoments and PrincipalAxesOffset functions.
- Returns
- True if the MassMatrix3 is valid.
References Quaternion< T >::Inverse(), Inertial< T >::MassMatrix(), and Matrix3< T >::Transposed().
◆ SetPose()
|
inline |
Set the pose of center of mass reference frame.
- Parameters
-
[in] _pose New pose.
- Returns
- True if the MassMatrix3 is valid.
The documentation for this class was generated from the following file: