collision_space::EnvironmentModelODE Class Reference

A class describing an environment for a kinematic robot using ODE. More...

#include <environmentODE.h>

Inheritance diagram for collision_space::EnvironmentModelODE:
Inheritance graph
[legend]

List of all members.

Classes

struct  CollisionData
struct  CollisionNamespace
struct  kGeom
struct  ModelInfo
class  ODECollide2
struct  ODEStorage
 Structure for maintaining ODE temporary data. More...

Public Member Functions

virtual void addObject (const std::string &ns, shapes::Shape *shape, const btTransform &pose)
 Add a collision object to the map. The user releases ownership of the passed object. Memory allocated for the shape is freed by the collision environment.
virtual void addObject (const std::string &ns, shapes::StaticShape *shape)
 Add a static collision object to the map. The user releases ownership of the passed object. Memory allocated for the shape is freed by the collision environment.
virtual void addObjects (const std::string &ns, const std::vector< shapes::Shape * > &shapes, const std::vector< btTransform > &poses)
 Add a set of collision objects to the map. The user releases ownership of the passed objects. Memory allocated for the shapes is freed by the collision environment.
virtual void addSelfCollisionGroup (const std::vector< std::string > &group1, const std::vector< std::string > &group2)
 Add a group of links to be checked for self collision.
virtual void clearObjects (const std::string &ns)
 Remove objects from a specific namespace in the collision model.
virtual void clearObjects (void)
 Remove all objects from collision model.
virtual EnvironmentModelclone (void) const
 Clone the environment.
 EnvironmentModelODE (void)
virtual const std::vector
< const
planning_models::KinematicModel::AttachedBodyModel * > 
getAttachedBodies (const std::string link_name) const
 Gets a vector of all the bodies currently attached to a link.
virtual const std::vector
< const
planning_models::KinematicModel::AttachedBodyModel * > 
getAttachedBodies (void) const
 Gets a vector of all the bodies currently attached to the robot.
virtual bool getCollisionContacts (const std::vector< AllowedContact > &allowedContacts, std::vector< Contact > &contacts, unsigned int max_count=1)
 Get the list of contacts (collisions).
virtual void getDefaultAllowedCollisionMatrix (std::vector< std::vector< bool > > &matrix, std::map< std::string, unsigned int > &ind) const
virtual bool isCollision (void)
 Check if a model is in collision.
virtual bool isSelfCollision (void)
 Check if a model is in self collision.
virtual void removeCollidingObjects (const shapes::Shape *shape, const btTransform &pose)
 Remove objects in the collision space that are collising with the object supplied as argument.
virtual void removeCollidingObjects (const shapes::StaticShape *shape)
 Remove objects in the collision space that are collising with the object supplied as argument.
virtual void removeSelfCollisionGroup (const std::vector< std::string > &group1, const std::vector< std::string > &group2)
 Remove a group of links to be checked for self collision.
virtual void revertAllowedCollisionMatrix ()
 reverts to using default settings for allowed collisions
virtual void revertRobotLinkPadding ()
virtual void setAllowedCollisionMatrix (const std::vector< std::vector< bool > > &matrix, const std::map< std::string, unsigned int > &ind)
 set the matrix for collision touch to use in lieu of the default settings
virtual int setCollisionCheck (const std::string &link, bool state)
 Enable/Disable collision checking for specific links. Return the previous value of the state (1 or 0) if succesful; -1 otherwise.
void setCollisionCheckAll (bool state)
 Set collision checking for all links to state.
void setCollisionCheckLinks (const std::vector< std::string > &links, bool state)
 Enable/Disable collision checking for a set of links.
void setCollisionCheckOnlyLinks (const std::vector< std::string > &links, bool state)
 Set collision checking for the set of links to state, set collision checking for all other links to !state.
virtual void setRobotLinkPadding (const std::map< std::string, double > &link_padding_map)
virtual void setRobotModel (const boost::shared_ptr< const planning_models::KinematicModel > &model, const std::vector< std::string > &links, const std::map< std::string, double > &link_padding_map, double default_padding=0.0, double scale=1.0)
 Add a robot model. Ignore robot links if their name is not specified in the string vector. The scale argument can be used to increase or decrease the size of the robot's bodies (multiplicative factor). The padding can be used to increase or decrease the robot's bodies with by an additive term.
void updateAllowedTouch (void)
void updateAllowedTouch (const std::map< std::string, double > &link_padding_map)
virtual void updateAttachedBodies (const std::map< std::string, double > &link_padding_map)
 Update the set of bodies that are attached to the robot (re-creates them) using the indicated padding or default if non-specified.
