21 #include <navgraph/constraints/polygon_edge_constraint.h> 77 Point from_p(from.x(), from.y());
78 Point to_p(to.x(), to.y());
79 if (
on_poly(from_p, to_p, p.second)) {
NavGraphPolygonEdgeConstraint(const std::string &name)
Constructor.
PolygonMap polygons_
currently registered polygons
Constraint that can be queried to check if an edge is blocked.
virtual bool compute(void)
Perform compuations before graph search and to indicate re-planning.
Simple point representation for polygon.
virtual bool blocks(const fawkes::NavGraphNode &from, const fawkes::NavGraphNode &to)
Check if constraint blocks an edge.
Fawkes library namespace.
std::string name()
Get name of constraint.
Constraint that blocks nodes within and edges touching a polygon.
bool on_poly(const Point &p1, const Point &p2, const Polygon &polygon)
Check if a line segments lies on a given polygon.
virtual ~NavGraphPolygonEdgeConstraint()
Virtual empty destructor.
std::vector< Point > Polygon
A vector of points makes a polygon.