Gazebo Math

API Reference

8.1.0
OrientedBox< T > Class Template Reference

Mathematical representation of a box which can be arbitrarily positioned and rotated. More...

#include <OrientedBox.hh>

Public Member Functions

 OrientedBox ()
 Default constructor.
 
 OrientedBox (const Vector3< T > &_size)
 Constructor which takes only the size.
 
 OrientedBox (const Vector3< T > &_size, const Material &_mat)
 Constructor which takes only the size.
 
 OrientedBox (const Vector3< T > &_size, const Pose3< T > &_pose)
 Constructor which takes size and pose.
 
 OrientedBox (const Vector3< T > &_size, const Pose3< T > &_pose, const Material &_mat)
 Constructor which takes size, pose, and material.
 
bool Contains (const Vector3d &_p) const
 Check if a point lies inside the box.
 
DensityFromMass (const T _mass) const
 Compute the box's density given a mass value. The box is assumed to be solid with uniform density. This function requires the box's size to be set to values greater than zero. The Material of the box is ignored.
 
bool MassMatrix (MassMatrix3< T > &_massMat) const
 Get the mass matrix for this box. This function is only meaningful if the box's size and material have been set.
 
const MaterialMaterial () const
 Get the material associated with this box.
 
bool operator!= (const OrientedBox< T > &_b) const
 Inequality test operator.
 
bool operator== (const OrientedBox< T > &_b) const
 Equality test operator.
 
const Pose3< T > & Pose () const
 Get the box pose, which is the pose of its center.
 
void Pose (const Pose3< T > &_pose)
 Set the box pose.
 
bool SetDensityFromMass (const T _mass)
 Set the density of this box based on a mass value. Density is computed using double DensityFromMass(const double _mass) const. The box is assumed to be solid with uniform density. This function requires the box's size to be set to values greater than zero. The existing Material density value is overwritten only if the return value from this true.
 
void SetMaterial (const Material &_mat)
 Set the material associated with this box.
 
const Vector3< T > & Size () const
 Get the size of the box.
 
void Size (const Vector3< T > &_size)
 Set the box size.
 
Volume () const
 Get the volume of the box in m^3.
 
XLength () const
 Get the length along the x dimension.
 
YLength () const
 Get the length along the y dimension.
 
ZLength () const
 Get the length along the z dimension.
 

Detailed Description

template<typename T>
class gz::math::OrientedBox< T >

Mathematical representation of a box which can be arbitrarily positioned and rotated.

Constructor & Destructor Documentation

◆ OrientedBox() [1/5]

template<typename T >
OrientedBox ( )
inline

Default constructor.

◆ OrientedBox() [2/5]

template<typename T >
OrientedBox ( const Vector3< T > &  _size,
const Pose3< T > &  _pose 
)
inline

Constructor which takes size and pose.

Parameters
[in]_sizeBox size, in its own coordinate frame. Its absolute value will be taken, so the size is non-negative.
[in]_poseBox pose.

◆ OrientedBox() [3/5]

template<typename T >
OrientedBox ( const Vector3< T > &  _size,
const Pose3< T > &  _pose,
const Material _mat 
)
inline

Constructor which takes size, pose, and material.

Parameters
[in]_sizeBox size, in its own coordinate frame. Its absolute value will be taken, so the size is non-negative.
[in]_poseBox pose.
[in]_matMaterial property for the box.

◆ OrientedBox() [4/5]

template<typename T >
OrientedBox ( const Vector3< T > &  _size)
inlineexplicit

Constructor which takes only the size.

Parameters
[in]_sizeBox size, in its own coordinate frame. Its absolute value will be taken, so the size is non-negative.

◆ OrientedBox() [5/5]

template<typename T >
OrientedBox ( const Vector3< T > &  _size,
const Material _mat 
)
inlineexplicit

Constructor which takes only the size.

Parameters
[in]_sizeBox size, in its own coordinate frame. Its absolute value will be taken, so the size is non-negative.
[in]_matMaterial property for the box.

