31 #include <boost/make_shared.hpp> 33 namespace mnm = marti_nav_msgs;
48 for (
auto const &prop : src.properties) {
57 points.resize(msg.route_points.size());
58 for (
size_t i = 0; i <
points.size(); ++i) {
62 for (
auto const &prop : msg.properties) {
77 dst.properties.resize(names.size());
78 for (
size_t i = 0; i < names.size(); ++i) {
79 dst.properties[i].key = names[i];
80 dst.properties[i].value = src.
getProperty(names[i]);
88 msg.route_points.resize(
points.size());
89 for (
size_t i = 0; i <
points.size(); ++i) {
94 msg.properties.resize(names.size());
95 for (
size_t i = 0; i < names.size(); ++i) {
96 msg.properties[i].key = names[i];
160 std::vector<std::string> names;
161 names.push_back(
"name");
162 names.push_back(
"guid");
165 names.push_back(it.first);
173 if (name ==
"name") {
175 }
else if (name ==
"guid") {
186 if (name ==
"name") {
188 }
else if (name ==
"guid") {
197 if (name ==
"name") {
199 }
else if (name ==
"guid") {
240 for (
size_t i = 0; i <
points.size(); ++i) {
245 ROS_ERROR(
"Route points do not have unique IDs. This will likely cause problems.");
void setPose(const tf::Pose &pose)
void rebuildPointIndex() const
void setGuid(const std::string &guid)
std::vector< std::string > getPropertyNames() const
void setProperty(const std::string &name, const std::string &value)
std::map< std::string, std::string > properties_
static void msgFromPoint(marti_nav_msgs::RoutePoint &dst, const RoutePoint &src)
std::map< std::string, size_t > point_index_
marti_nav_msgs::RoutePtr toMsgPtr() const
void setName(const std::string &name)
static void pointFromMsg(RoutePoint &dst, const marti_nav_msgs::RoutePoint &src)
void setId(const std::string &id)
bool findPointId(size_t &index, const std::string &id) const
bool hasProperty(const std::string &name) const
void toMsg(marti_nav_msgs::Route &msg) const
std::vector< RoutePoint > points
const std::string & id() const
boost::shared_ptr< Route > RoutePtr
bool findPointIdConst(size_t &index, const std::string &id) const
std::string getProperty(const std::string &name) const
void setProperty(const std::string &name, const std::string &value)
std::string getProperty(const std::string &name) const
geometry_msgs::Pose poseMsg() const
void deleteProperty(const std::string &name)
std::vector< std::string > getPropertyNames() const