Fawkes API
Fawkes Development Version
|
Constraint that blocks nodes inside a polygon. More...
#include <>>
Public Member Functions | |
NavGraphPolygonNodeConstraint (const std::string &name) | |
Constructor. More... | |
NavGraphPolygonNodeConstraint (const std::string &name, const Polygon &polygon) | |
Constructor. More... | |
virtual | ~NavGraphPolygonNodeConstraint () |
Virtual empty destructor. More... | |
virtual bool | compute (void) throw () |
Perform compuations before graph search and to indicate re-planning. More... | |
virtual bool | blocks (const fawkes::NavGraphNode &node) throw () |
Check if constraint blocks a node. More... | |
![]() | |
NavGraphNodeConstraint (const std::string &name) | |
Constructor. More... | |
NavGraphNodeConstraint (const char *name) | |
Constructor. More... | |
virtual | ~NavGraphNodeConstraint () |
Virtual empty destructor. More... | |
std::string | name () |
Get name of constraint. More... | |
bool | operator== (const std::string &name) const |
Check if constraint matches name. More... | |
![]() | |
virtual | ~NavGraphPolygonConstraint () |
Virtual empty destructor. More... | |
const PolygonMap & | polygons () const |
Get reference to the map of polygons. More... | |
PolygonHandle | add_polygon (const Polygon &polygon) |
Add a polygon to constraint list. More... | |
void | remove_polygon (const PolygonHandle &handle) |
Remove a polygon from the constraint list. More... | |
void | clear_polygons () |
Remove all polygons. More... | |
Additional Inherited Members | |
![]() | |
typedef struct fawkes::NavGraphPolygonConstraint::Point_ | Point |
Simple point representation for polygon. More... | |
typedef unsigned int | PolygonHandle |
Handle for polygon for selective removal. More... | |
typedef std::vector< Point > | Polygon |
A vector of points makes a polygon. More... | |
typedef std::map< PolygonHandle, Polygon > | PolygonMap |
Map for accessing all polygons at once with their handles. More... | |
![]() | |
NavGraphPolygonConstraint () | |
Constructor. More... | |
NavGraphPolygonConstraint (const Polygon &polygon) | |
Constructor. More... | |
bool | in_poly (const Point &point, const Polygon &polygon) |
Check if given point lies inside the polygon. More... | |
bool | on_poly (const Point &p1, const Point &p2, const Polygon &polygon) |
Check if a line segments lies on a given polygon. More... | |
![]() | |
std::string | name_ |
Name of constraint. More... | |
![]() | |
PolygonMap | polygons_ |
currently registered polygons More... | |
Constraint that blocks nodes inside a polygon.
Definition at line 37 of file polygon_node_constraint.h.
fawkes::NavGraphPolygonNodeConstraint::NavGraphPolygonNodeConstraint | ( | const std::string & | name | ) |
Constructor.
name | name of node constraint |
Definition at line 39 of file polygon_node_constraint.cpp.
fawkes::NavGraphPolygonNodeConstraint::NavGraphPolygonNodeConstraint | ( | const std::string & | name, |
const Polygon & | polygon | ||
) |
Constructor.
name | name of node constraint |
polygon | polygon to add immediately |
Definition at line 50 of file polygon_node_constraint.cpp.
|
virtual |
Virtual empty destructor.
Definition at line 57 of file polygon_node_constraint.cpp.
|
virtual |
Check if constraint blocks a node.
This method must be implemented by constraint classes. It is called to determine if a node should be considered blocked and therefore cannot be expanded during path search. Note that the method may not throw an exception. Handle this internally appropriately.
node | node to check for expansion |
Implements fawkes::NavGraphNodeConstraint.
Definition at line 74 of file polygon_node_constraint.cpp.
References fawkes::NavGraphPolygonConstraint::in_poly(), and fawkes::NavGraphPolygonConstraint::polygons_.
|
virtual |
Perform compuations before graph search and to indicate re-planning.
The compute method is called on all constraints just before a path search is performed and to check if re-planning should be tried.
It can be used for example to cache results for the coming search run. The search guarantees that for each complete search run compute() is called once and only once and that no two search runs overlap, i.e., compute() will not be called while another search is still running.
Constraints must indicate whether any change has occured during computation or since the last compute() call through the return value. This is used to determine if re-planning should be attempted.
Reimplemented from fawkes::NavGraphNodeConstraint.
Definition at line 63 of file polygon_node_constraint.cpp.
References fawkes::NavGraphPolygonConstraint::polygons_.