Fawkes API
Fawkes Development Version
|
#include <>>
Public Member Functions | |
NavGraphNode () | |
Constructor for invalid node. More... | |
NavGraphNode (const std::string &name, float x, float y, std::map< std::string, std::string > properties) | |
Constructor. More... | |
NavGraphNode (const std::string &name, float x, float y) | |
Constructor. More... | |
const std::string & | name () const |
Get name of node. More... | |
float | x () const |
Get X coordinate in global frame. More... | |
float | y () const |
Get Y coordinate in global frame. More... | |
bool | unconnected () const |
Check if this node shall be unconnected. More... | |
void | set_x (float x) |
Set X position. More... | |
void | set_y (float y) |
Set Y position. More... | |
void | set_name (const std::string &name) |
Set name of node. More... | |
void | set_unconnected (bool unconnected) |
Set unconnected state of the node. More... | |
float | distance (const NavGraphNode &n) |
Get euclidean distance from this node to another. More... | |
float | distance (float x, float y) |
Get euclidean distance from this node to a point. More... | |
const std::map< std::string, std::string > & | properties () const |
Get all properties. More... | |
bool | has_property (const std::string &property) const |
Check if node has specified property. More... | |
bool | is_valid () const |
Check if node is valid, i.e. More... | |
void | set_properties (const std::map< std::string, std::string > &properties) |
Overwrite properties with given ones. More... | |
void | set_property (const std::string &property, const std::string &value) |
Set property. More... | |
void | set_property (const std::string &property, float value) |
Set property. More... | |
void | set_property (const std::string &property, int value) |
Set property. More... | |
void | set_property (const std::string &property, bool value) |
Set property. More... | |
std::string | property (const std::string &prop) const |
Get specified property as string. More... | |
float | property_as_float (const std::string &prop) const |
Get property converted to float. More... | |
int | property_as_int (const std::string &prop) const |
Get property converted to int. More... | |
bool | property_as_bool (const std::string &prop) const |
Get property converted to bol. More... | |
bool | operator== (const NavGraphNode &n) const |
Check nodes for equality. More... | |
bool | operator!= (const NavGraphNode &n) const |
Check nodes for inequality. More... | |
operator bool () const | |
Check if node is valid. More... | |
void | set_reachable_nodes (std::vector< std::string > reachable_nodes) |
Set directly reachable nodes of node. More... | |
const std::vector< std::string > & | reachable_nodes () const |
Get reachable nodes. More... | |
Topological graph node.
Definition at line 38 of file navgraph_node.h.
fawkes::NavGraphNode::NavGraphNode | ( | ) |
Constructor for invalid node.
Definition at line 36 of file navgraph_node.cpp.
fawkes::NavGraphNode::NavGraphNode | ( | const std::string & | name, |
float | x, | ||
float | y, | ||
std::map< std::string, std::string > | properties | ||
) |
Constructor.
name | name of the node |
x | x coordinate in global frame of node |
y | y coordinate in global frame of node |
properties | properties for the new node |
Definition at line 46 of file navgraph_node.cpp.
References name(), properties(), x(), and y().
fawkes::NavGraphNode::NavGraphNode | ( | const std::string & | name, |
float | x, | ||
float | y | ||
) |
Constructor.
name | name of the node |
x | x coordinate in global frame of node |
y | y coordinate in global frame of node |
Definition at line 63 of file navgraph_node.cpp.
|
inline |
Get euclidean distance from this node to another.
n | node to get distance to |
Definition at line 95 of file navgraph_node.h.
|
inline |
Get euclidean distance from this node to a point.
x | point X coordinate |
y | point Y coordinate |
Definition at line 105 of file navgraph_node.h.
|
inline |
Check if node has specified property.
property | property key |
Definition at line 124 of file navgraph_node.h.
Referenced by NavGraphThread::loop().
|
inline |
Check if node is valid, i.e.
it has a name.
Definition at line 133 of file navgraph_node.h.
|
inline |
Get name of node.
Definition at line 57 of file navgraph_node.h.
Referenced by fawkes::NavGraphSearchState::estimate(), NavGraphThread::fam_event(), NavGraphThread::loop(), NavGraphNode(), fawkes::NavGraphSearchState::NavGraphSearchState(), fawkes::NavGraph::node(), fawkes::NavGraph::node_exists(), fawkes::NavGraph::remove_node(), and fawkes::NavGraph::remove_orphan_nodes().
|
inline |
Check if node is valid.
A node is valid if it has a name set.
Definition at line 202 of file navgraph_node.h.
|
inline |
Check nodes for inequality.
Nodes are inequal if they have different names.
n | node to compare with |
Definition at line 193 of file navgraph_node.h.
|
inline |
Check nodes for equality.
Nodes are equal if they have the same name.
n | node to compare with |
Definition at line 182 of file navgraph_node.h.
|
inline |
Get all properties.
Definition at line 114 of file navgraph_node.h.
References property().
Referenced by NavGraphNode().
std::string fawkes::NavGraphNode::property | ( | const std::string & | prop | ) | const |
Get specified property as string.
prop | property key |
Definition at line 117 of file navgraph_node.cpp.
Referenced by properties(), property_as_float(), and property_as_int().
|
inline |
Get property converted to bol.
prop | property key |
Definition at line 171 of file navgraph_node.h.
|
inline |
Get property converted to float.
prop | property key |
Definition at line 151 of file navgraph_node.h.
References property(), and fawkes::StringConversions::to_int().
Referenced by NavGraphThread::fam_event(), and NavGraphThread::loop().
|
inline |
Get property converted to int.
prop | property key |
Definition at line 161 of file navgraph_node.h.
References property(), and fawkes::StringConversions::to_bool().
|
inline |
Get reachable nodes.
Definition at line 213 of file navgraph_node.h.
Referenced by fawkes::NavGraphSearchState::is_goal().
void fawkes::NavGraphNode::set_name | ( | const std::string & | name | ) |
void fawkes::NavGraphNode::set_properties | ( | const std::map< std::string, std::string > & | properties | ) |
Overwrite properties with given ones.
properties | map of properties to set |
Definition at line 131 of file navgraph_node.cpp.
void fawkes::NavGraphNode::set_property | ( | const std::string & | property, |
bool | value | ||
) |
Set property.
property | property key |
value | property value |
Definition at line 171 of file navgraph_node.cpp.
void fawkes::NavGraphNode::set_property | ( | const std::string & | property, |
const std::string & | value | ||
) |
Set property.
property | property key |
value | property value |
Definition at line 141 of file navgraph_node.cpp.
Referenced by fawkes::NavGraph::apply_default_properties().
void fawkes::NavGraphNode::set_property | ( | const std::string & | property, |
float | value | ||
) |
Set property.
property | property key |
value | property value |
Definition at line 151 of file navgraph_node.cpp.
void fawkes::NavGraphNode::set_property | ( | const std::string & | property, |
int | value | ||
) |
Set property.
property | property key |
value | property value |
Definition at line 161 of file navgraph_node.cpp.
void fawkes::NavGraphNode::set_reachable_nodes | ( | std::vector< std::string > | reachable_nodes | ) |
Set directly reachable nodes of node.
reachable_nodes | vector of directly reachable nodes |
Definition at line 180 of file navgraph_node.cpp.
void fawkes::NavGraphNode::set_unconnected | ( | bool | unconnected | ) |
Set unconnected state of the node.
A node must be marked as unconnected explicitly or otherwise it is an error that the graph will report as an error. On other hand, unconnected nodes may not have any connection. By default nodes are expected to have at least one connection (behaving as though this function had been called with "false").
unconnected | true to make this node a unconnected node, false otherwise |
Definition at line 107 of file navgraph_node.cpp.
Referenced by NavGraphGeneratorThread::loop().
void fawkes::NavGraphNode::set_x | ( | float | x | ) |
Set X position.
x | X coordinate in global frame for node. |
Definition at line 74 of file navgraph_node.cpp.
void fawkes::NavGraphNode::set_y | ( | float | y | ) |
Set Y position.
y | Y coordinate in global frame for node. |
Definition at line 83 of file navgraph_node.cpp.
|
inline |
Check if this node shall be unconnected.
Definition at line 81 of file navgraph_node.h.
Referenced by fawkes::NavGraph::remove_orphan_nodes().
|
inline |
Get X coordinate in global frame.
Definition at line 65 of file navgraph_node.h.
Referenced by fawkes::NavGraph::closest_node_to(), distance(), fawkes::NavGraphSearchState::euclidean_cost(), NavGraphThread::fam_event(), fawkes::NavGraphSearchState::key(), and NavGraphNode().
|
inline |
Get Y coordinate in global frame.
Definition at line 73 of file navgraph_node.h.
Referenced by fawkes::NavGraph::closest_node_to(), distance(), fawkes::NavGraphSearchState::euclidean_cost(), NavGraphThread::fam_event(), fawkes::NavGraphSearchState::key(), and NavGraphNode().