Member Function Documentation

◆ Contains()

template<typename T >
bool Contains ( const Vector3d _p) const
inline

Check if a point lies inside the box.

Parameters
[in]_pPoint to check.
Returns
True if the point is inside the box.

◆ DensityFromMass()

template<typename T >
T DensityFromMass ( const _mass) const
inline

Compute the box's density given a mass value. The box is assumed to be solid with uniform density. This function requires the box's size to be set to values greater than zero. The Material of the box is ignored.

Parameters
[in]_massMass of the box, in kg. This value should be greater than zero.
Returns
Density of the box in kg/m^3. A negative value is returned if the size or _mass is <= 0.

References OrientedBox< T >::Volume().

Referenced by OrientedBox< T >::SetDensityFromMass().

◆ MassMatrix()

template<typename T >
bool MassMatrix ( MassMatrix3< T > &  _massMat) const
inline

Get the mass matrix for this box. This function is only meaningful if the box's size and material have been set.

Parameters
[out]_massMatThe computed mass matrix will be stored here.
Returns
False if computation of the mass matrix failed, which could be due to an invalid size (<=0) or density (<=0).

◆ Material()

template<typename T >
const Material & Material ( ) const
inline

Get the material associated with this box.

Returns
The material assigned to this box.

◆ operator!=()

template<typename T >
bool operator!= ( const OrientedBox< T > &  _b) const
inline

Inequality test operator.

Parameters
[in]_bOrientedBox to test
Returns
True if not equal

◆ operator==()

template<typename T >
bool operator== ( const OrientedBox< T > &  _b) const
inline

Equality test operator.

Parameters
[in]_bOrientedBox to test
Returns
True if equal

◆ Pose() [1/2]

template<typename T >
const Pose3< T > & Pose ( ) const
inline

Get the box pose, which is the pose of its center.

Returns
The pose of the box.

◆ Pose() [2/2]

template<typename T >
void Pose ( const Pose3< T > &  _pose)
inline

Set the box pose.

Parameters
[in]_poseBox pose.

◆ SetDensityFromMass()

template<typename T >
bool SetDensityFromMass ( const _mass)
inline

Set the density of this box based on a mass value. Density is computed using double DensityFromMass(const double _mass) const. The box is assumed to be solid with uniform density. This function requires the box's size to be set to values greater than zero. The existing Material density value is overwritten only if the return value from this true.

Parameters
[in]_massMass of the box, in kg. This value should be greater than zero.
Returns
True if the density was set. False is returned if the box's size or the _mass value are <= 0.
See also
double DensityFromMass(const double _mass) const

References OrientedBox< T >::DensityFromMass(), and Material::SetDensity().

◆ SetMaterial()

template<typename T >
void SetMaterial ( const Material _mat)
inline

Set the material associated with this box.

Parameters
[in]_matThe material assigned to this box.

◆ Size() [1/2]

template<typename T >
const Vector3< T > & Size ( ) const
inline

Get the size of the box.

Returns
Size of the box

◆ Size() [2/2]

template<typename T >
void Size ( const Vector3< T > &  _size)
inline

Set the box size.

Parameters
[in]_sizeBox size, in its own coordinate frame. Its absolute value will be taken, so the size is non-negative.

◆ Volume()

template<typename T >
T Volume ( ) const
inline

Get the volume of the box in m^3.

Returns
Volume of the box in m^3.

Referenced by OrientedBox< T >::DensityFromMass().

◆ XLength()

template<typename T >
T XLength ( ) const
inline

Get the length along the x dimension.

Returns
Value of the length in the x dimension

◆ YLength()

template<typename T >
T YLength ( ) const
inline

Get the length along the y dimension.

Returns
Value of the length in the y dimension

◆ ZLength()

template<typename T >
T ZLength ( ) const
inline

Get the length along the z dimension.

Returns
Value of the length in the z dimension

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