virtual void updateAttachedBodies (void)
 Update the set of bodies that are attached to the robot (re-creates them).
virtual void updateRobotModel (const planning_models::KinematicState *state)
 Update the positions of the geometry used in collision detection.
virtual ~EnvironmentModelODE (void)

Protected Member Functions

void checkThreadInit (void) const
 Check if thread-specific routines have been called.
dGeomID copyGeom (dSpaceID space, ODEStorage &storage, dGeomID geom, ODEStorage &sourceStorage) const
dGeomID createODEGeom (dSpaceID space, ODEStorage &storage, const shapes::StaticShape *shape)
dGeomID createODEGeom (dSpaceID space, ODEStorage &storage, const shapes::Shape *shape, double scale, double padding)
void createODERobotModel ()
void freeMemory (void)
void removeCollidingObjects (const dGeomID geom)
void testBodyCollision (CollisionNamespace *cn, CollisionData *data)
 Internal function for collision detection.
void testCollision (CollisionData *data)
 Internal function for collision detection.
void testSelfCollision (CollisionData *data)
 Internal function for collision detection.
void updateGeom (dGeomID geom, const btTransform &pose) const

Protected Attributes

std::map< std::string,
CollisionNamespace * > 
m_collNs
ModelInfo m_modelGeom
std::vector< bool > stored_collision_check

Friends

void nearCallbackFn (void *data, dGeomID o1, dGeomID o2)

Detailed Description

A class describing an environment for a kinematic robot using ODE.

Definition at line 45 of file environmentODE.h.


Constructor & Destructor Documentation

collision_space::EnvironmentModelODE::EnvironmentModelODE ( void   ) 

Definition at line 55 of file environmentODE.cpp.

collision_space::EnvironmentModelODE::~EnvironmentModelODE ( void   )  [virtual]

Definition at line 71 of file environmentODE.cpp.


Member Function Documentation

void collision_space::EnvironmentModelODE::addObject ( const std::string &  ns,
shapes::Shape *  shape,
const btTransform &  pose 
) [virtual]

Add a collision object to the map. The user releases ownership of the passed object. Memory allocated for the shape is freed by the collision environment.

Implements collision_space::EnvironmentModel.

Definition at line 1145 of file environmentODE.cpp.

void collision_space::EnvironmentModelODE::addObject ( const std::string &  ns,
shapes::StaticShape *  shape 
) [virtual]

Add a static collision object to the map. The user releases ownership of the passed object. Memory allocated for the shape is freed by the collision environment.

Implements collision_space::EnvironmentModel.

Definition at line 1166 of file environmentODE.cpp.

void collision_space::EnvironmentModelODE::addObjects ( const std::string &  ns,
const std::vector< shapes::Shape * > &  shapes,
const std::vector< btTransform > &  poses 
) [virtual]

Add a set of collision objects to the map. The user releases ownership of the passed objects. Memory allocated for the shapes is freed by the collision environment.

Implements collision_space::EnvironmentModel.

Definition at line 1115 of file environmentODE.cpp.

void collision_space::EnvironmentModelODE::addSelfCollisionGroup ( const std::vector< std::string > &  group1,
const std::vector< std::string > &  group2 
) [virtual]

Add a group of links to be checked for self collision.

Reimplemented from collision_space::EnvironmentModel.

Definition at line 1363 of file environmentODE.cpp.

void collision_space::EnvironmentModelODE::checkThreadInit ( void   )  const [protected]

Check if thread-specific routines have been called.

Definition at line 84 of file environmentODE.cpp.

void collision_space::EnvironmentModelODE::clearObjects ( const std::string &  ns  )  [virtual]

Remove objects from a specific namespace in the collision model.

Implements collision_space::EnvironmentModel.

Definition at line 1193 of file environmentODE.cpp.

void collision_space::EnvironmentModelODE::clearObjects ( void   )  [virtual]

Remove all objects from collision model.

Implements collision_space::EnvironmentModel.

Definition at line 1185 of file environmentODE.cpp.

collision_space::EnvironmentModel * collision_space::EnvironmentModelODE::clone ( void   )  const [virtual]

Clone the environment.

Implements collision_space::EnvironmentModel.

Definition at line 1611 of file environmentODE.cpp.

dGeomID collision_space::EnvironmentModelODE::copyGeom ( dSpaceID  space,
ODEStorage storage,
dGeomID  geom,
ODEStorage sourceStorage 
) const [protected]

