23 #include <navgraph/constraints/static_list_edge_constraint.h> 56 std::vector<fawkes::NavGraphEdge> &
edge_list)
89 edge_list_.push_back(edge);
98 const std::vector<fawkes::NavGraphEdge> &edges)
111 std::vector<NavGraphEdge>::iterator e
112 = std::find(edge_list_.begin(), edge_list_.end(), edge);
113 if (e != edge_list_.end()) {
126 return (std::find(edge_list_.begin(), edge_list_.end(), edge) != edge_list_.end());
133 const std::vector<fawkes::NavGraphEdge> &
144 if (! edge_list_.empty()) {
156 if ((e.from() == from.name() && e.to() == to.name()) ||
157 (e.from() == to.name() && e.to() == from.name()) )
Constraint that can be queried to check if an edge is blocked.
virtual bool blocks(const fawkes::NavGraphNode &from, const fawkes::NavGraphNode &to)
Check if constraint blocks an edge.
void remove_edge(const fawkes::NavGraphEdge &edge)
Remove a single edge from the constraint list.
Fawkes library namespace.
NavGraphStaticListEdgeConstraint(std::string name)
Constructor.
bool has_edge(const fawkes::NavGraphEdge &edge)
Check if constraint has a specific edge.
const std::vector< fawkes::NavGraphEdge > & edge_list() const
Get list of blocked edges.
virtual bool compute(void)
Perform compuations before graph search and to indicate re-planning.
std::string name()
Get name of constraint.
void clear_edges()
Remove all edges.
virtual ~NavGraphStaticListEdgeConstraint()
Virtual empty destructor.
void add_edges(const std::vector< fawkes::NavGraphEdge > &edges)
Add multiple edges to constraint list.
void add_edge(const fawkes::NavGraphEdge &edge)
Add a single edge to constraint list.