Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

BoxObstacle Class Reference

#include <PlannerObstacles.h>

Inheritance diagram for BoxObstacle:

Detailed Description

Definition at line 688 of file PlannerObstacles.h.

List of all members.

Public Types

enum  CornerOrder {
  TOP_UPPER_RIGHT, TOP_LOWER_RIGHT, TOP_LOWER_LEFT, TOP_UPPER_LEFT,
  BOTTOM_UPPER_RIGHT, BOTTOM_LOWER_RIGHT, BOTTOM_LOWER_LEFT, BOTTOM_UPPER_LEFT,
  NUM_CORNERS
}

Public Member Functions

 BoxObstacle ()
 Default constructor.
 BoxObstacle (const fmat::SubVector< 3, const fmat::fmatReal > &centerPoint, const fmat::SubVector< 3, const fmat::fmatReal > &extents, const fmat::SubMatrix< 3, 3, const fmat::fmatReal > &orient)
 Pass the center, the extents from center (half-length, half-width and half-height), and a rotation.
 BoxObstacle (const BoundingBox3D &bb, const fmat::SubMatrix< 3, 3, const fmat::fmatReal > &rot, const fmat::SubVector< 3, const fmat::fmatReal > &off)
 Pass a bounding box and a transform... the transformation is applied relative to origin, e.g. the bb center will rotate about the origin.
BoxObstacleoperator= (const BoxObstacle &o)
 Assignment, should not use plist::Dictionary version.
virtual void reset (fmat::Column< 3 > centerPoint, const fmat::SubVector< 3, const fmat::fmatReal > &extents, const fmat::SubMatrix< 3, 3, const fmat::fmatReal > &rot)
 do a complete reset of parameters
virtual void updatePosition (const fmat::SubVector< 3, const fmat::fmatReal > &newPos)
virtual void rotate (const fmat::SubVector< 3, const fmat::fmatReal > &origin, const fmat::SubMatrix< 3, 3, const fmat::fmatReal > &rot)
virtual std::string toString () const
 return current value as a string
virtual fmat::Column< 3 > getCenter () const
 get center point of obstacle
virtual BoundingBox3D getBoundingBox () const
 get boundaries of the current obstacle
virtual fmat::Matrix< 3, 3 > getOrientation () const
virtual bool collides (const fmat::SubVector< 3, const fmat::fmatReal > &point) const
bool collides (const BoxObstacle &other) const
virtual fmat::Column< 3 > getSupport (const fmat::SubVector< 3, const fmat::fmatReal > &direction) const
virtual fmat::Column< 3 > gradient (const fmat::SubVector< 3, const fmat::fmatReal > &pt) const
float getLength () const
 returns the length along 'local' axes
float getWidth () const
 returns the width along 'local' axes
float getHeight () const
 returns the height along 'local' axes
fmat::Column< 3 > getExtents () const
 returns the half-width and half-height, suitable for easy use with reset()
fmat::Column< 3 > getCorner (size_t i) const
 returns the specified corner point
virtual void bloat (float amount)
 Increases the size of the obstacle in all directions by at least amount.
virtual void contract (float amount)
 Decreases the size of the obstacle in all directions by at least amount.
virtual void loadXML (xmlNode *node)
 This specialization looks for the SensorInfo::sensorType, then has the factory construct the correct subtype before loading the node into and returning that.
virtual void saveXML (xmlNode *node) const
 subclasses are expected to provide a working implementation
virtual BoxObstacleclone () const __attribute__((warn_unused_result))
 clone definition for BoxObstacle

Protected Attributes

fmat::Column< 3 > center
 Center of box.
fmat::Column< 3 > minEx
 minimum extents (along box axes)
fmat::Column< 3 > maxEx
 maximum extents (along box axes)
BoundingBox3D bBox
 axis aligned bounding box
fmat::Matrix< 3, 3 > unrot
 The rotation matrix to rotate from 'normal' coordinates to the obstacle orientation.
fmat::Matrix< 8, 3 > points
 corner points for fast collision checking

Static Protected Attributes

static const std::string autoRegisterName = PlannerObstacle3D::getRegistry().registerType<BoxObstacle>("Box")
 stores the class name used for polymorphic load/save

Member Enumeration Documentation

