Tesseract
Motion Planning Environment
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
tesseract_common::CollisionMarginData Class Reference

Stores information about how the margins allowed between collision objects. More...

#include <collision_margin_data.h>

Collaboration diagram for tesseract_common::CollisionMarginData:
Collaboration graph
[legend]

Public Types

using Ptr = std::shared_ptr< CollisionMarginData >
 
using ConstPtr = std::shared_ptr< const CollisionMarginData >
 

Public Member Functions

 CollisionMarginData (double default_collision_margin=0)
 
 CollisionMarginData (double default_collision_margin, PairsCollisionMarginData pair_collision_margins)
 
 CollisionMarginData (PairsCollisionMarginData pair_collision_margins)
 
void setDefaultCollisionMargin (double default_collision_margin)
 Set the default collision margin. More...
 
double getDefaultCollisionMargin () const
 Get the default collision margin. More...
 
void setPairCollisionMargin (const std::string &obj1, const std::string &obj2, double collision_margin)
 Set the margin for a given contact pair. More...
 
double getPairCollisionMargin (const std::string &obj1, const std::string &obj2) const
 Get the pairs collision margin data. More...
 
const PairsCollisionMarginDatagetPairCollisionMargins () const
 Get Collision Margin Data for stored pairs. More...
 
double getMaxCollisionMargin () const
 Get the largest collision margin. More...
 
void incrementMargins (const double &increment)
 Increment all margins by input amount. Useful for inflating or reducing margins. More...
 
void scaleMargins (const double &scale)
 Scale all margins by input value. More...
 
void apply (const CollisionMarginData &collision_margin_data, CollisionMarginOverrideType override_type)
 Apply the contents of the provide CollisionMarginData based on the override type. More...
 
bool operator== (const CollisionMarginData &rhs) const
 
bool operator!= (const CollisionMarginData &rhs) const
 

Private Member Functions

void updateMaxCollisionMargin ()
 Update the max collision margin. More...
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Attributes

double default_collision_margin_ { 0 }
 Stores the collision margin used if no pair-specific one is set. More...
 
double max_collision_margin_ { 0 }
 Stores the largest collision margin. More...
 
PairsCollisionMarginData lookup_table_
 A map of link pair names to contact distance. More...
 

Friends

class boost::serialization::access
 

Detailed Description

Stores information about how the margins allowed between collision objects.

Member Typedef Documentation

◆ ConstPtr

◆ Ptr

Constructor & Destructor Documentation

◆ CollisionMarginData() [1/3]

tesseract_common::CollisionMarginData::CollisionMarginData ( double  default_collision_margin = 0)
inline

◆ CollisionMarginData() [2/3]

tesseract_common::CollisionMarginData::CollisionMarginData ( double  default_collision_margin,
PairsCollisionMarginData  pair_collision_margins 
)
inline

◆ CollisionMarginData() [3/3]

tesseract_common::CollisionMarginData::CollisionMarginData ( PairsCollisionMarginData  pair_collision_margins)
inline

Member Function Documentation

◆ apply()

void tesseract_common::CollisionMarginData::apply ( const CollisionMarginData collision_margin_data,
CollisionMarginOverrideType  override_type 
)
inline

Apply the contents of the provide CollisionMarginData based on the override type.

Parameters
collision_margin_dataThe collision margin data to apply
override_typeThe type indicating how the provided data should be applied.

◆ getDefaultCollisionMargin()

double tesseract_common::CollisionMarginData::getDefaultCollisionMargin ( ) const
inline

Get the default collision margin.

Returns
default collision margin

◆ getMaxCollisionMargin()

double tesseract_common::CollisionMarginData::getMaxCollisionMargin ( ) const
inline

Get the largest collision margin.

This used when setting the contact distance in the contact manager.

Returns
Max contact distance threshold

◆ getPairCollisionMargin()

double tesseract_common::CollisionMarginData::getPairCollisionMargin ( const std::string &  obj1,
const std::string &  obj2 
) const
inline

Get the pairs collision margin data.

If a collision margin for the request pair does not exist it returns the default collision margin data.

Parameters
obj1The first object name
obj2The second object name
Returns
A Vector2d[Contact Distance Threshold, Coefficient]

◆ getPairCollisionMargins()

const PairsCollisionMarginData & tesseract_common::CollisionMarginData::getPairCollisionMargins ( ) const
inline

Get Collision Margin Data for stored pairs.

Returns
A map of link pairs collision margin data

◆ incrementMargins()

void tesseract_common::CollisionMarginData::incrementMargins ( const double &  increment)
inline

Increment all margins by input amount. Useful for inflating or reducing margins.

Parameters
incrementAmount to increment margins

◆ operator!=()

bool tesseract_common::CollisionMarginData::operator!= ( const CollisionMarginData rhs) const

◆ operator==()

bool tesseract_common::CollisionMarginData::operator== ( const CollisionMarginData rhs) const

◆ scaleMargins()

void tesseract_common::CollisionMarginData::scaleMargins ( const double &  scale)
inline

Scale all margins by input value.

Parameters
scaleValue by which all margins are multiplied

◆ serialize()

template<class Archive >
void tesseract_common::CollisionMarginData::serialize ( Archive &  ar,
const unsigned int  version 
)
private

◆ setDefaultCollisionMargin()

void tesseract_common::CollisionMarginData::setDefaultCollisionMargin ( double  default_collision_margin)
inline

Set the default collision margin.

Parameters
default_collision_marginNew default collision margin

◆ setPairCollisionMargin()

void tesseract_common::CollisionMarginData::setPairCollisionMargin ( const std::string &  obj1,
const std::string &  obj2,
double  collision_margin 
)
inline

Set the margin for a given contact pair.

The order of the object names does not matter, that is handled internal to the class.

Parameters
obj1The first object name. Order doesn't matter
obj2The Second object name. Order doesn't matter
collision_margincontacts with distance < collision_margin are considered in collision

◆ updateMaxCollisionMargin()

void tesseract_common::CollisionMarginData::updateMaxCollisionMargin ( )
inlineprivate

Update the max collision margin.

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Member Data Documentation

◆ default_collision_margin_

double tesseract_common::CollisionMarginData::default_collision_margin_ { 0 }
private

Stores the collision margin used if no pair-specific one is set.

◆ lookup_table_

PairsCollisionMarginData tesseract_common::CollisionMarginData::lookup_table_
private

A map of link pair names to contact distance.

◆ max_collision_margin_

double tesseract_common::CollisionMarginData::max_collision_margin_ { 0 }
private

Stores the largest collision margin.


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