Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

EllipticalObstacle Class Reference

Elliptically defined obstacle. More...

#include <PlannerObstacles.h>

Inheritance diagram for EllipticalObstacle:

Detailed Description

Elliptically defined obstacle.

Definition at line 383 of file PlannerObstacles.h.

List of all members.

Public Member Functions

 EllipticalObstacle ()
 Default constructor.
 EllipticalObstacle (const fmat::Column< 2 > &c, fmat::fmatReal _semimajor, fmat::fmatReal _semiminor, fmat::fmatReal orientation)
 Location, semimajor, semiminor, orientation.
 EllipticalObstacle (const fmat::Column< 2 > &c, fmat::fmatReal r)
 Circle with point and radius.
EllipticalObstacleoperator= (const EllipticalObstacle &o)
 Assignment, should not use plist::Dictionary version.
void reset (const fmat::Column< 2 > &f1, const fmat::Column< 2 > &f2, fmat::fmatReal s)
 Initialize from two foci and semimajor s.
void reset (const fmat::Column< 2 > &c, fmat::fmatReal smajor, fmat::fmatReal sminor, fmat::fmatReal ori)
 Initialize from center, extents, and orientation.
void reset (const fmat::Column< 2 > &c, fmat::fmatReal radius)
 Initialize from circle: center and radius.
virtual bool collides (const fmat::SubVector< 2, const fmat::fmatReal > &point) const
 Test if the circle includes a specific point.
virtual fmat::Column< 2 > getSupport (const fmat::SubVector< 2, const fmat::fmatReal > &direction) const
virtual fmat::Column< 2 > getCenter () const
 get center point of obstacle
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)
float getAngle () const
 Returns the angle of the major axis.
fmat::Matrix< 2, 2 > getOrientation () const
 If rotating into the ellipse's frame, construct rotation matrix directly.
fmat::Column< 2 > getPointOnEdge (fmat::fmatReal theta) const
 Returns the point on the edge of the ellipse at the specified angle.
fmat::Column< 2 > getPointOnEdge (const fmat::Column< 2 > &direction) const
 Returns the point on the edge of the ellipse which intersects vector v through the center.
virtual BoundingBox2D getBoundingBox () const
 get boundaries of the current obstacle
virtual fmat::Column< 2 > gradient (const fmat::SubVector< 2, const fmat::fmatReal > &pt) const
 Approximates the closest point on the ellipse to pt.
virtual std::string toString () const
 return current value as a string
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 EllipticalObstacleclone () const __attribute__((warn_unused_result))
 clone definition for EllipticalObstacle

Public Attributes

fmat::Column< 2 > focus1
 Focus of the ellipse.
fmat::Column< 2 > focus2
 Focus of the ellipse.
fmat::Column< 2 > center
 Center of the ellipse.
fmat::fmatReal semimajor
 Half-length of the major axis.
fmat::fmatReal semiminor
 Half-length of the minor axis.

Static Protected Attributes

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

Constructor & Destructor Documentation

EllipticalObstacle::EllipticalObstacle (  ) 

Default constructor.

Definition at line 405 of file PlannerObstacles.h.

EllipticalObstacle::EllipticalObstacle ( const fmat::Column< 2 > &  c,
fmat::fmatReal  _semimajor,
fmat::fmatReal  _semiminor,
fmat::fmatReal  orientation 
)

Location, semimajor, semiminor, orientation.

Swaps the major/minor and adds 90° to the orientation if major<minor

Definition at line 410 of file PlannerObstacles.h.

EllipticalObstacle::EllipticalObstacle ( const fmat::Column< 2 > &  c,
fmat::fmatReal  r 
)

Circle with point and radius.

Definition at line 416 of file PlannerObstacles.h.


Member Function Documentation

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

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

Definition at line 487 of file PlannerObstacles.h.

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

clone definition for EllipticalObstacle

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

Definition at line 19 of file PlannerObstacles.cc.

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

Test if the circle includes a specific point.

Definition at line 447 of file PlannerObstacles.h.

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

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

Definition at line 489 of file PlannerObstacles.h.

float EllipticalObstacle::getAngle (  )  const

Returns the angle of the major axis.

Definition at line 462 of file PlannerObstacles.h.

Referenced by bloat(), contract(), getBoundingBox(), gradient(), saveXML(), and toString().

BoundingBox2D EllipticalObstacle::getBoundingBox (  )  const [virtual]

get boundaries of the current obstacle

Implements PlannerObstacle< N >.

Definition at line 493 of file PlannerObstacles.cc.

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

get center point of obstacle

Implements PlannerObstacle< N >.

Definition at line 453 of file PlannerObstacles.h.

fmat::Matrix< 2, 2 > EllipticalObstacle::getOrientation (  )  const

If rotating into the ellipse's frame, construct rotation matrix directly.

Definition at line 474 of file PlannerObstacles.cc.

Referenced by getPointOnEdge(), getSupport(), and gradient().

fmat::Column< 2 > EllipticalObstacle::getPointOnEdge ( const fmat::Column< 2 > &  direction  )  const

Returns the point on the edge of the ellipse which intersects vector v through the center.

v does not need to be normalized

Definition at line 483 of file PlannerObstacles.cc.

fmat::Column<2> EllipticalObstacle::getPointOnEdge ( fmat::fmatReal  theta  )  const

Returns the point on the edge of the ellipse at the specified angle.

theta should be relative to the reference frame of the space that the ellipse resides in (and returns results in the external frame as well)

Definition at line 470 of file PlannerObstacles.h.

Referenced by gradient().

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

Definition at line 434 of file PlannerObstacles.cc.

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

Approximates the closest point on the ellipse to pt.

Basically scales the vector from the center to pt

Definition at line 509 of file PlannerObstacles.cc.

void EllipticalObstacle::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 593 of file PlannerObstacles.cc.

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

Assignment, should not use plist::Dictionary version.

Definition at line 420 of file PlannerObstacles.h.

void EllipticalObstacle::reset ( const fmat::Column< 2 > &  c,
fmat::fmatReal  radius 
)

Initialize from circle: center and radius.

Definition at line 439 of file PlannerObstacles.h.

void EllipticalObstacle::reset ( const fmat::Column< 2 > &  c,
fmat::fmatReal  smajor,
fmat::fmatReal  sminor,
fmat::fmatReal  ori 
)

Initialize from center, extents, and orientation.

Swaps the major/minor and adds 90° to the orientation if major<minor

Definition at line 419 of file PlannerObstacles.cc.

void EllipticalObstacle::reset ( const fmat::Column< 2 > &  f1,
const fmat::Column< 2 > &  f2,
fmat::fmatReal  s 
)

Initialize from two foci and semimajor s.

Will throw an exception if s is too short (must be at least half the distance between the foci)

Definition at line 410 of file PlannerObstacles.cc.

Referenced by bloat(), contract(), EllipticalObstacle(), and loadXML().

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

Definition at line 467 of file PlannerObstacles.cc.

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

subclasses are expected to provide a working implementation

Reimplemented from plist::DictionaryBase.

Definition at line 612 of file PlannerObstacles.cc.

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

return current value as a string

Reimplemented from PlannerObstacle< N >.

Definition at line 585 of file PlannerObstacles.cc.

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

Definition at line 460 of file PlannerObstacles.cc.


Member Data Documentation

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

stores the class name used for polymorphic load/save

Definition at line 386 of file PlannerObstacles.h.

Focus of the ellipse.

Definition at line 393 of file PlannerObstacles.h.

Referenced by collides(), getAngle(), 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:07 2016 by Doxygen 1.6.3