Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

PlannerObstacle< N > Class Template Reference

Base class for all obstacles. More...

#include <PlannerObstacles.h>

Inheritance diagram for PlannerObstacle< N >:

Detailed Description

template<size_t N>
class PlannerObstacle< N >

Base class for all obstacles.

Subclasses should remember to override operator= to avoid using the plist::Dictionary version (plist::Dictionary::operator= will only copy dictionary entries, skips other state

Definition at line 51 of file PlannerObstacles.h.

List of all members.

Public Types

enum  ObstacleGeometry {
  RECTANGULAR_OBS = 2, CIRCULAR_OBS = 3, ELLIPTICAL_OBS = 5, CONVEX_POLY_OBS = 7,
  HIERARCHICAL_OBS = 11, BOX_OBS = 13, CYLINDRICAL_OBS = 17, SPHERICAL_OBS = 19,
  ELLIPSOID_OBS = 23
}
 

each collision shape is assigned a prime number, these provide fast dispatch in collides()

More...
typedef FamilyFactory
< PlannerObstacle, std::string > 
registry_t

Public Member Functions

 PlannerObstacle (ObstacleGeometry geom, const std::string &t)
 Default constructor.
virtual ~PlannerObstacle ()
 Destructor.
virtual void updatePosition (const fmat::SubVector< N, const fmat::fmatReal > &newPos)=0
 Increases the size of the obstacle in all directions by at least amount.
virtual void rotate (const fmat::SubVector< N, const fmat::fmatReal > &origin, const fmat::SubMatrix< N, N, const fmat::fmatReal > &rot)=0
 rotate the obstacle about a specified origin and a 2d rotation matrix
void rotate (const fmat::SubMatrix< N, N, const fmat::fmatReal > &rot)
 rotate the obstacle about its center by a 2d rotation matrix
virtual fmat::Column< N > getCenter () const =0
 get center point of obstacle
virtual BoundingBox< N > getBoundingBox () const =0
 get boundaries of the current obstacle
bool collides (const PlannerObstacle< N > &other) const
 checks for collision with other PlannerObstacles
virtual bool collides (const fmat::SubVector< N, const fmat::fmatReal > &point) const =0
 All collision tests that need to be handled by subclasses for specific points.
virtual fmat::Column< N > getSupport (const fmat::SubVector< N, const fmat::fmatReal > &direction) const =0
 Support function for GJK collision detection algorithm.
virtual fmat::Column< N > gradient (const fmat::SubVector< N, const fmat::fmatReal > &pt) const =0
 Calculate the vector to closest point on the obstacle boundary from pt.
virtual std::string toString () const
 return current value as a string
ObstacleGeometry getObstacleGeometry () const
int getShapeId () const
void setShapeId (int id)
bool isBodyObstacle ()
void setBodyObstacle ()
const std::string & getTypeName () const
 PLIST_CLONE_FWD (PlannerObstacle)

Static Public Member Functions

template<typename T >
static int sgn (T x)
 sgn(x): returns sign of input
static void convertShapeToPlannerObstacle (const DualCoding::ShapeRoot &shape, float inflation, std::vector< PlannerObstacle * > &obstacles)
static registry_tgetRegistry ()

Public Attributes

plist::Primitive< std::string > name
 Sub-components of an obstacle.

Protected Member Functions

 PlannerObstacle (const PlannerObstacle &o)
 Copy constructor, be careful not to cross-copy different types.
PlannerObstacleoperator= (const PlannerObstacle &o)
 Don't use this assignment...
void init ()

Protected Attributes

plist::Primitive< std::string > type
ObstacleGeometry geometry
int shapeId
 For obstacles defined by DualCoding shapes.
bool bodyObstacle
 For 3D path planning, to avoid arm-body collisions.

Friends

std::ostream & operator<< (std::ostream &os, const PlannerObstacle &po)

Member Typedef Documentation

template<size_t N>
typedef FamilyFactory<PlannerObstacle,std::string> PlannerObstacle< N >::registry_t

Definition at line 132 of file PlannerObstacles.h.


Member Enumeration Documentation

template<size_t N>
enum PlannerObstacle::ObstacleGeometry

each collision shape is assigned a prime number, these provide fast dispatch in collides()

Enumerator:
RECTANGULAR_OBS 
CIRCULAR_OBS 
ELLIPTICAL_OBS 
CONVEX_POLY_OBS 
HIERARCHICAL_OBS 
BOX_OBS 
CYLINDRICAL_OBS 
SPHERICAL_OBS 
ELLIPSOID_OBS 

Definition at line 54 of file PlannerObstacles.h.


Constructor & Destructor Documentation

template<size_t N>
PlannerObstacle< N >::PlannerObstacle ( ObstacleGeometry  geom,
const std::string &  t 
) [explicit]

Default constructor.

Definition at line 67 of file PlannerObstacles.h.

template<size_t N>
virtual PlannerObstacle< N >::~PlannerObstacle (  )  [virtual]

Destructor.

Definition at line 71 of file PlannerObstacles.h.

template<size_t N>
PlannerObstacle< N >::PlannerObstacle ( const PlannerObstacle< N > &  o  )  [protected]

Copy constructor, be careful not to cross-copy different types.

Definition at line 139 of file PlannerObstacles.h.


Member Function Documentation

template<size_t N>
virtual bool PlannerObstacle< N >::collides ( const fmat::SubVector< N, const fmat::fmatReal > &  point  )  const [pure virtual]

All collision tests that need to be handled by subclasses for specific points.

template<size_t N>
bool PlannerObstacle< N >::collides ( const PlannerObstacle< N > &  other  )  const
template<size_t N>
static void PlannerObstacle< N >::convertShapeToPlannerObstacle ( const DualCoding::ShapeRoot &  shape,
float  inflation,
std::vector< PlannerObstacle< N > * > &  obstacles 
) [static]
template<size_t N>
virtual BoundingBox<N> PlannerObstacle< N >::getBoundingBox (  )  const [pure virtual]
template<size_t N>
ObstacleGeometry PlannerObstacle< N >::getObstacleGeometry (  )  const

Definition at line 122 of file PlannerObstacles.h.

template<size_t N>
static registry_t& PlannerObstacle< N >::getRegistry (  )  [static]

Definition at line 133 of file PlannerObstacles.h.

Referenced by plist::loadXML().

template<size_t N>
int PlannerObstacle< N >::getShapeId (  )  const

Definition at line 124 of file PlannerObstacles.h.

template<size_t N>
virtual fmat::Column<N> PlannerObstacle< N >::getSupport ( const fmat::SubVector< N, const fmat::fmatReal > &  direction  )  const [pure virtual]

Support function for GJK collision detection algorithm.

Gets the point on the convex polygon farthest along the specified direction.

Referenced by GJK::getSupport().

template<size_t N>
const std::string& PlannerObstacle< N >::getTypeName (  )  const

Definition at line 130 of file PlannerObstacles.h.

template<size_t N>
virtual fmat::Column<N> PlannerObstacle< N >::gradient ( const fmat::SubVector< N, const fmat::fmatReal > &  pt  )  const [pure virtual]

Calculate the vector to closest point on the obstacle boundary from pt.

Referenced by GaitedFootsteps::addCandidate().

template<size_t N>
void PlannerObstacle< N >::init (  )  [protected]
template<size_t N>
bool PlannerObstacle< N >::isBodyObstacle (  ) 

Definition at line 127 of file PlannerObstacles.h.

template<size_t N>
PlannerObstacle& PlannerObstacle< N >::operator= ( const PlannerObstacle< N > &  o  )  [protected]

Don't use this assignment...

Definition at line 143 of file PlannerObstacles.h.

template<size_t N>
PlannerObstacle< N >::PLIST_CLONE_FWD ( PlannerObstacle< N >   ) 
template<size_t N>
void PlannerObstacle< N >::rotate ( const fmat::SubMatrix< N, N, const fmat::fmatReal > &  rot  ) 

rotate the obstacle about its center by a 2d rotation matrix

Definition at line 98 of file PlannerObstacles.h.

Referenced by PlannerObstacle< N >::rotate().

template<size_t N>
virtual void PlannerObstacle< N >::rotate ( const fmat::SubVector< N, const fmat::fmatReal > &  origin,
const fmat::SubMatrix< N, N, const fmat::fmatReal > &  rot 
) [pure virtual]

rotate the obstacle about a specified origin and a 2d rotation matrix

Referenced by HierarchicalObstacle::collides(), and HierarchicalObstacle::expandBoundingBox().

template<size_t N>
void PlannerObstacle< N >::setShapeId ( int  id  ) 

Definition at line 125 of file PlannerObstacles.h.

template<size_t N>
template<typename T >
static int PlannerObstacle< N >::sgn ( x  )  [static]
template<size_t N>
std::string PlannerObstacle< N >::toString (  )  const [virtual]
template<size_t N>
virtual void PlannerObstacle< N >::updatePosition ( const fmat::SubVector< N, const fmat::fmatReal > &  newPos  )  [pure virtual]

Increases the size of the obstacle in all directions by at least amount.

Decreases the size of the obstacle in all directions by at least amount moves the obstacle

Referenced by HierarchicalObstacle::collides(), and HierarchicalObstacle::expandBoundingBox().


Friends And Related Function Documentation

template<size_t N>
std::ostream& operator<< ( std::ostream &  os,
const PlannerObstacle< N > &  po 
) [friend]

Definition at line 120 of file PlannerObstacles.h.


Member Data Documentation

template<size_t N>
bool PlannerObstacle< N >::bodyObstacle [protected]

For 3D path planning, to avoid arm-body collisions.

Definition at line 160 of file PlannerObstacles.h.

Referenced by PlannerObstacle< N >::isBodyObstacle(), and PlannerObstacle< N >::setBodyObstacle().

template<size_t N>
ObstacleGeometry PlannerObstacle< N >::geometry [protected]
template<size_t N>
int PlannerObstacle< N >::shapeId [protected]

For obstacles defined by DualCoding shapes.

Definition at line 159 of file PlannerObstacles.h.

Referenced by PlannerObstacle< N >::getShapeId(), and PlannerObstacle< N >::setShapeId().


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

Tekkotsu v5.1CVS
Generated Mon May 9 04:59:14 2016 by Doxygen 1.6.3