23 #ifndef __LIBS_NAVGRAPH_NAVGRAPH_PATH_H_ 24 #define __LIBS_NAVGRAPH_NAVGRAPH_PATH_H_ 26 #include <navgraph/navgraph_node.h> 69 {
return path_ != NULL; }
72 void assert_initialized()
const;
83 void set_nodes(
const std::vector<NavGraphNode> &nodes,
float cost = -1);
94 const std::vector<NavGraphNode> &
nodes()
const 129 std::vector<NavGraphNode> nodes_;
void clear()
Clear all nodes on this path.
size_t size() const
Get size of path.
void reset()
Reset an ongoing traversal.
std::vector< NavGraphNode > & nodes_mutable()
Get nodes along the path as mutable vector.
const NavGraphNode & current() const
Get current node in path.
std::string get_path_as_string(const char delim=':') const
Get string representation of path.
Fawkes library namespace.
bool operator<(const NavGraphPath &p) const
Check if this path is cheaper than the other path.
Class representing a path for a NavGraph.
void set_current(size_t new_current)
Set the current node.
void set_nodes(const std::vector< NavGraphNode > &nodes, float cost=-1)
Set nodes erasing the current path.
float cost() const
Get cost of path from start to to end.
bool last() const
Check if the current node is the last node in the path.
std::vector< std::string > get_node_names() const
Get names of nodes in path.
const NavGraphNode & peek_next() const
Peek on the next node.
size_t remaining() const
Get the number of remaining nodes in path traversal.
const NavGraph & graph() const
Get graph this path is based on.
const std::vector< NavGraphNode > & nodes() const
Get nodes along the path.
Traversal traversal() const
Get a new path traversal handle.
Sub-class representing a navgraph path traversal.
bool running() const
Check if traversal is currently runnung.
const NavGraphPath & path() const
Get parent path the traversal belongs to.
bool empty() const
Check if path is empty.
size_t current_index() const
Get index of current node in path.
float remaining_cost() const
Get the remaining cost to the goal.
bool operator==(const NavGraphPath &p) const
Check if two paths are the same.
void invalidate()
Invalidate this traversal.
void add_node(const NavGraphNode &node, float cost_from_end=0)
Add a node to the path.
bool contains(const NavGraphNode &node) const
Check if the path contains a given node.
bool next()
Move on traversal to next node.
const NavGraphNode & goal() const
Get goal of path.