Definition at line 1538 of file environmentODE.cpp.

dGeomID collision_space::EnvironmentModelODE::createODEGeom ( dSpaceID  space,
ODEStorage storage,
const shapes::StaticShape *  shape 
) [protected]

Definition at line 204 of file environmentODE.cpp.

dGeomID collision_space::EnvironmentModelODE::createODEGeom ( dSpaceID  space,
ODEStorage storage,
const shapes::Shape *  shape,
double  scale,
double  padding 
) [protected]

Definition at line 221 of file environmentODE.cpp.

void collision_space::EnvironmentModelODE::createODERobotModel (  )  [protected]

Definition at line 158 of file environmentODE.cpp.

void collision_space::EnvironmentModelODE::freeMemory ( void   )  [protected]

Definition at line 97 of file environmentODE.cpp.

const std::vector< const planning_models::KinematicModel::AttachedBodyModel * > collision_space::EnvironmentModelODE::getAttachedBodies ( const std::string  link_name  )  const [virtual]

Gets a vector of all the bodies currently attached to a link.

Implements collision_space::EnvironmentModel.

Definition at line 137 of file environmentODE.cpp.

const std::vector< const planning_models::KinematicModel::AttachedBodyModel * > collision_space::EnvironmentModelODE::getAttachedBodies ( void   )  const [virtual]

Gets a vector of all the bodies currently attached to the robot.

Implements collision_space::EnvironmentModel.

Definition at line 118 of file environmentODE.cpp.

bool collision_space::EnvironmentModelODE::getCollisionContacts ( const std::vector< AllowedContact > &  allowedContacts,
std::vector< Contact > &  contacts,
unsigned int  max_count = 1 
) [virtual]

Get the list of contacts (collisions).

Implements collision_space::EnvironmentModel.

Definition at line 846 of file environmentODE.cpp.

void collision_space::EnvironmentModelODE::getDefaultAllowedCollisionMatrix ( std::vector< std::vector< bool > > &  matrix,
std::map< std::string, unsigned int > &  ind 
) const [virtual]

Implements collision_space::EnvironmentModel.

Definition at line 1248 of file environmentODE.cpp.

bool collision_space::EnvironmentModelODE::isCollision ( void   )  [virtual]

Check if a model is in collision.

Implements collision_space::EnvironmentModel.

Definition at line 866 of file environmentODE.cpp.

bool collision_space::EnvironmentModelODE::isSelfCollision ( void   )  [virtual]

Check if a model is in self collision.

Implements collision_space::EnvironmentModel.

Definition at line 875 of file environmentODE.cpp.

void collision_space::EnvironmentModelODE::removeCollidingObjects ( const dGeomID  geom  )  [protected]

Definition at line 1398 of file environmentODE.cpp.

void collision_space::EnvironmentModelODE::removeCollidingObjects ( const shapes::Shape *  shape,
const btTransform &  pose 
) [virtual]

Remove objects in the collision space that are collising with the object supplied as argument.

Implements collision_space::EnvironmentModel.

Definition at line 1387 of file environmentODE.cpp.

void collision_space::EnvironmentModelODE::removeCollidingObjects ( const shapes::StaticShape *  shape  )  [virtual]

Remove objects in the collision space that are collising with the object supplied as argument.

Implements collision_space::EnvironmentModel.

Definition at line 1377 of file environmentODE.cpp.

void collision_space::EnvironmentModelODE::removeSelfCollisionGroup ( const std::vector< std::string > &  group1,
const std::vector< std::string > &  group2 
) [virtual]

Remove a group of links to be checked for self collision.

Reimplemented from collision_space::EnvironmentModel.

Definition at line 1370 of file environmentODE.cpp.

void collision_space::EnvironmentModelODE::revertAllowedCollisionMatrix (  )  [virtual]

reverts to using default settings for allowed collisions

Reimplemented from collision_space::EnvironmentModel.

Definition at line 1358 of file environmentODE.cpp.

void collision_space::EnvironmentModelODE::revertRobotLinkPadding (  )  [virtual]

Reverts link padding to that set at robot initialization

Reimplemented from collision_space::EnvironmentModel.

Definition at line 425 of file environmentODE.cpp.

void collision_space::EnvironmentModelODE::setAllowedCollisionMatrix ( const std::vector< std::vector< bool > > &  matrix,
const std::map< std::string, unsigned int > &  ind 
) [virtual]

set the matrix for collision touch to use in lieu of the default settings

Reimplemented from collision_space::EnvironmentModel.