Enumerator:
TOP_UPPER_RIGHT 
TOP_LOWER_RIGHT 
TOP_LOWER_LEFT 
TOP_UPPER_LEFT 
BOTTOM_UPPER_RIGHT 
BOTTOM_LOWER_RIGHT 
BOTTOM_LOWER_LEFT 
BOTTOM_UPPER_LEFT 
NUM_CORNERS 

Definition at line 790 of file PlannerObstacles.h.


Constructor & Destructor Documentation

BoxObstacle::BoxObstacle (  ) 

Default constructor.

Definition at line 722 of file PlannerObstacles.h.

BoxObstacle::BoxObstacle ( const fmat::SubVector< 3, const fmat::fmatReal > &  centerPoint,
const fmat::SubVector< 3, const fmat::fmatReal > &  extents,
const fmat::SubMatrix< 3, 3, const fmat::fmatReal > &  orient 
)

Pass the center, the extents from center (half-length, half-width and half-height), and a rotation.

Definition at line 726 of file PlannerObstacles.h.

BoxObstacle::BoxObstacle ( const BoundingBox3D bb,
const fmat::SubMatrix< 3, 3, const fmat::fmatReal > &  rot,
const fmat::SubVector< 3, const fmat::fmatReal > &  off 
)

Pass a bounding box and a transform... the transformation is applied relative to origin, e.g. the bb center will rotate about the origin.

Definition at line 735 of file PlannerObstacles.h.


Member Function Documentation

void BoxObstacle::bloat ( float  amount  )  [virtual]

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

Definition at line 1226 of file PlannerObstacles.cc.

Referenced by contract().

BoxObstacle * BoxObstacle::clone (  )  const [virtual]

clone definition for BoxObstacle

Reimplemented from plist::DictionaryOf< PO, Alloc >.

Definition at line 22 of file PlannerObstacles.cc.

bool BoxObstacle::collides ( const BoxObstacle other  )  const

Definition at line 1090 of file PlannerObstacles.cc.

bool BoxObstacle::collides ( const fmat::SubVector< 3, const fmat::fmatReal > &  point  )  const [virtual]

Definition at line 1083 of file PlannerObstacles.cc.

virtual void BoxObstacle::contract ( float  amount  )  [virtual]

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

Definition at line 809 of file PlannerObstacles.h.

virtual BoundingBox3D BoxObstacle::getBoundingBox (  )  const [virtual]

get boundaries of the current obstacle

Implements PlannerObstacle< N >.

Definition at line 769 of file PlannerObstacles.h.

virtual fmat::Column<3> BoxObstacle::getCenter (  )  const [virtual]

get center point of obstacle

Implements PlannerObstacle< N >.

Definition at line 768 of file PlannerObstacles.h.

Referenced by collides(), and ShapeSpacePlanner3DR< N >::plotPath().

fmat::Column<3> BoxObstacle::getCorner ( size_t  i  )  const

returns the specified corner point

Definition at line 803 of file PlannerObstacles.h.

Referenced by ShapeSpacePlanner3DR< N >::getBoxes().

fmat::Column<3> BoxObstacle::getExtents (  )  const

returns the half-width and half-height, suitable for easy use with reset()

Definition at line 788 of file PlannerObstacles.h.

Referenced by collides(), ShapeSpacePlanner3DR< N >::getBoxes(), gradient(), ShapeSpacePlanner3DR< N >::plotPath(), and rotate().

float BoxObstacle::getHeight (  )  const

returns the height along 'local' axes

Definition at line 786 of file PlannerObstacles.h.

Referenced by ShapeSpacePlanner3DR< N >::plotPath(), and saveXML().

float BoxObstacle::getLength (  )  const

returns the length along 'local' axes

Definition at line 782 of file PlannerObstacles.h.

Referenced by ShapeSpacePlanner3DR< N >::plotPath(), and saveXML().

virtual fmat::Matrix<3,3> BoxObstacle::getOrientation (  )  const [virtual]

Definition at line 770 of file PlannerObstacles.h.

Referenced by collides(), gradient(), and ShapeSpacePlanner3DR< N >::plotPath().

fmat::Column< 3 > BoxObstacle::getSupport ( const fmat::SubVector< 3, const fmat::fmatReal > &  direction  )  const [virtual]

Definition at line 1174 of file PlannerObstacles.cc.

float BoxObstacle::getWidth (  )  const

returns the width along 'local' axes

Definition at line 784 of file PlannerObstacles.h.

