Public Member Functions | List of all members
ignition::math::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. More...
 
Inertial< T > & operator+= (const Inertial< T > &_inertial)
 Adds inertial properties to current object. 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 SetMassMatrix (const MassMatrix3< T > &_m)
 Set the mass and inertia matrix. 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

template<typename T>
ignition::math::Inertial< T >::Inertial ( )
inline

Default Constructor.

template<typename T>
ignition::math::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.
template<typename T>
ignition::math::Inertial< T >::Inertial ( const Inertial< T > &  _inertial)
inline

Copy constructor.

Parameters
[in]_inertialInertial element to copy
template<typename T>
virtual ignition::math::Inertial< T >::~Inertial ( )
inlinevirtual

Destructor.

Member Function Documentation

template<typename T>
const MassMatrix3<T>& ignition::math::Inertial< T >::MassMatrix ( ) const
inline
template<typename T>
Matrix3<T> ignition::math::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::Inertial< T >::operator+=().

template<typename T>
bool ignition::math::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)
template<typename T>
const Inertial<T> ignition::math::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.
template<typename T>
Inertial<T>& ignition::math::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 ignition::math::Inertial< T >::MassMatrix(), ignition::math::Inertial< T >::MOI(), ignition::math::Inertial< T >::Pose(), ignition::math::Vector3< T >::X(), ignition::math::Vector3< T >::Y(), and ignition::math::Vector3< T >::Z().

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

Equal operator.

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

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

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

template<typename T>
const Pose3<T>& ignition::math::Inertial< T >::Pose ( ) const
inline

Get the pose of center of mass reference frame.

Returns
The pose of center of mass reference frame.

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

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