A collision element descibes the collision properties associated with a link. More...
#include <Collision.hh>
Public Member Functions | |
Collision () | |
Default constructor. | |
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. | |
void | CalculateInertial (sdf::Errors &_errors, gz::math::Inertiald &_inertial, const ParserConfig &_config) |
Calculate and return the MassMatrix for the collision. | |
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. | |
double | Density () const |
Get the density of the collision. | |
sdf::ElementPtr | Element () const |
Get a pointer to the SDF element that was used during load. | |
const Geometry * | Geom () const |
Get a pointer to the collisions's geometry. | |
Errors | Load (ElementPtr _sdf) |
Load the collision based on a element pointer. | |
Errors | Load (sdf::ElementPtr _sdf, const ParserConfig &_config) |
Load the collision based on a element pointer. | |
std::string | Name () const |
Get the name of the collision. | |
const std::string & | PoseRelativeTo () const |
Get the name of the coordinate frame relative to which this object's pose is expressed. | |
const gz::math::Pose3d & | RawPose () const |
Get the pose of the collision object. | |
sdf::SemanticPose | SemanticPose () const |
Get SemanticPose object of this object to aid in resolving poses. | |
void | SetAutoInertiaParams (const sdf::ElementPtr _autoInertiaParams) |
Function to set the auto inertia params using a sdf ElementPtr object. | |
void | SetDensity (double _density) |
Set the density of the collision. | |
void | SetGeom (const Geometry &_geom) |
Set the collision's geometry. | |
void | SetName (const std::string &_name) |
Set the name of the collision. | |
void | SetPoseRelativeTo (const std::string &_frame) |
Set the name of the coordinate frame relative to which this object's pose is expressed. | |
void | SetRawPose (const gz::math::Pose3d &_pose) |
Set the pose of the collision object. | |
void | SetSurface (const sdf::Surface &_surface) |
Set the collision's surface parameters. | |
const sdf::Surface * | Surface () const |
Get a pointer to the collisions's surface parameters. | |
sdf::ElementPtr | ToElement () const |
Create and return an SDF element filled with data from this collision. | |
sdf::ElementPtr | ToElement (sdf::Errors &_errors) const |
Create and return an SDF element filled with data from this collision. | |
Static Public Member Functions | |
static double | DensityDefault () |
Get the default density of a collision if its density is not specified. | |
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.
sdf::SDF_VERSION_NAMESPACE::Collision::Collision | ( | ) |
Default constructor.
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.
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.
[out] | _errors | A vector of Errors objects. Each errors contains an Error code and a message. An empty errors vector indicates no errors |
[out] | _inertial | An inertial object which will be set with the calculated inertial values |
[in] | _config | Custom parser configuration |
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.
[out] | _errors | A vector of Errors objects. Each errors contains an Error code and a message. An empty errors vector indicates no errors |
[out] | _inertial | An inertial object which will be set with the calculated inertial values |
[in] | _config | Custom parser configuration |
[in] | _density | An optional density value to override the default collision density. This value is used instead of DefaultDensity() |
[in] | _autoInertiaParams | An ElementPtr to the auto_inertia_params element to be used if the auto_inertia_params have not been set in this collision. |
double sdf::SDF_VERSION_NAMESPACE::Collision::Density | ( | ) | const |
Get the density of the collision.
|
static |
Get the default density of a collision if its density is not specified.
sdf::ElementPtr sdf::SDF_VERSION_NAMESPACE::Collision::Element | ( | ) | const |
const Geometry * sdf::SDF_VERSION_NAMESPACE::Collision::Geom | ( | ) | const |
Get a pointer to the collisions's geometry.
Errors sdf::SDF_VERSION_NAMESPACE::Collision::Load | ( | ElementPtr | _sdf | ) |
Errors sdf::SDF_VERSION_NAMESPACE::Collision::Load | ( | sdf::ElementPtr | _sdf, |
const ParserConfig & | _config | ||
) |
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.
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.
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>).
sdf::SemanticPose sdf::SDF_VERSION_NAMESPACE::Collision::SemanticPose | ( | ) | const |
Get SemanticPose object of this object to aid in resolving poses.
void sdf::SDF_VERSION_NAMESPACE::Collision::SetAutoInertiaParams | ( | const sdf::ElementPtr | _autoInertiaParams | ) |
Function to set the auto inertia params using a sdf ElementPtr object.
[in] | _autoInertiaParams | ElementPtr to <auto_inertia_params> element |
void sdf::SDF_VERSION_NAMESPACE::Collision::SetDensity | ( | double | _density | ) |
Set the density of the collision.
[in] | _density | Density of the collision. |
void sdf::SDF_VERSION_NAMESPACE::Collision::SetGeom | ( | const Geometry & | _geom | ) |
Set the collision's geometry.
[in] | _geom | The geometry of the collision object |
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.
[in] | _name | Name of the collision. |
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.
[in] | _frame | The name of the pose relative-to frame. |
void sdf::SDF_VERSION_NAMESPACE::Collision::SetRawPose | ( | const gz::math::Pose3d & | _pose | ) |
Set the pose of the collision object.
[in] | _pose | The pose of the collision object. |
void sdf::SDF_VERSION_NAMESPACE::Collision::SetSurface | ( | const sdf::Surface & | _surface | ) |
Set the collision's surface parameters.
[in] | _surface | The surface parameters of the collision object |
const sdf::Surface * sdf::SDF_VERSION_NAMESPACE::Collision::Surface | ( | ) | const |
Get a pointer to the collisions's surface parameters.
sdf::ElementPtr sdf::SDF_VERSION_NAMESPACE::Collision::ToElement | ( | ) | const |
sdf::ElementPtr sdf::SDF_VERSION_NAMESPACE::Collision::ToElement | ( | sdf::Errors & | _errors | ) | const |