Ignition Math

API Reference

4.0.0
Inertial< T > Class Template Reference

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...
 
Inertialoperator= (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]

Inertial ( )
inline

Default Constructor.

◆ Inertial() [2/3]

Inertial ( const MassMatrix3< T > &  _massMatrix,
const Pose3< T > &  _pose 
)
inline

Constructor.

Parameters
[in]_massMatrixMass and inertia matrix.
[in]_posePose of center of mass reference frame.

◆ Inertial() [3/3]

Inertial ( const Inertial< T > &  _inertial)
inline

Copy constructor.

Parameters
[in]_inertialInertial element to copy

◆ ~Inertial()

virtual ~Inertial ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ MassMatrix()

const MassMatrix3<T>& MassMatrix ( ) const
inline

◆ MOI()

Matrix3<T> MOI ( ) const
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!=()

bool operator!= ( const Inertial< T > &  _inertial) const
inline

Inequality test operator.

Parameters
[in]_inertialInertial<T> to test
Returns
True if not equal (using the default tolerance of 1e-6)

◆ operator+()

const Inertial<T> operator+ ( const Inertial< T > &  _inertial) const
inline

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]_inertialInertial to add.
Returns
Sum of inertials as new object.

◆ operator+=()

Inertial<T>& operator+= ( const Inertial< T > &  _inertial)
inline

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]_inertialInertial 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=()

Inertial& operator= ( const Inertial< T > &  _inertial)
inline

Equal operator.

Parameters
[in]_inertialInertial to copy.
Returns
Reference to this object.

References Inertial< T >::MassMatrix(), and Inertial< T >::Pose().

◆ operator==()

bool operator== ( const Inertial< T > &  _inertial) const
inline

Equality comparison operator.

Parameters
[in]_inertialInertial to copy.
Returns
true if each component is equal within a default tolerance, false otherwise

References Inertial< T >::MassMatrix(), and Inertial< T >::Pose().

◆ Pose()

const Pose3<T>& Pose ( ) const
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()

bool SetInertialRotation ( const Quaternion< T > &  _q)
inline

Set the inertial pose rotation without affecting the MOI in the base coordinate frame.

Parameters
[in]_qNew rotation for inertial pose.
Returns
True if the MassMatrix3 is valid.

References Inertial< T >::MOI().

◆ SetMassMatrix()

bool SetMassMatrix ( const MassMatrix3< T > &  _m)
inline

Set the mass and inertia matrix.

Parameters
[in]_mNew MassMatrix3 object.
Returns
True if the MassMatrix3 is valid.

◆ SetMassMatrixRotation()

bool SetMassMatrixRotation ( const Quaternion< T > &  _q,
const T  _tol = 1e-6 
)
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]_qNew rotation.
[in]_tolRelative 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()

bool SetPose ( const Pose3< T > &  _pose)
inline

Set the pose of center of mass reference frame.

Parameters
[in]_poseNew pose.
Returns
True if the MassMatrix3 is valid.

The documentation for this class was generated from the following file: