Tesseract 0.28.4
Loading...
Searching...
No Matches
tesseract::collision::FCLDiscreteBVHManager Class Reference

A FCL implementation of the discrete contact manager. More...

#include <fcl_discrete_managers.h>

Inheritance diagram for tesseract::collision::FCLDiscreteBVHManager:

Public Types

using Ptr = std::shared_ptr<FCLDiscreteBVHManager>
using ConstPtr = std::shared_ptr<const FCLDiscreteBVHManager>
using UPtr = std::unique_ptr<FCLDiscreteBVHManager>
using ConstUPtr = std::unique_ptr<const FCLDiscreteBVHManager>
Public Types inherited from tesseract::collision::DiscreteContactManager
using Ptr = std::shared_ptr<DiscreteContactManager>
using ConstPtr = std::shared_ptr<const DiscreteContactManager>
using UPtr = std::unique_ptr<DiscreteContactManager>
using ConstUPtr = std::unique_ptr<const DiscreteContactManager>

Public Member Functions

 FCLDiscreteBVHManager (std::string name="FCLDiscreteBVHManager")
 FCLDiscreteBVHManager (const FCLDiscreteBVHManager &)=delete
FCLDiscreteBVHManager & operator= (const FCLDiscreteBVHManager &)=delete
 FCLDiscreteBVHManager (FCLDiscreteBVHManager &&)=delete
FCLDiscreteBVHManager & operator= (FCLDiscreteBVHManager &&)=delete
std::string getName () const override final
 Get the name of the contact manager.
DiscreteContactManager::UPtr clone () const override final
 Clone the manager.
bool addCollisionObject (const tesseract::common::LinkId &id, const int &mask_id, const CollisionShapesConst &shapes, const tesseract::common::VectorIsometry3d &shape_poses, bool enabled=true) override final
 Add a object to the checker.
bool addCollisionObjects (const std::vector< CollisionObjectSpec > &objects) override final
 Add a batch of collision objects, applying one broadphase update per batch where the backend supports it.
const CollisionShapesConst & getCollisionObjectGeometries (const tesseract::common::LinkId &id) const override final
 Get a collision objects collision geometries.
const tesseract::common::VectorIsometry3d & getCollisionObjectGeometriesTransforms (const tesseract::common::LinkId &id) const override final
 Get a collision objects collision geometries transforms.
bool hasCollisionObject (const tesseract::common::LinkId &id) const override final
 Find if a collision object already exists.
bool removeCollisionObject (const tesseract::common::LinkId &id) override final
 Remove an object from the checker.
bool removeCollisionObjects (const std::vector< tesseract::common::LinkId > &ids) override final
 Remove a batch of collision objects, applying one broadphase and cache update per batch where the backend supports it.
bool enableCollisionObject (const tesseract::common::LinkId &id) override final
 Enable an object.
bool disableCollisionObject (const tesseract::common::LinkId &id) override final
 Disable an object.
bool isCollisionObjectEnabled (const tesseract::common::LinkId &id) const override final
 Check if collision object is enabled.
void setCollisionObjectsTransform (const tesseract::common::LinkId &id, const Eigen::Isometry3d &pose) override final
 Set a single collision object's transforms.
Eigen::Isometry3d getCollisionObjectsTransform (const tesseract::common::LinkId &id) const override final
 Get the world transform of a single collision object.
void setCollisionObjectsTransform (const tesseract::common::LinkIdTransformMap &transforms) override final
 Set a series of collision object's transforms.
void setCollisionObjectsTransform (const std::vector< tesseract::common::LinkId > &ids, const tesseract::common::VectorIsometry3d &poses) override final
 Set a series of collision object's transforms.
const std::vector< tesseract::common::LinkId > & getCollisionObjects () const override final
 Get all collision objects.
void setActiveCollisionObjects (const std::unordered_set< tesseract::common::LinkId > &ids) override final
 Set which collision objects can move.
const std::unordered_set< tesseract::common::LinkId > & getActiveCollisionObjects () const override final
 Get which collision objects can move.
void setCollisionMarginData (CollisionMarginData collision_margin_data) override final
 Set the contact distance threshold.
