# Ignition Math

## API Reference

6.8.0
Inertial< T > Class Template Reference

The Inertial object provides a representation for the mass and inertia matrix of a body B. The components of the inertia matrix are expressed in what we call the "inertial" frame Bi of the body, i.e. the frame in which these inertia components are measured. The inertial frame Bi must be located at the center of mass of the body, but not necessarily aligned with the body’s frame. In addition, this class allows users to specify a frame F for these inertial properties by specifying the pose X_FBi of the inertial frame Bi in the inertial object frame F. More...

#include <ignition/math/Inertial.hh>

## Public Member Functions

Inertial ()
Default Constructor. More...

Inertial (const MassMatrix3< T > &_massMatrix, const Pose3< T > &_pose)
Constructs an inertial object from the mass matrix for a body B, about its center of mass Bcm, and expressed in a frame that we’ll call the "inertial" frame Bi, i.e. the frame in which the components of the mass matrix are specified (see this class’s documentation for details). The pose object specifies the pose X_FBi of the inertial frame Bi in the frame F of this inertial object (see class’s documentation). 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 computer about the body's center of mass and expressed in this Inertial object’s frame F. More...

Matrix3< T > Moi () const
Get the moment of inertia matrix computer about the body's center of mass and expressed in this Inertial object’s frame F. 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 the 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, const T _tolerance=IGN_MASSMATRIX3_DEFAULT_TOLERANCE< T >)
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 the center of mass reference frame. More...

## Detailed Description

### template<typename T> class ignition::math::Inertial< T >

The Inertial object provides a representation for the mass and inertia matrix of a body B. The components of the inertia matrix are expressed in what we call the "inertial" frame Bi of the body, i.e. the frame in which these inertia components are measured. The inertial frame Bi must be located at the center of mass of the body, but not necessarily aligned with the body’s frame. In addition, this class allows users to specify a frame F for these inertial properties by specifying the pose X_FBi of the inertial frame Bi in the inertial object frame F.

For information about the X_FBi notation, see http://drake.mit.edu/doxygen_cxx/group__multibody__spatial__pose.html

## ◆ Inertial() [1/3]

 Inertial ( )
inline

Default Constructor.

## ◆ Inertial() [2/3]

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

Constructs an inertial object from the mass matrix for a body B, about its center of mass Bcm, and expressed in a frame that we’ll call the "inertial" frame Bi, i.e. the frame in which the components of the mass matrix are specified (see this class’s documentation for details). The pose object specifies the pose X_FBi of the inertial frame Bi in the frame F of this inertial object (see class’s documentation).

Parameters
 [in] _massMatrix Mass and inertia matrix. [in] _pose Pose of center of mass reference frame.

## ◆ Inertial() [3/3]

 Inertial ( const Inertial< T > & _inertial )
inline

Copy constructor.

Parameters
 [in] _inertial Inertial element to copy

## ◆ ~Inertial()

 virtual ~Inertial ( )
inlinevirtual

Destructor.

## ◆ MassMatrix()

 const MassMatrix3& MassMatrix ( ) const
inline

Get the mass and inertia matrix.

Returns
The mass matrix about the body’s center of mass and expressed in the inertial frame Bi as defined by this class’s documentation

## ◆ MOI()

 Matrix3 MOI ( ) const
inline

Get the moment of inertia matrix computer about the body's center of mass and expressed in this Inertial object’s frame F.

Returns
The inertia matrix computed about the body’s center of mass and expressed in this Inertial object’s frame F, as defined in this class’s documentation.
Deprecated:
See Matrix3<T> Moi() const

References Inertial< T >::Moi().

## ◆ Moi()

 Matrix3 Moi ( ) const
inline

Get the moment of inertia matrix computer about the body's center of mass and expressed in this Inertial object’s frame F.

Returns
The inertia matrix computed about the body’s center of mass and expressed in this Inertial object’s frame F, as defined in this class’s documentation.

## ◆ operator!=()

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

Inequality test operator.

Parameters
 [in] _inertial Inertial to test
Returns
True if not equal (using the default tolerance of 1e-6)

## ◆ operator+()

 const Inertial 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
Returns
Sum of inertials as new object.

## ◆ operator+=()

 Inertial& 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
Returns
Reference to this object.

## ◆ operator=()

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

Equal operator.

Parameters
 [in] _inertial Inertial 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] _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()

 const Pose3& Pose ( ) const
inline

Get the pose of the center of mass reference frame.

Returns
The pose of the inertial frame Bi in the frame F of this Inertial object as defined by this class’s documentation.

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] _q New rotation for inertial pose.
Returns
True if the MassMatrix3 is valid.

References Inertial< T >::Moi().

## ◆ SetMassMatrix()

 bool SetMassMatrix ( const MassMatrix3< T > & _m, const T _tolerance = IGN_MASSMATRIX3_DEFAULT_TOLERANCE )
inline

Set the mass and inertia matrix.

Parameters
 [in] _m New MassMatrix3 object. [in] _tolerance Tolerance is passed to MassMatrix3::IsValid and is the amount of error to accept when checking whether the MassMatrix3 _m is valid. Refer to MassMatrix3::Epsilon for detailed description of _tolerance.
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] _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.

## ◆ SetPose()

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

Set the pose of the 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: