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 40 of file navgraph_node.h.
fawkes::NavGraphNode::NavGraphNode | ( | ) |
Constructor for invalid node.
Definition at line 38 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 48 of file navgraph_node.cpp.
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 65 of file navgraph_node.cpp.
|
inline |
Get euclidean distance from this node to another.
n | node to get distance to |
Definition at line 98 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 108 of file navgraph_node.h.
|
inline |
Check if node has specified property.
property | property key |
Definition at line 127 of file navgraph_node.h.
Referenced by NavGraphThread::loop(), and fawkes::NavGraph::set_default_property().
|
inline |
Check if node is valid, i.e.
it has a name.
Definition at line 136 of file navgraph_node.h.
|
inline |
Get name of node.
Definition at line 60 of file navgraph_node.h.
Referenced by fawkes::NavGraphSearchState::estimate(), NavGraphThread::fam_event(), NavGraphThread::loop(), fawkes::NavGraphEdge::set_to(), and set_y().
|
inline |
Check if node is valid.
A node is valid if it has a name set.
Definition at line 205 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 196 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 185 of file navgraph_node.h.
|
inline |
Get all properties.
Definition at line 117 of file navgraph_node.h.
References property().
std::string fawkes::NavGraphNode::property | ( | const std::string & | prop | ) | const |
Get specified property as string.
prop | property key |
Definition at line 119 of file navgraph_node.cpp.
Referenced by properties(), property_as_float(), property_as_int(), set_properties(), and set_property().
|
inline |
Get property converted to bol.
prop | property key |
Definition at line 174 of file navgraph_node.h.
|
inline |
Get property converted to float.
prop | property key |
Definition at line 154 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 164 of file navgraph_node.h.
References property(), and fawkes::StringConversions::to_bool().
|
inline |
Get reachable nodes.
Definition at line 216 of file navgraph_node.h.
Referenced by fawkes::NavGraphSearchState::is_goal(), and set_property().
void fawkes::NavGraphNode::set_name | ( | const std::string & | name | ) |
Set name of node.
name | new name for node |
Definition at line 94 of file navgraph_node.cpp.
References unconnected().
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 133 of file navgraph_node.cpp.
References property().
void fawkes::NavGraphNode::set_property | ( | const std::string & | property, |
bool | value | ||
) |
Set property.
property | property key |
value | property value |
Definition at line 173 of file navgraph_node.cpp.
References reachable_nodes().
void fawkes::NavGraphNode::set_property | ( | const std::string & | property, |
const std::string & | value | ||
) |
Set property.
property | property key |
value | property value |
Definition at line 143 of file navgraph_node.cpp.
References property(), and fawkes::StringConversions::to_string().
Referenced by fawkes::NavGraph::set_default_property().
void fawkes::NavGraphNode::set_property | ( | const std::string & | property, |
float | value | ||
) |
Set property.
property | property key |
value | property value |
Definition at line 153 of file navgraph_node.cpp.
References property(), and fawkes::StringConversions::to_string().
void fawkes::NavGraphNode::set_property | ( | const std::string & | property, |
int | value | ||
) |
Set property.
property | property key |
value | property value |
Definition at line 163 of file navgraph_node.cpp.
References property().
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 182 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 109 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 76 of file navgraph_node.cpp.
References y().
void fawkes::NavGraphNode::set_y | ( | float | y | ) |
Set Y position.
y | Y coordinate in global frame for node. |
Definition at line 85 of file navgraph_node.cpp.
References name().
|
inline |
Check if this node shall be unconnected.
Definition at line 84 of file navgraph_node.h.
Referenced by set_name().
|
inline |
Get X coordinate in global frame.
Definition at line 68 of file navgraph_node.h.
Referenced by distance(), fawkes::NavGraphSearchState::euclidean_cost(), NavGraphThread::fam_event(), fawkes::NavGraphSearchState::key(), and fawkes::NavGraphEdge::set_property().
|
inline |
Get Y coordinate in global frame.
Definition at line 76 of file navgraph_node.h.
Referenced by distance(), fawkes::NavGraphSearchState::euclidean_cost(), NavGraphThread::fam_event(), fawkes::NavGraphSearchState::key(), fawkes::NavGraphEdge::set_property(), and set_x().