23#ifndef _UTILS_GRAPH_TOPOLOGICAL_MAP_NODE_H_
24#define _UTILS_GRAPH_TOPOLOGICAL_MAP_NODE_H_
26#include <utils/misc/string_conversions.h>
43 std::map<std::string, std::string>
properties);
90 return sqrtf(powf(x_ - n.x_, 2) + powf(y_ - n.y_, 2));
100 return sqrtf(powf(x_ -
x, 2) + powf(y_ -
y, 2));
106 const std::map<std::string, std::string> &
119 return properties_.find(
property) != properties_.end();
137 std::string
property(
const std::string &prop)
const;
177 return name_ == n.name_;
188 return name_ != n.name_;
195 operator bool()
const
205 const std::vector<std::string> &
208 return reachable_nodes_;
216 std::map<std::string, std::string> properties_;
217 std::vector<std::string> reachable_nodes_;
float x() const
Get X coordinate in global frame.
void set_x(float x)
Set X position.
std::string property(const std::string &prop) const
Get specified property as string.
float distance(float x, float y)
Get euclidean distance from this node to a point.
void set_property(const std::string &property, const std::string &value)
Set property.
void set_name(const std::string &name)
Set name of node.
bool operator!=(const NavGraphNode &n) const
Check nodes for inequality.
bool property_as_bool(const std::string &prop) const
Get property converted to bol.
const std::map< std::string, std::string > & properties() const
Get all properties.
bool unconnected() const
Check if this node shall be unconnected.
bool is_valid() const
Check if node is valid, i.e.
int property_as_int(const std::string &prop) const
Get property converted to int.
const std::string & name() const
Get name of node.
NavGraphNode()
Constructor for invalid node.
void set_reachable_nodes(std::vector< std::string > reachable_nodes)
Set directly reachable nodes of node.
float distance(const NavGraphNode &n)
Get euclidean distance from this node to another.
float property_as_float(const std::string &prop) const
Get property converted to float.
bool has_property(const std::string &property) const
Check if node has specified property.
float y() const
Get Y coordinate in global frame.
void set_properties(const std::map< std::string, std::string > &properties)
Overwrite properties with given ones.
void set_unconnected(bool unconnected)
Set unconnected state of the node.
void set_y(float y)
Set Y position.
bool operator==(const NavGraphNode &n) const
Check nodes for equality.
const std::vector< std::string > & reachable_nodes() const
Get reachable nodes.
static float to_float(std::string s)
Convert string to a float value.
static bool to_bool(std::string s)
Convert string to a bool value.
static int to_int(std::string s)
Convert string to an int value.
Fawkes library namespace.