Definition at line 1311 of file environmentODE.cpp.

int collision_space::EnvironmentModelODE::setCollisionCheck ( const std::string &  link,
bool  state 
) [virtual]

Enable/Disable collision checking for specific links. Return the previous value of the state (1 or 0) if succesful; -1 otherwise.

Implements collision_space::EnvironmentModel.

Definition at line 1474 of file environmentODE.cpp.

void collision_space::EnvironmentModelODE::setCollisionCheckAll ( bool  state  )  [virtual]

Set collision checking for all links to state.

Implements collision_space::EnvironmentModel.

Definition at line 1530 of file environmentODE.cpp.

void collision_space::EnvironmentModelODE::setCollisionCheckLinks ( const std::vector< std::string > &  links,
bool  state 
) [virtual]

Enable/Disable collision checking for a set of links.

Implements collision_space::EnvironmentModel.

Definition at line 1490 of file environmentODE.cpp.

void collision_space::EnvironmentModelODE::setCollisionCheckOnlyLinks ( const std::vector< std::string > &  links,
bool  state 
) [virtual]

Set collision checking for the set of links to state, set collision checking for all other links to !state.

Implements collision_space::EnvironmentModel.

Definition at line 1508 of file environmentODE.cpp.

void collision_space::EnvironmentModelODE::setRobotLinkPadding ( const std::map< std::string, double > &  link_padding_map  )  [virtual]

Sets a temporary robot padding on the indicated links

Reimplemented from collision_space::EnvironmentModel.

Definition at line 384 of file environmentODE.cpp.

void collision_space::EnvironmentModelODE::setRobotModel ( const boost::shared_ptr< const planning_models::KinematicModel > &  model,
const std::vector< std::string > &  links,
const std::map< std::string, double > &  link_padding_map,
double  default_padding = 0.0,
double  scale = 1.0 
) [virtual]

Add a robot model. Ignore robot links if their name is not specified in the string vector. The scale argument can be used to increase or decrease the size of the robot's bodies (multiplicative factor). The padding can be used to increase or decrease the robot's bodies with by an additive term.

Reimplemented from collision_space::EnvironmentModel.

Definition at line 107 of file environmentODE.cpp.

void collision_space::EnvironmentModelODE::testBodyCollision ( CollisionNamespace cn,
CollisionData data 
) [protected]

Internal function for collision detection.

Definition at line 894 of file environmentODE.cpp.

void collision_space::EnvironmentModelODE::testCollision ( CollisionData data  )  [protected]

Internal function for collision detection.

Definition at line 1098 of file environmentODE.cpp.

void collision_space::EnvironmentModelODE::testSelfCollision ( CollisionData data  )  [protected]

Internal function for collision detection.

Definition at line 884 of file environmentODE.cpp.

void collision_space::EnvironmentModelODE::updateAllowedTouch ( void   ) 

Definition at line 1203 of file environmentODE.cpp.

void collision_space::EnvironmentModelODE::updateAllowedTouch ( const std::map< std::string, double > &  link_padding_map  ) 
void collision_space::EnvironmentModelODE::updateAttachedBodies ( const std::map< std::string, double > &  link_padding_map  )  [virtual]

Update the set of bodies that are attached to the robot (re-creates them) using the indicated padding or default if non-specified.

Definition at line 330 of file environmentODE.cpp.

void collision_space::EnvironmentModelODE::updateAttachedBodies ( void   )  [virtual]

Update the set of bodies that are attached to the robot (re-creates them).

Implements collision_space::EnvironmentModel.

Definition at line 325 of file environmentODE.cpp.

void collision_space::EnvironmentModelODE::updateGeom ( dGeomID  geom,
const btTransform &  pose 
) const [protected]

Definition at line 315 of file environmentODE.cpp.

void collision_space::EnvironmentModelODE::updateRobotModel ( const planning_models::KinematicState *  state  )  [virtual]

Update the positions of the geometry used in collision detection.

Implements collision_space::EnvironmentModel.

Definition at line 364 of file environmentODE.cpp.


Friends And Related Function Documentation

void nearCallbackFn ( void *  data,
dGeomID  o1,
dGeomID  o2 
) [friend]

Definition at line 649 of file environmentODE.cpp.


Member Data Documentation

Definition at line 381 of file environmentODE.h.

Definition at line 380 of file environmentODE.h.

Definition at line 382 of file environmentODE.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Friends


collision_space
Author(s): Ioan Sucan/isucan@willowgarage.com
autogenerated on Fri Jan 11 10:01:26 2013