Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

RectangularObstacle Class Reference

Rectangular defined obstacle designated by 4 corners and its rotation matrix from axis alignment. More...

#include <PlannerObstacles.h>

Inheritance diagram for RectangularObstacle:

Detailed Description

Rectangular defined obstacle designated by 4 corners and its rotation matrix from axis alignment.

Definition at line 171 of file PlannerObstacles.h.

List of all members.

Public Types

enum  CornerOrder {
  TOP_RIGHT, TOP_LEFT, BOTTOM_LEFT, BOTTOM_RIGHT,
  NUM_CORNERS
}

Public Member Functions

 RectangularObstacle ()
 Default constructor.
 RectangularObstacle (const fmat::SubVector< 2, const fmat::fmatReal > &centerPoint, const fmat::SubVector< 2, const fmat::fmatReal > &extents, fmat::fmatReal orient)
 Pass the center, the extents from center (half-width and half-height), and an angular (radian) rotation.
 RectangularObstacle (const BoundingBox2D &bb, const fmat::SubMatrix< 2, 2, const fmat::fmatReal > &rot, const fmat::SubVector< 2, 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.
RectangularObstacleoperator= (const RectangularObstacle &o)
 Assignment, should not use plist::Dictionary version.
virtual bool collides (const fmat::SubVector< 2, const fmat::fmatReal > &point) const
 Test if the rectangle includes a specific point.
bool collides (const RectangularObstacle &other) const
bool collides (const CircularObstacle &other) const
bool collides (const EllipticalObstacle &other) const
virtual fmat::Column< 2 > getSupport (const fmat::SubVector< 2, const fmat::fmatReal > &direction) const
virtual void reset (const fmat::Column< 2 > &centerPoint, const fmat::Column< 2 > &extents, fmat::fmatReal orient)
 do a complete reset of parameters
virtual void reset (fmat::Column< 2 > centerPoint, const fmat::SubVector< 2, const fmat::fmatReal > &extents, const fmat::SubMatrix< 2, 2, const fmat::fmatReal > &rot)
 do a complete reset of parameters (so if you already have the rotation matrix, avoids regeneration from the angular value)
virtual void updatePosition (const fmat::SubVector< 2, const fmat::fmatReal > &newPos)
virtual void rotate (const fmat::SubVector< 2, const fmat::fmatReal > &origin, const fmat::SubMatrix< 2, 2, const fmat::fmatReal > &rot)
virtual BoundingBox2D getBoundingBox () const
 Minimum and maximum X and Y extents (axis aligned bounding box).
virtual fmat::Column< 2 > gradient (const fmat::SubVector< 2, const fmat::fmatReal > &pt) const
virtual std::string toString () const
 return current value as a string
virtual fmat::Column< 2 > getCenter () const
 Gets the center (X,Y).
float getWidth () const
 returns the width along 'local' axes
float getHeight () const
 returns the height along 'local' axes
fmat::Column< 2 > getExtents () const
 returns the half-width and half-height, suitable for easy use with reset()
float getOrientation () const
 returns the orienation of the rectangle in radians
fmat::Column< 2 > 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 RectangularObstacleclone () const __attribute__((warn_unused_result))
 clone definition for RectangularObstacle

Protected Attributes

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

Static Protected Attributes

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

Friends

class ConvexPolyObstacle

Member Enumeration Documentation

Enumerator:
TOP_RIGHT 
TOP_LEFT 
BOTTOM_LEFT 
BOTTOM_RIGHT 
NUM_CORNERS 

Definition at line 280 of file PlannerObstacles.h.


Constructor & Destructor Documentation

RectangularObstacle::RectangularObstacle (  ) 

Default constructor.

Definition at line 201 of file PlannerObstacles.h.

RectangularObstacle::RectangularObstacle ( const fmat::SubVector< 2, const fmat::fmatReal > &  centerPoint,
const fmat::SubVector< 2, const fmat::fmatReal > &  extents,
fmat::fmatReal  orient 
)

Pass the center, the extents from center (half-width and half-height), and an angular (radian) rotation.

Definition at line 206 of file PlannerObstacles.h.

RectangularObstacle::RectangularObstacle ( const BoundingBox2D bb,
const fmat::SubMatrix< 2, 2, const fmat::fmatReal > &  rot,
const fmat::SubVector< 2, 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 215 of file PlannerObstacles.h.


Member Function Documentation

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

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

Definition at line 318 of file PlannerObstacles.cc.

Referenced by contract().

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

clone definition for RectangularObstacle

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

Definition at line 17 of file PlannerObstacles.cc.

bool RectangularObstacle::collides ( const EllipticalObstacle other  )  const
bool RectangularObstacle::collides ( const CircularObstacle other  )  const

Definition at line 205 of file PlannerObstacles.cc.

bool RectangularObstacle::collides ( const RectangularObstacle other  )  const

Definition at line 173 of file PlannerObstacles.cc.

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

Test if the rectangle includes a specific point.

Definition at line 295 of file PlannerObstacles.cc.

Referenced by RRTNode2DR< N >::CollisionChecker::JointObstacle::collides().

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

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

Definition at line 323 of file PlannerObstacles.cc.

virtual BoundingBox2D RectangularObstacle::getBoundingBox (  )  const [virtual]

Minimum and maximum X and Y extents (axis aligned bounding box).

Implements PlannerObstacle< N >.

Definition at line 262 of file PlannerObstacles.h.

virtual fmat::Column<2> RectangularObstacle::getCenter (  )  const [virtual]

Gets the center (X,Y).

Implements PlannerObstacle< N >.

Definition at line 269 of file PlannerObstacles.h.

Referenced by LinkComponent::getObstacle().

fmat::Column<2> RectangularObstacle::getCorner ( size_t  i  )  const

returns the specified corner point

Definition at line 289 of file PlannerObstacles.h.

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

fmat::Column<2> RectangularObstacle::getExtents (  )  const

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

Definition at line 276 of file PlannerObstacles.h.

Referenced by ShapeSpacePlanner2DR< N >::getBoxes(), and rotate().

float RectangularObstacle::getHeight (  )  const

returns the height along 'local' axes

Definition at line 274 of file PlannerObstacles.h.

Referenced by LinkComponent::getObstacle(), and saveXML().

float RectangularObstacle::getOrientation (  )  const

returns the orienation of the rectangle in radians

Definition at line 358 of file PlannerObstacles.cc.

Referenced by LinkComponent::getObstacle(), and saveXML().

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

Definition at line 301 of file PlannerObstacles.cc.

float RectangularObstacle::getWidth (  )  const

returns the width along 'local' axes

Definition at line 272 of file PlannerObstacles.h.

Referenced by LinkComponent::getObstacle(), and saveXML().

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

Definition at line 236 of file PlannerObstacles.cc.

void RectangularObstacle::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 327 of file PlannerObstacles.cc.

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

Assignment, should not use plist::Dictionary version.

Definition at line 223 of file PlannerObstacles.h.

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

do a complete reset of parameters (so if you already have the rotation matrix, avoids regeneration from the angular value)

Definition at line 139 of file PlannerObstacles.cc.

virtual void RectangularObstacle::reset ( const fmat::Column< 2 > &  centerPoint,
const fmat::Column< 2 > &  extents,
fmat::fmatReal  orient 
) [virtual]

do a complete reset of parameters

Definition at line 246 of file PlannerObstacles.h.

Referenced by bloat(), LinkComponent::computeBB2D(), loadXML(), RectangularObstacle(), and rotate().

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

Definition at line 230 of file PlannerObstacles.cc.

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

subclasses are expected to provide a working implementation

Reimplemented from plist::DictionaryBase.

Definition at line 341 of file PlannerObstacles.cc.

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

return current value as a string

Reimplemented from PlannerObstacle< N >.

Definition at line 289 of file PlannerObstacles.cc.

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

Definition at line 160 of file PlannerObstacles.cc.


Friends And Related Function Documentation

friend class ConvexPolyObstacle [friend]

Definition at line 173 of file PlannerObstacles.h.


Member Data Documentation

const std::string RectangularObstacle::autoRegisterName = PlannerObstacle2D::getRegistry().registerType<RectangularObstacle>("Rectangle") [static, protected]

stores the class name used for polymorphic load/save

Definition at line 176 of file PlannerObstacles.h.

axis aligned bounding box

Definition at line 187 of file PlannerObstacles.h.

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

Center of rectangle.

Definition at line 179 of file PlannerObstacles.h.

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

maximum extents (along rectangle axes)

Definition at line 184 of file PlannerObstacles.h.

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

minimum extents (along rectangle axes)

Definition at line 182 of file PlannerObstacles.h.

Referenced by ConvexPolyObstacle::collides(), collides(), getExtents(), getHeight(), getWidth(), gradient(), operator=(), reset(), and updatePosition().

corner points for fast collision checking

points are stored in clockwise order from upper right:

  • top right
  • bottom right
  • bottom left
  • top left

Definition at line 197 of file PlannerObstacles.h.

Referenced by ConvexPolyObstacle::collides(), collides(), getCorner(), getSupport(), gradient(), operator=(), reset(), toString(), and updatePosition().

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

Definition at line 190 of file PlannerObstacles.h.

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


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

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