const CollisionMarginData & getCollisionMarginData () const override final
 Get the contact distance threshold.
void setCollisionMarginPairData (const CollisionMarginPairData &pair_margin_data, CollisionMarginPairOverrideType override_type=CollisionMarginPairOverrideType::REPLACE) override final
 Set the contact distance thresholds for which collision should be considered on a per pair basis.
void setDefaultCollisionMargin (double default_collision_margin) override final
 Set the default collision margin.
void setCollisionMarginPair (const tesseract::common::LinkId &id1, const tesseract::common::LinkId &id2, double collision_margin) override final
 Set the margin for a given contact pair.
void incrementCollisionMargin (double increment) override final
 Increment the collision margin data by some value.
void setContactAllowedValidator (std::shared_ptr< const tesseract::common::ContactAllowedValidator > validator) override final
 Set the active function for determining if two links are allowed to be in collision.
std::shared_ptr< const tesseract::common::ContactAllowedValidator > getContactAllowedValidator () const override final
 Get the active function for determining if two links are allowed to be in collision.
void contactTest (ContactResultMap &collisions, const ContactRequest &request) override final
 Perform a contact test for all objects based.
void addCollisionObject (const fcl_internal::COW::Ptr &cow)
 Add a fcl collision object to the manager.
virtual void setActiveCollisionObjects (const std::vector< tesseract::common::LinkId > &ids)
 Set which collision objects can move by vector (delegates to set overload).
virtual void setActiveCollisionObjects (std::initializer_list< tesseract::common::LinkId > ids)
 Set which collision objects can move by initializer list (delegates to set overload).
virtual void setCollisionObjectsTransform (const std::unordered_set< tesseract::common::LinkId > &ids, const tesseract::common::LinkIdTransformMap &state)
 Set the transforms of a set of collision objects from a transform map.
virtual void setCollisionObjectsTransform (const std::vector< tesseract::common::LinkId > &ids, const tesseract::common::LinkIdTransformMap &state)
 Set the transforms of a list of collision objects from a transform map.
Public Member Functions inherited from tesseract::collision::DiscreteContactManager
 DiscreteContactManager (const DiscreteContactManager &)=delete
DiscreteContactManager & operator= (const DiscreteContactManager &)=delete
 DiscreteContactManager (DiscreteContactManager &&)=delete
DiscreteContactManager & operator= (DiscreteContactManager &&)=delete
virtual bool setCollisionObjectsEnabled (const std::unordered_map< tesseract::common::LinkId, bool > &enabled)
 Enable or disable a batch of collision objects, applying one broadphase update per batch where the backend supports it.
bool setCollisionObjectsEnabled (const std::vector< tesseract::common::LinkId > &ids, bool enabled)
 Enable or disable a batch of collision objects that all take the same state.
virtual void applyContactManagerConfig (const ContactManagerConfig &config)
 Applies settings in the config.

Detailed Description

A FCL implementation of the discrete contact manager.

Member Function Documentation

◆ getName()

std::string tesseract::collision::FCLDiscreteBVHManager::getName ( ) const
finaloverridevirtual

Get the name of the contact manager.

Returns
The name

Implements tesseract::collision::DiscreteContactManager.

◆ clone()

DiscreteContactManager::UPtr tesseract::collision::FCLDiscreteBVHManager::clone ( ) const
finaloverridevirtual

Clone the manager.

This is to be used for multi threaded application. A user should make a clone for each thread.

Implements tesseract::collision::DiscreteContactManager.

◆ addCollisionObject() [1/2]

bool tesseract::collision::FCLDiscreteBVHManager::addCollisionObject ( const tesseract::common::LinkId & id,
const int & mask_id,
const CollisionShapesConst & shapes,
const tesseract::common::VectorIsometry3d & shape_poses,
bool enabled = true )
finaloverridevirtual

Add a object to the checker.

Parameters
idThe LinkId of the object, must be unique.
mask_idUser defined id which gets stored in the results structure.
shapesA vector of shapes that make up the collision object.
shape_posesA vector of poses for each shape, must be same length as shapes
Returns
true if successfully added, otherwise false.

Implements tesseract::collision::DiscreteContactManager.

◆ addCollisionObjects()

bool tesseract::collision::FCLDiscreteBVHManager::addCollisionObjects ( const std::vector< CollisionObjectSpec > & objects)
finaloverridevirtual

Add a batch of collision objects, applying one broadphase update per batch where the backend supports it.

Observably equivalent to calling addCollisionObject once per entry, in order. A false return still leaves every object that was added registered; only the failing ones are absent. Within one batch a repeated id behaves as the repeated single calls do: the last entry naming that id decides both the object and its position in getCollisionObjects(), and if that last entry fails the id is left unregistered even when an earlier entry for it succeeded. Equivalence covers returns, not throws: building an object may throw, and a backend that builds the whole batch before it mutates anything then leaves the manager untouched where the repeated single calls would have left the earlier entries applied.

Parameters
objectsThe objects to add
Returns
False if any object failed to be added

Reimplemented from tesseract::collision::DiscreteContactManager.

◆ getCollisionObjectGeometries()

const CollisionShapesConst & tesseract::collision::FCLDiscreteBVHManager::getCollisionObjectGeometries ( const tesseract::common::LinkId & id) const
finaloverridevirtual

Get a collision objects collision geometries.

Parameters
idThe collision object's LinkId
Returns
A vector of collision geometries. The vector will be empty if the collision object is not found.

Implements tesseract::collision::DiscreteContactManager.

◆ getCollisionObjectGeometriesTransforms()

const tesseract::common::VectorIsometry3d & tesseract::collision::FCLDiscreteBVHManager::getCollisionObjectGeometriesTransforms ( const tesseract::common::LinkId & id) const
finaloverridevirtual

Get a collision objects collision geometries transforms.

Parameters
idThe collision object's LinkId
Returns
A vector of collision geometries transforms. The vector will be empty if the collision object is not found.

Implements tesseract::collision::DiscreteContactManager.

◆ hasCollisionObject()

bool tesseract::collision::FCLDiscreteBVHManager::hasCollisionObject ( const tesseract::common::LinkId & id) const
finaloverridevirtual

Find if a collision object already exists.

Parameters
idThe LinkId of the collision object
Returns
true if it exists, otherwise false.

Implements tesseract::collision::DiscreteContactManager.

◆ removeCollisionObject()

bool tesseract::collision::FCLDiscreteBVHManager::removeCollisionObject ( const tesseract::common::LinkId & id)
finaloverridevirtual

Remove an object from the checker.

Parameters
idThe LinkId of the object
Returns
true if successfully removed, otherwise false.

Implements tesseract::collision::DiscreteContactManager.

◆ removeCollisionObjects()

bool tesseract::collision::FCLDiscreteBVHManager::removeCollisionObjects ( const std::vector< tesseract::common::LinkId > & ids)
finaloverridevirtual

Remove a batch of collision objects, applying one broadphase and cache update per batch where the backend supports it.

Observably equivalent to calling removeCollisionObject once per id, in order. Within one batch a repeated id behaves as the repeated single calls do: the first occurrence removes it and the second reports it absent.

Parameters
idsThe LinkIds to remove; ids the manager does not hold are skipped
Returns
False if any id was absent; every id that was present is still removed

Reimplemented from tesseract::collision::DiscreteContactManager.

◆ enableCollisionObject()

bool tesseract::collision::FCLDiscreteBVHManager::enableCollisionObject ( const tesseract::common::LinkId & id)
finaloverridevirtual

Enable an object.

Parameters
idThe LinkId of the object

Implements tesseract::collision::DiscreteContactManager.

◆ disableCollisionObject()

bool tesseract::collision::FCLDiscreteBVHManager::disableCollisionObject ( const tesseract::common::LinkId & id)
finaloverridevirtual

Disable an object.

Parameters
idThe LinkId of the object

Implements tesseract::collision::DiscreteContactManager.

◆ isCollisionObjectEnabled()

bool tesseract::collision::FCLDiscreteBVHManager::isCollisionObjectEnabled ( const tesseract::common::LinkId & id) const
finaloverridevirtual

Check if collision object is enabled.

Parameters
idThe LinkId of the object
Returns
True if enabled, otherwise false