Referenced by ShapeSpacePlanner3DR< N >::plotPath(), and saveXML().

fmat::Column< 3 > BoxObstacle::gradient ( const fmat::SubVector< 3, const fmat::fmatReal > &  pt  )  const [virtual]

Definition at line 1208 of file PlannerObstacles.cc.

void BoxObstacle::loadXML ( xmlNode node  )  [virtual]

This specialization looks for the SensorInfo::sensorType, then has the factory construct the correct subtype before loading the node into and returning that.

From the name of node, will instantiate a new ObjectBase subclass to load it.

supports use of plist::ArrayOf<PlannerObstacle> for polymorphic load/save

The mapping from node names to actual instantiated types is:

If successful, returns a pointer to a newly allocated region, which the caller is responsible for freeing. If an error occurs, NULL is returned.

attempts to load a new T instance from the specified xmlNode

Reimplemented from plist::DictionaryBase.

Definition at line 1230 of file PlannerObstacles.cc.

BoxObstacle& BoxObstacle::operator= ( const BoxObstacle o  ) 

Assignment, should not use plist::Dictionary version.

Definition at line 745 of file PlannerObstacles.h.

void BoxObstacle::reset ( fmat::Column< 3 >  centerPoint,
const fmat::SubVector< 3, const fmat::fmatReal > &  extents,
const fmat::SubMatrix< 3, 3, const fmat::fmatReal > &  rot 
) [virtual]

do a complete reset of parameters

Definition at line 1031 of file PlannerObstacles.cc.

Referenced by bloat(), BoxObstacle(), LinkComponent::getBB3D(), LinkComponent::getOwnBB3D(), loadXML(), and rotate().

void BoxObstacle::rotate ( const fmat::SubVector< 3, const fmat::fmatReal > &  origin,
const fmat::SubMatrix< 3, 3, const fmat::fmatReal > &  rot 
) [virtual]

Definition at line 1071 of file PlannerObstacles.cc.

void BoxObstacle::saveXML ( xmlNode node  )  const [virtual]

subclasses are expected to provide a working implementation

Reimplemented from plist::DictionaryBase.

Definition at line 1246 of file PlannerObstacles.cc.

std::string BoxObstacle::toString (  )  const [virtual]

return current value as a string

Reimplemented from PlannerObstacle< N >.

Definition at line 1077 of file PlannerObstacles.cc.

void BoxObstacle::updatePosition ( const fmat::SubVector< 3, const fmat::fmatReal > &  newPos  )  [virtual]

Definition at line 1057 of file PlannerObstacles.cc.


Member Data Documentation

const std::string BoxObstacle::autoRegisterName = PlannerObstacle3D::getRegistry().registerType<BoxObstacle>("Box") [static, protected]

stores the class name used for polymorphic load/save

Definition at line 691 of file PlannerObstacles.h.

axis aligned bounding box

Definition at line 702 of file PlannerObstacles.h.

Referenced by getBoundingBox(), operator=(), reset(), and updatePosition().

Center of box.

Definition at line 694 of file PlannerObstacles.h.

Referenced by bloat(), collides(), getCenter(), gradient(), operator=(), reset(), rotate(), saveXML(), and updatePosition().

maximum extents (along box axes)

Definition at line 699 of file PlannerObstacles.h.

Referenced by bloat(), collides(), getExtents(), getHeight(), getLength(), getWidth(), operator=(), reset(), and updatePosition().

minimum extents (along box axes)

Definition at line 697 of file PlannerObstacles.h.

Referenced by collides(), getExtents(), getHeight(), getLength(), getWidth(), operator=(), reset(), and updatePosition().

corner points for fast collision checking

points are stored first top then bottom, both in clockwise order from upper right:

  • top upper right
  • top lower right
  • top lower left
  • top upper left
  • bottom upper right
  • bottom lower right
  • bottom lower left
  • bottom upper left

Definition at line 718 of file PlannerObstacles.h.

Referenced by getCorner(), getSupport(), operator=(), reset(), toString(), and updatePosition().

fmat::Matrix<3,3> BoxObstacle::unrot [protected]

The rotation matrix to rotate from 'normal' coordinates to the obstacle orientation.

Definition at line 705 of file PlannerObstacles.h.

Referenced by bloat(), collides(), getOrientation(), getSupport(), gradient(), operator=(), reset(), rotate(), saveXML(), toString(), and updatePosition().


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

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