Drake
Element Class Reference

The underyling primitive class used for collision analysis. More...

#include <drake/multibody/collision/element.h>

Inheritance diagram for Element:
[legend]
Collaboration diagram for Element:
[legend]

Public Member Functions

 Element ()
 Default constructor. More...
 
 Element (const DrakeShapes::Geometry &geometry, const Eigen::Isometry3d &T_element_to_local=Eigen::Isometry3d::Identity())
 Geometry constructor. More...
 
 Element (const Eigen::Isometry3d &T_element_to_local, const RigidBody< double > *body)
 Body constructor. More...
 
 Element (const DrakeShapes::Geometry &geometry, const Eigen::Isometry3d &T_element_to_local, const RigidBody< double > *body)
 Full constructor. More...
 
 ~Element () override
 
Elementclone () const override
 
ElementId getId () const
 
void set_anchored ()
 Flags this collision element to be anchored, i.e. More...
 
bool is_anchored () const
 Returns true if the shape does not move relative to the world frame. More...
 
bool CanCollideWith (const Element *other) const
 Returns true if this element should be checked for collisions with the other object. More...
 
void AddToCollisionClique (int clique_id)
 Adds this element to the clique specified by the given clique id. More...
 
int get_num_cliques () const
 Reports the number of cliques to which this element belongs. More...
 
const std::vector< int > & collision_cliques () const
 Provides access to the set of cliques to which this element belongs. More...
 
const RigidBody< double > * get_body () const
 Returns a pointer to the RigidBody to which this Element is attached. More...
 
void set_body (const RigidBody< double > *body)
 Sets the RigidBody this collision element is attached to. More...
 
void set_collision_filter (const bitmask &group, const bitmask &ignores)
 Sets the collision filter state of the element: the groups to which this element belongs and the groups that it should ignore. More...
 
const bitmaskget_collision_filter_group () const
 
const bitmaskget_collision_filter_ignores () const
 
- Public Member Functions inherited from Element
 Element (const Geometry &geometry_in, const Eigen::Isometry3d &T_element_to_local_in)
 
 Element (const Geometry &geometry_in)
 
 Element (const Eigen::Isometry3d &T_element_to_local_in)
 
const Eigen::Isometry3d & getWorldTransform () const
 
const Eigen::Isometry3d & getLocalTransform () const
 
void SetLocalTransform (const Eigen::Isometry3d &T_element_to_local)
 
void updateWorldTransform (const Eigen::Isometry3d &T_local_to_world)
 
Shape getShape () const
 
void setGeometry (const Geometry &geometry)
 
bool hasGeometry () const
 
const GeometrygetGeometry () const
 
void getTerrainContactPoints (Eigen::Matrix3Xd &points) const
 

Friends

std::ostream & operator<< (std::ostream &, const Element &)
 A toString method for this class. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Element
 Element (const Element &)
 
void operator= (const Element &)=delete
 
 Element (Element &&)=delete
 
void operator= (Element &&)=delete
 
void setWorldTransform (const Eigen::Isometry3d &T_elem_to_world)
 
- Protected Attributes inherited from Element
Eigen::Isometry3d T_element_to_world
 
Eigen::Isometry3d T_element_to_local
 
std::unique_ptr< Geometrygeometry
 

Detailed Description

The underyling primitive class used for collision analysis.

Collisions between RigidBody instances are determined by performing geometry analysis on the RigidBody instances' corresponding collision Elements. As such, The Element combines three pieces of data:

  • the geometric definition of the element's colliding shape (a Geometry instance referred to as its "geometry").
  • the transform T_element_to_local (T_LE) giving the pose of the element's frame E in the body's local frame L, with the sense that p_L = T_LE * p_E for points measured and expressed in frames L and E, respectively.
  • the RigidBody instance to which this element belongs (its "body"). A RigidBody can possess multiple collision Elements, but an Element can only belong to a single RigidBody.

Constructor & Destructor Documentation

Element ( )

Default constructor.

The element's pose will be the identity with no geometry or rigid body.

Here is the caller graph for this function:

Element ( const DrakeShapes::Geometry geometry,
const Eigen::Isometry3d &  T_element_to_local = Eigen::Isometry3d::Identity() 
)

Geometry constructor.

Defines geometry and pose but no body.

Parameters
[in]geometryThe colliding geometry.
[in]T_element_to_localThe pose (defaults to identity).
Element ( const Eigen::Isometry3d &  T_element_to_local,
const RigidBody< double > *  body 
)

Body constructor.

Defines body and pose but no geometry.

Parameters
[in]T_element_to_localThe pose (defaults to identity).
[in]bodyThe associated rigid body.
Element ( const DrakeShapes::Geometry geometry,
const Eigen::Isometry3d &  T_element_to_local,
const RigidBody< double > *  body 
)

Full constructor.

Parameters
[in]geometryThe colliding geometry.
[in]T_element_to_localThe pose.
[in]bodyThe associated rigid body.
~Element ( )
inlineoverridevirtual

Reimplemented from Element.

Here is the call graph for this function:

Member Function Documentation

void AddToCollisionClique ( int  clique_id)

Adds this element to the clique specified by the given clique id.

The clique may be a previously existing clique or a new clique. If the element already belongs to the clique, there will be no change.

Parameters
[in]clique_idThe clique to which this element will belong to.

Here is the caller graph for this function:

bool CanCollideWith ( const Element other) const

Returns true if this element should be checked for collisions with the other object.

CanCollideWith() is commutative; A can collide with B implies B can collide with A.

Here is the call graph for this function:

Here is the caller graph for this function:

Element * clone ( ) const
overridevirtual

Reimplemented from Element.

Here is the call graph for this function:

Here is the caller graph for this function:

const std::vector< int > & collision_cliques ( ) const

Provides access to the set of cliques to which this element belongs.

Returns
A reference to the clique set (as a montonically increasing ordered list).

Here is the caller graph for this function:

const RigidBody< double > * get_body ( ) const

Returns a pointer to the RigidBody to which this Element is attached.

Here is the caller graph for this function:

const bitmask& get_collision_filter_group ( ) const
inline
const bitmask& get_collision_filter_ignores ( ) const
inline

Here is the call graph for this function:

int get_num_cliques ( ) const

Reports the number of cliques to which this element belongs.

Returns
The number of cliques.

Here is the caller graph for this function:

ElementId getId ( ) const

Here is the caller graph for this function:

bool is_anchored ( ) const
inline

Returns true if the shape does not move relative to the world frame.

For instance, terrain geometry would commonly be anchored. This property allows the collision engine to perform certain optimizations not generally possible for moving objects.

Here is the call graph for this function:

Here is the caller graph for this function:

void set_anchored ( )
inline

Flags this collision element to be anchored, i.e.

it does not move relative to the world frame.

See also
Element::is_anchored().
void set_body ( const RigidBody< double > *  body)

Sets the RigidBody this collision element is attached to.

Here is the caller graph for this function:

void set_collision_filter ( const bitmask group,
const bitmask ignores 
)

Sets the collision filter state of the element: the groups to which this element belongs and the groups that it should ignore.

Here is the caller graph for this function:

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const Element ee 
)
friend

A toString method for this class.


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