28 for (
size_t i = 0; i < waypoints.size(); i++)
29 if (this->waypoints[i].map_id == r.
waypoints[i].map_id ||
30 this->waypoints[i].x == r.
waypoints[i].x ||
31 this->waypoints[i].y == r.
waypoints[i].y ||
32 this->waypoints[i].theta == r.
waypoints[i].theta)
return false;
38 for (
size_t i = 0; i < waypoints.size(); i++)
39 if (this->waypoints[i].map_id != r.
waypoints[i].map_id ||
40 this->waypoints[i].x != r.
waypoints[i].x ||
41 this->waypoints[i].y != r.
waypoints[i].y ||
42 this->waypoints[i].theta != r.
waypoints[i].theta)
return false;
48 std::ostringstream stringStream;
49 stringStream.precision(2);
51 for (
size_t i = 0; i < waypoints.size(); i++)
53 stringStream <<
" waypoint " << i <<
"(" << waypoints[i].map_id <<
" " << waypoints[i].x <<
"," << waypoints[i].y <<
"," << waypoints[i].theta <<
")";
55 return stringStream.str();
60 this->waypoints.clear();
65 for (
const auto& map_waypoint : map_waypoints)
67 waypoints.push_back(map_waypoint);
77 return waypoints[index];
82 return this->waypoints.size();
88 for (
auto it = waypoints.begin(); it != waypoints.end(); it++)
90 ll += sqrt(pow(it->x,2)+ pow(it->y,2));
97 if (waypoints.size() == 0)
return true;
98 string mapname = waypoints[0].map_id;
99 for (
auto it = waypoints.begin(); it != waypoints.end(); it++)
101 if (it->map_id != mapname)
return false;
108 return waypoints.begin();
114 return waypoints.end();
119 return waypoints.cbegin();
124 return waypoints.cend();
129 waypoints.push_back(loc);