Public Member Functions | Static Public Member Functions | List of all members
sdf::SDF_VERSION_NAMESPACE::Collision Class Reference

A collision element descibes the collision properties associated with a link. More...

#include <Collision.hh>

Public Member Functions

 Collision ()
 Default constructor. More...
 
sdf::ElementPtr AutoInertiaParams () const
 Get the ElementPtr to the <auto_inertia_params> element This element can be used as a parent element to hold user-defined params for the custom moment of inertia calculator. More...
 
void CalculateInertial (sdf::Errors &_errors, gz::math::Inertiald &_inertial, const ParserConfig &_config)
 Calculate and return the MassMatrix for the collision. More...
 
void CalculateInertial (sdf::Errors &_errors, gz::math::Inertiald &_inertial, const ParserConfig &_config, const std::optional< double > &_density, sdf::ElementPtr _autoInertiaParams)
 Calculate and return the MassMatrix for the collision. More...
 
double Density () const
 Get the density of the collision. More...
 
sdf::ElementPtr Element () const
 Get a pointer to the SDF element that was used during load. More...
 
const GeometryGeom () const
 Get a pointer to the collisions's geometry. More...
 
Errors Load (ElementPtr _sdf)
 Load the collision based on a element pointer. More...
 
Errors Load (sdf::ElementPtr _sdf, const ParserConfig &_config)
 Load the collision based on a element pointer. More...
 
std::string Name () const
 Get the name of the collision. More...
 
const std::string & PoseRelativeTo () const
 Get the name of the coordinate frame relative to which this object's pose is expressed. More...
 
const gz::math::Pose3d & RawPose () const
 Get the pose of the collision object. More...
 
sdf::SemanticPose SemanticPose () const
 Get SemanticPose object of this object to aid in resolving poses. More...
 
void SetAutoInertiaParams (const sdf::ElementPtr _autoInertiaParams)
 Function to set the auto inertia params using a sdf ElementPtr object. More...
 
void SetDensity (double _density)
 Set the density of the collision. More...
 
void SetGeom (const Geometry &_geom)
 Set the collision's geometry. More...
 
void SetName (const std::string &_name)
 Set the name of the collision. More...
 
void SetPoseRelativeTo (const std::string &_frame)
 Set the name of the coordinate frame relative to which this object's pose is expressed. More...
 
void SetRawPose (const gz::math::Pose3d &_pose)
 Set the pose of the collision object. More...
 
void SetSurface (const sdf::Surface &_surface)
 Set the collision's surface parameters. More...
 
const sdf::SurfaceSurface () const
 Get a pointer to the collisions's surface parameters. More...
 
sdf::ElementPtr ToElement () const
 Create and return an SDF element filled with data from this collision. More...
 
sdf::ElementPtr ToElement (sdf::Errors &_errors) const
 Create and return an SDF element filled with data from this collision. More...
 

Static Public Member Functions

static double DensityDefault ()
 Get the default density of a collision if its density is not specified. More...
 

Detailed Description

A collision element descibes the collision properties associated with a link.

This can be different from the visual properties of a link. For example, simple collision models are often used to reduce computation time.

Constructor & Destructor Documentation

◆ Collision()

sdf::SDF_VERSION_NAMESPACE::Collision::Collision ( )

Default constructor.

Member Function Documentation

◆ AutoInertiaParams()

sdf::ElementPtr sdf::SDF_VERSION_NAMESPACE::Collision::AutoInertiaParams ( ) const

Get the ElementPtr to the <auto_inertia_params> element This element can be used as a parent element to hold user-defined params for the custom moment of inertia calculator.

Returns
ElementPtr object for the <auto_inertia_params> element.

◆ CalculateInertial() [1/2]

void sdf::SDF_VERSION_NAMESPACE::Collision::CalculateInertial ( sdf::Errors _errors,
gz::math::Inertiald &  _inertial,
const ParserConfig _config 
)

Calculate and return the MassMatrix for the collision.

Parameters
[out]_errorsA vector of Errors objects. Each errors contains an Error code and a message. An empty errors vector indicates no errors
[out]_inertialAn inertial object which will be set with the calculated inertial values
[in]_configCustom parser configuration

◆ CalculateInertial() [2/2]

void sdf::SDF_VERSION_NAMESPACE::Collision::CalculateInertial ( sdf::Errors _errors,
gz::math::Inertiald &  _inertial,
const ParserConfig _config,
const std::optional< double > &  _density,
sdf::ElementPtr  _autoInertiaParams 
)

Calculate and return the MassMatrix for the collision.

Parameters
[out]_errorsA vector of Errors objects. Each errors contains an Error code and a message. An empty errors vector indicates no errors
[out]_inertialAn inertial object which will be set with the calculated inertial values
[in]_configCustom parser configuration
[in]_densityAn optional density value to override the default collision density. This value is used instead of DefaultDensity()
[in]_autoInertiaParamsAn ElementPtr to the auto_inertia_params element to be used if the auto_inertia_params have not been set in this collision.

◆ Density()

double sdf::SDF_VERSION_NAMESPACE::Collision::Density ( ) const

Get the density of the collision.

Returns
Density of the collision.

◆ DensityDefault()

static double sdf::SDF_VERSION_NAMESPACE::Collision::DensityDefault ( )
static

