Fawkes API Fawkes Development Version
|
Base class for navgraph generators. More...
#include <>>
Public Member Functions | |
NavGraphGenerator () | |
Default constructor. More... | |
NavGraphGenerator (std::map< std::string, std::string > params) | |
Parametrized constructor. More... | |
virtual | ~NavGraphGenerator () |
Destructor. More... | |
virtual void | compute (fawkes::LockPtr< fawkes::NavGraph > graph)=0 |
Compute graph. More... | |
virtual void | set_bounding_box (float bbox_p1_x, float bbox_p1_y, float bbox_p2_x, float bbox_p2_y) |
Set bounding box. More... | |
virtual void | set_near_threshold (float near_threshold) |
Set distance threshold for considering nodes to be the same. More... | |
virtual void | add_obstacle (float x, float y) |
Add an obstacle point. More... | |
Static Public Member Functions | |
static std::string | genname (unsigned int &i) |
Generate a new name. More... | |
Protected Attributes | |
bool | bbox_enabled_ |
True if bounding box requested, false otherwise. More... | |
float | bbox_p1_x_ |
X part of P1 for bounding box. More... | |
float | bbox_p1_y_ |
Y part of P1 for bounding box. More... | |
float | bbox_p2_x_ |
X part of P2 for bounding box. More... | |
float | bbox_p2_y_ |
Y part of P2 for bounding box. More... | |
float | near_threshold_ |
distance threshold when to consider two nodes to be the same More... | |
std::list< std::pair< float, float > > | obstacles_ |
Obstacles to consider during navgraph generation. More... | |
std::map< std::string, std::string > | params_ |
Parameters specific to the actual generator in a generic format. More... | |
Base class for navgraph generators.
This class cannot be instantiated and used directly, rather it defines the general interface of specific generators.
To implementers of generators this provides some basic interface to define a bounding box, a near threshold, and to add obstacles. Note that these features may not be used by some generators. See the respective documentation.
If a bounding box is provided, it shall be defined befined on the ground plane in a right-handed coordinate system (the same in which all obstacles are defined) by two points P1 and P2. The point P1 shall be the "lower left" corner and P2 the "upper right" corner, i.e., P1 < P2, as in P1.x < P2.x and P1.y < P2.y.
Definition at line 30 of file generator.h.
fawkes::NavGraphGenerator::NavGraphGenerator | ( | ) |
Default constructor.
Disabled bounding box, set near threshold to 1cm.
Definition at line 56 of file generator.cpp.
fawkes::NavGraphGenerator::NavGraphGenerator | ( | std::map< std::string, std::string > | params | ) |
|
virtual |
Destructor.
Definition at line 81 of file generator.cpp.
|
virtual |
Add an obstacle point.
An obstacle point will be the representative for a Voronoi face in the newly generated graph.
x | X coordinate of point |
y | Y coordinate of point |
Definition at line 141 of file generator.cpp.
References obstacles_.
|
pure virtual |
Compute graph.
graph | the resulting nodes and edges will be added to this graph. The graph shall not be cleared automatically. The generator shall lock the graph as necessary. |
Implemented in fawkes::NavGraphGeneratorGrid, and fawkes::NavGraphGeneratorVoronoi.
|
static |
Generate a new name.
i | number parameter for point name, will be incremented by one |
Definition at line 90 of file generator.cpp.
Referenced by fawkes::NavGraphGeneratorVoronoi::compute().
|
virtual |
Set bounding box.
Setting a bounding box will cause compute() to ignore any edge with a vertex out of the given bounding box area.
bbox_p1_x | X coordinate of first (lower) bounding box point |
bbox_p1_y | y coordinate of first (lower) bounding box point |
bbox_p2_x | X coordinate of second (upper) bounding box point |
bbox_p2_y | y coordinate of second (upper) bounding box point |
Definition at line 111 of file generator.cpp.
References bbox_enabled_, bbox_p1_x_, bbox_p1_y_, bbox_p2_x_, and bbox_p2_y_.
|
virtual |
Set distance threshold for considering nodes to be the same.
near_threshold | distance threshold for which to consider nodes to be the same if the distance is smaller than this threshold. |
Definition at line 129 of file generator.cpp.
References near_threshold_.
|
protected |
True if bounding box requested, false otherwise.
Definition at line 46 of file generator.h.
Referenced by fawkes::NavGraphGeneratorGrid::compute(), fawkes::NavGraphGeneratorVoronoi::compute(), and set_bounding_box().
|
protected |
X part of P1 for bounding box.
Definition at line 47 of file generator.h.
Referenced by fawkes::NavGraphGeneratorGrid::compute(), fawkes::NavGraphGeneratorVoronoi::compute(), and set_bounding_box().
|
protected |
Y part of P1 for bounding box.
Definition at line 48 of file generator.h.
Referenced by fawkes::NavGraphGeneratorGrid::compute(), fawkes::NavGraphGeneratorVoronoi::compute(), and set_bounding_box().
|
protected |
X part of P2 for bounding box.
Definition at line 49 of file generator.h.
Referenced by fawkes::NavGraphGeneratorGrid::compute(), fawkes::NavGraphGeneratorVoronoi::compute(), and set_bounding_box().
|
protected |
Y part of P2 for bounding box.
Definition at line 50 of file generator.h.
Referenced by fawkes::NavGraphGeneratorGrid::compute(), fawkes::NavGraphGeneratorVoronoi::compute(), and set_bounding_box().
|
protected |
distance threshold when to consider two nodes to be the same
Definition at line 51 of file generator.h.
Referenced by fawkes::NavGraphGeneratorVoronoi::compute(), and set_near_threshold().
|
protected |
Obstacles to consider during navgraph generation.
Definition at line 54 of file generator.h.
Referenced by add_obstacle(), fawkes::NavGraphGeneratorGrid::compute(), and fawkes::NavGraphGeneratorVoronoi::compute().
|
protected |
Parameters specific to the actual generator in a generic format.
Definition at line 56 of file generator.h.