Implements tesseract::collision::DiscreteContactManager.

◆ setCollisionObjectsTransform() [1/5]

void tesseract::collision::FCLDiscreteBVHManager::setCollisionObjectsTransform ( const tesseract::common::LinkId & id,
const Eigen::Isometry3d & pose )
finaloverridevirtual

Set a single collision object's transforms.

Parameters
idThe LinkId of the object
poseThe transformation in world

Implements tesseract::collision::DiscreteContactManager.

◆ getCollisionObjectsTransform()

Eigen::Isometry3d tesseract::collision::FCLDiscreteBVHManager::getCollisionObjectsTransform ( const tesseract::common::LinkId & id) const
finaloverridevirtual

Get the world transform of a single collision object.

Parameters
idThe LinkId of the object
Returns
The world transform of the collision object
Exceptions
std::out_of_rangeif the LinkId is not registered with the manager

Implements tesseract::collision::DiscreteContactManager.

◆ setCollisionObjectsTransform() [2/5]

void tesseract::collision::FCLDiscreteBVHManager::setCollisionObjectsTransform ( const tesseract::common::LinkIdTransformMap & transforms)
finaloverridevirtual

Set a series of collision object's transforms.

Parameters
transformsA transform map <LinkId, pose>

Implements tesseract::collision::DiscreteContactManager.

◆ setCollisionObjectsTransform() [3/5]

void tesseract::collision::FCLDiscreteBVHManager::setCollisionObjectsTransform ( const std::vector< tesseract::common::LinkId > & ids,
const tesseract::common::VectorIsometry3d & poses )
finaloverridevirtual

Set a series of collision object's transforms.

Parameters
idsThe LinkIds of the objects
posesThe poses, one per id
Exceptions
std::runtime_errorif ids and poses differ in size

Reimplemented from tesseract::collision::DiscreteContactManager.

◆ getCollisionObjects()

const std::vector< tesseract::common::LinkId > & tesseract::collision::FCLDiscreteBVHManager::getCollisionObjects ( ) const
finaloverridevirtual

Get all collision objects.

Returns
A list of collision object IDs

Implements tesseract::collision::DiscreteContactManager.

◆ setActiveCollisionObjects() [1/3]

void tesseract::collision::FCLDiscreteBVHManager::setActiveCollisionObjects ( const std::unordered_set< tesseract::common::LinkId > & ids)
finaloverridevirtual

Set which collision objects can move.

Parameters
idsA set of LinkIds identifying the active collision objects

Implements tesseract::collision::DiscreteContactManager.

◆ getActiveCollisionObjects()

const std::unordered_set< tesseract::common::LinkId > & tesseract::collision::FCLDiscreteBVHManager::getActiveCollisionObjects ( ) const
finaloverridevirtual

Get which collision objects can move.

Returns
A set of active collision object LinkIds

Implements tesseract::collision::DiscreteContactManager.

◆ setCollisionMarginData()

void tesseract::collision::FCLDiscreteBVHManager::setCollisionMarginData ( CollisionMarginData collision_margin_data)
finaloverridevirtual

Set the contact distance threshold.

Parameters
collision_margin_dataThe contact distance

Implements tesseract::collision::DiscreteContactManager.

◆ getCollisionMarginData()

const CollisionMarginData & tesseract::collision::FCLDiscreteBVHManager::getCollisionMarginData ( ) const
finaloverridevirtual

Get the contact distance threshold.

Returns
The contact distance

Implements tesseract::collision::DiscreteContactManager.

◆ setCollisionMarginPairData()

void tesseract::collision::FCLDiscreteBVHManager::setCollisionMarginPairData ( const CollisionMarginPairData & pair_margin_data,
CollisionMarginPairOverrideType override_type = CollisionMarginPairOverrideType::REPLACE )
finaloverridevirtual

Set the contact distance thresholds for which collision should be considered on a per pair basis.

Parameters
pair_margin_dataContains the pair collision margins that will replace the current settings
override_typeThis determines how the provided CollisionMarginData is applied

Implements tesseract::collision::DiscreteContactManager.

◆ setDefaultCollisionMargin()

void tesseract::collision::FCLDiscreteBVHManager::setDefaultCollisionMargin ( double default_collision_margin)
finaloverridevirtual

Set the default collision margin.

Parameters
default_collision_marginNew default collision margin

Implements tesseract::collision::DiscreteContactManager.

◆ setCollisionMarginPair()

void tesseract::collision::FCLDiscreteBVHManager::setCollisionMarginPair ( const tesseract::common::LinkId & id1,
const tesseract::common::LinkId & id2,
double collision_margin )
finaloverridevirtual

Set the margin for a given contact pair.

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

Parameters
obj1The first object id. Order doesn't matter
obj2The Second object id. Order doesn't matter
collision_margincontacts with distance < collision_margin are considered in collision
Note
Each call re-evaluates the margin of every object in the manager. To set many pairs, build a CollisionMarginPairData and use setCollisionMarginPairData, which does that sweep once.

Implements tesseract::collision::DiscreteContactManager.

◆ incrementCollisionMargin()

void tesseract::collision::FCLDiscreteBVHManager::incrementCollisionMargin ( double increment)
finaloverridevirtual

Increment the collision margin data by some value.

Parameters
incrementThe value to increment the collision margin value

Implements tesseract::collision::DiscreteContactManager.

◆ setContactAllowedValidator()

void tesseract::collision::FCLDiscreteBVHManager::setContactAllowedValidator ( std::shared_ptr< const tesseract::common::ContactAllowedValidator > validator)
finaloverridevirtual

Set the active function for determining if two links are allowed to be in collision.

Implements tesseract::collision::DiscreteContactManager.

◆ getContactAllowedValidator()

std::shared_ptr< const tesseract::common::ContactAllowedValidator > tesseract::collision::FCLDiscreteBVHManager::getContactAllowedValidator ( ) const
finaloverridevirtual

Get the active function for determining if two links are allowed to be in collision.

Implements tesseract::collision::DiscreteContactManager.

◆ contactTest()

void tesseract::collision::FCLDiscreteBVHManager::contactTest ( ContactResultMap & collisions,
const ContactRequest & request )
finaloverridevirtual

Perform a contact test for all objects based.

Parameters
collisionsThe contact results data
requestThe contact request data

Implements tesseract::collision::DiscreteContactManager.

◆ addCollisionObject() [2/2]

void tesseract::collision::FCLDiscreteBVHManager::addCollisionObject ( const fcl_internal::COW::Ptr & cow)

Add a fcl collision object to the manager.

Parameters
cowThe tesseract fcl collision object

◆ setActiveCollisionObjects() [2/3]

void tesseract::collision::DiscreteContactManager::setActiveCollisionObjects ( const std::vector< tesseract::common::LinkId > & ids)
virtual

Set which collision objects can move by vector (delegates to set overload).

Reimplemented from tesseract::collision::DiscreteContactManager.

◆ setActiveCollisionObjects() [3/3]

void tesseract::collision::DiscreteContactManager::setActiveCollisionObjects ( std::initializer_list< tesseract::common::LinkId > ids)
virtual

Set which collision objects can move by initializer list (delegates to set overload).

Reimplemented from tesseract::collision::DiscreteContactManager.

◆ setCollisionObjectsTransform() [4/5]

void tesseract::collision::DiscreteContactManager::setCollisionObjectsTransform ( const std::unordered_set< tesseract::common::LinkId > & ids,
const tesseract::common::LinkIdTransformMap & state )
virtual

Set the transforms of a set of collision objects from a transform map.

Parameters
idsThe LinkIds of the objects to update
stateA transform map that must contain every id
Exceptions
std::out_of_rangeif an id is absent from state

Reimplemented from tesseract::collision::DiscreteContactManager.

◆ setCollisionObjectsTransform() [5/5]

void tesseract::collision::DiscreteContactManager::setCollisionObjectsTransform ( const std::vector< tesseract::common::LinkId > & ids,
const tesseract::common::LinkIdTransformMap & state )
virtual

Set the transforms of a list of collision objects from a transform map.

Exceptions
std::out_of_rangeif an id is absent from state

Reimplemented from tesseract::collision::DiscreteContactManager.