Get the default density of a collision if its density is not specified.

Returns
Default density.

◆ Element()

sdf::ElementPtr sdf::SDF_VERSION_NAMESPACE::Collision::Element ( ) const

Get a pointer to the SDF element that was used during load.

Returns
SDF element pointer. The value will be nullptr if Load has not been called.

◆ Geom()

const Geometry* sdf::SDF_VERSION_NAMESPACE::Collision::Geom ( ) const

Get a pointer to the collisions's geometry.

Returns
The collision's geometry.

◆ Load() [1/2]

Errors sdf::SDF_VERSION_NAMESPACE::Collision::Load ( ElementPtr  _sdf)

Load the collision based on a element pointer.

This is not the usual entry point. Typical usage of the SDF DOM is through the Root object.

Parameters
[in]_sdfThe SDF Element pointer
Returns
Errors, which is a vector of Error objects. Each Error includes an error code and message. An empty vector indicates no error.

◆ Load() [2/2]

Errors sdf::SDF_VERSION_NAMESPACE::Collision::Load ( sdf::ElementPtr  _sdf,
const ParserConfig _config 
)

Load the collision based on a element pointer.

This is not the usual entry point. Typical usage of the SDF DOM is through the Root object.

Parameters
[in]_sdfThe SDF Element pointer
[in]_configParser configuration
Returns
Errors, which is a vector of Error objects. Each Error includes an error code and message. An empty vector indicates no error.

◆ Name()

std::string sdf::SDF_VERSION_NAMESPACE::Collision::Name ( ) const

Get the name of the collision.

The name of the collision must be unique within the scope of a Link.

Returns
Name of the collision.

◆ PoseRelativeTo()

const std::string& sdf::SDF_VERSION_NAMESPACE::Collision::PoseRelativeTo ( ) const

Get the name of the coordinate frame relative to which this object's pose is expressed.

An empty value indicates that the frame is relative to the parent link.

Returns
The name of the pose relative-to frame.

◆ RawPose()

const gz::math::Pose3d& sdf::SDF_VERSION_NAMESPACE::Collision::RawPose ( ) const

Get the pose of the collision object.

This is the pose of the collison as specified in SDF (<collision><pose> ... </pose></collision>).

Returns
The pose of the collision object.

◆ SemanticPose()

sdf::SemanticPose sdf::SDF_VERSION_NAMESPACE::Collision::SemanticPose ( ) const

Get SemanticPose object of this object to aid in resolving poses.

Returns
SemanticPose object for this link.

◆ SetAutoInertiaParams()

void sdf::SDF_VERSION_NAMESPACE::Collision::SetAutoInertiaParams ( const sdf::ElementPtr  _autoInertiaParams)

Function to set the auto inertia params using a sdf ElementPtr object.

Parameters
[in]_autoInertiaParamsElementPtr to <auto_inertia_params> element

◆ SetDensity()

void sdf::SDF_VERSION_NAMESPACE::Collision::SetDensity ( double  _density)

Set the density of the collision.

Parameters
[in]_densityDensity of the collision.

◆ SetGeom()

void sdf::SDF_VERSION_NAMESPACE::Collision::SetGeom ( const Geometry _geom)

Set the collision's geometry.

Parameters
[in]_geomThe geometry of the collision object

◆ SetName()

void sdf::SDF_VERSION_NAMESPACE::Collision::SetName ( const std::string &  _name)

Set the name of the collision.

The name of the collision must be unique within the scope of a Link.

Parameters
[in]_nameName of the collision.

◆ SetPoseRelativeTo()

void sdf::SDF_VERSION_NAMESPACE::Collision::SetPoseRelativeTo ( const std::string &  _frame)

Set the name of the coordinate frame relative to which this object's pose is expressed.

An empty value indicates that the frame is relative to the parent link.

Parameters
[in]_frameThe name of the pose relative-to frame.

◆ SetRawPose()

void sdf::SDF_VERSION_NAMESPACE::Collision::SetRawPose ( const gz::math::Pose3d &  _pose)

Set the pose of the collision object.

See also
const gz::math::Pose3d &RawPose() const
Parameters
[in]_poseThe pose of the collision object.

◆ SetSurface()

void sdf::SDF_VERSION_NAMESPACE::Collision::SetSurface ( const sdf::Surface _surface)

Set the collision's surface parameters.

Parameters
[in]_surfaceThe surface parameters of the collision object

◆ Surface()

const sdf::Surface* sdf::SDF_VERSION_NAMESPACE::Collision::Surface ( ) const

Get a pointer to the collisions's surface parameters.

Returns
The collision's surface parameters.

◆ ToElement() [1/2]

sdf::ElementPtr sdf::SDF_VERSION_NAMESPACE::Collision::ToElement ( ) const

Create and return an SDF element filled with data from this collision.

Note that parameter passing functionality is not captured with this function.

Returns
SDF element pointer with updated collision values.

◆ ToElement() [2/2]

sdf::ElementPtr sdf::SDF_VERSION_NAMESPACE::Collision::ToElement ( sdf::Errors _errors) const

Create and return an SDF element filled with data from this collision.

Note that parameter passing functionality is not captured with this function.

Parameters
[out]_errorsVector of errors.
Returns
SDF element pointer with updated collision values.

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