Drake
CollisionFilterGroup< T > Class Template Reference

The specification of a collision filter group: its name, bodies that belong to it, and the names of collision filter groups that it ignores. More...

#include <multibody/collision/collision_filter.h>

Public Member Functions

 CollisionFilterGroup ()
 Default constructor required by use in std::unordered_map. More...
 
 CollisionFilterGroup (const std::string &name, int id)
 
int get_mask_id () const
 
void add_body (const RigidBody< T > &body)
 
std::vector< const RigidBody< T > * > & get_bodies ()
 
const std::vector< std::string > & get_ignore_groups () const
 
void add_ignore_group (const std::string &group_name)
 
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable
 CollisionFilterGroup (const CollisionFilterGroup &)=default
 
CollisionFilterGroupoperator= (const CollisionFilterGroup &)=default
 
 CollisionFilterGroup (CollisionFilterGroup &&)=default
 
CollisionFilterGroupoperator= (CollisionFilterGroup &&)=default
 

Detailed Description

template<typename T>
class drake::multibody::collision::CollisionFilterGroup< T >

The specification of a collision filter group: its name, bodies that belong to it, and the names of collision filter groups that it ignores.

This class is used for initialization and not run-time calculations.

A collision filter group is a mechanism for cheaply culling pairs of collision elements from consideration during collision detection. One collision filter group associates a set of bodies with a set of ignored collision filter groups. At runtime, when a pair of bodies \((A, B)\) are determined to be a collision candidate, their collision filter group membership is examined.

Given the following definitions:

  • \(G(A) ≜ \{g^A_0, g^A_1, ..., g^A_n\}\) is the set of all groups to which \(A\) belongs,
  • \(I(f) ≜ \{g^f_0, g^f_1, ..., g^f_m\}\) is the set set of all groups that group \(f\) ignores,
  • \(I(A) ≜ \{I(g^A_0) \cap I(g^A_1) \cap ... \cap I(g^A_n)\}\) such that \(g^A_i \in G(A)\) is the set of all groups that \(A\) ignores.

Then, the pair \((A, B)\) will be filtered if:

\(I(A) \cap G(B) \ne \emptyset \lor I(B) \cap G(A) \ne \emptyset\).

In other words, if either body belongs to a group which is ignored by any group the other body belongs to.

Template Parameters
TA valid Eigen scalar type.

Constructor & Destructor Documentation

CollisionFilterGroup ( const CollisionFilterGroup< T > &  )
default

Default constructor required by use in std::unordered_map.

CollisionFilterGroup ( const std::string &  name,
int  id 
)
Parameters
nameThe name for the collision filter group.
idThe bit id for this collision filter group.

Member Function Documentation

void add_body ( const RigidBody< T > &  body)
inline

Here is the caller graph for this function:

void add_ignore_group ( const std::string &  group_name)
inline
std::vector<const RigidBody<T>*>& get_bodies ( )
inline

Here is the caller graph for this function:

const std::vector<std::string>& get_ignore_groups ( ) const
inline

Here is the caller graph for this function:

int get_mask_id ( ) const
inline

Here is the caller graph for this function:

CollisionFilterGroup& operator= ( const CollisionFilterGroup< T > &  )
default
CollisionFilterGroup& operator= ( CollisionFilterGroup< T > &&  )
default

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