Loading...
Searching...
No Matches
ignition::math::IGNITION_MATH_VERSION_NAMESPACE::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.
 
 Inertial (const Inertial< T > &_inertial)
 Copy constructor.
 
 Inertial (const MassMatrix3< T > &_massMatrix, const Pose3< T > &_pose)
 Constructor.
 
virtual ~Inertial ()
 Destructor.
 
const MassMatrix3< T > & MassMatrix () const
 Get the mass and inertia matrix.
 
Matrix3< T > MOI () const
 Get the moment of inertia matrix expressed in the base coordinate frame.
 
bool operator!= (const Inertial< T > &_inertial) const
 Inequality test operator.
 
const Inertial< T > operator+ (const Inertial< T > &_inertial) const
 Adds inertial properties to current object.
 
Inertial< T > & operator+= (const Inertial< T > &_inertial)
 Adds inertial properties to current object.
 
Inertialoperator= (const Inertial< T > &_inertial)
 Equal operator.
 
bool operator== (const Inertial< T > &_inertial) const
 Equality comparison operator.
 
const Pose3< T > & Pose () const
 Get the pose of center of mass reference frame.
 
bool SetInertialRotation (const Quaternion< T > &_q)
 Set the inertial pose rotation without affecting the MOI in the base coordinate frame.
 
bool SetMassMatrix (const MassMatrix3< T > &_m)
 Set the mass and inertia matrix.
 
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.
 
bool SetPose (const Pose3< T > &_pose)
 Set the pose of center of mass reference frame.
 

Detailed Description

template<typename T>
class ignition::math::IGNITION_MATH_VERSION_NAMESPACE::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() [2/3]

template<typename T >
ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Inertial< T >::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]

template<typename T >
ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Inertial< T >::Inertial ( const Inertial< T > & _inertial)
inline

Copy constructor.

Parameters
[in]_inertialInertial element to copy

◆ ~Inertial()

template<typename T >
virtual ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Inertial< T >::~Inertial ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ MassMatrix()

◆ MOI()

template<typename T >
Matrix3< T > ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Inertial< T >::MOI ( ) const
inline

Get the moment of inertia matrix expressed in the base coordinate frame.

Returns
Rotated moment of inertia matrix.

Referenced by ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Inertial< T >::operator+=(), and ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Inertial< T >::SetInertialRotation().

◆ operator!=()

template<typename T >
bool ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Inertial< T >::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+()

template<typename T >
const Inertial< T > ignition::math::IGNITION_MATH_VERSION_NAMESPACE::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.

References ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Inertial< T >::Inertial().

◆ operator+=()

◆ operator=()

template<typename T >
Inertial & ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Inertial< T >::operator= ( const Inertial< T > & _inertial)
inline

Equal operator.

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

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

◆ operator==()

template<typename T >
bool ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Inertial< T >::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 ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Inertial< T >::MassMatrix(), and ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Inertial< T >::Pose().

◆ Pose()

◆ SetInertialRotation()

template<typename T >
bool ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Inertial< T >::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 ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Inertial< T >::MOI().

◆ SetMassMatrix()

template<typename T >
bool ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Inertial< T >::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()

template<typename T >
bool ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Inertial< T >::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 ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Quaternion< T >::Inverse(), and ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Inertial< T >::MassMatrix().

◆ SetPose()

template<typename T >
bool ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Inertial< T >::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: