86#pragma omp parallel for num_threads(num_robots_)
87 for (
size_t iRobot = 0; iRobot < num_robots_; ++iRobot) {
88 Point2 const &pos = robot_global_positions_[iRobot];
101 for (
size_t jRobot = 0; jRobot < num_robots_; ++jRobot) {
102 if (iRobot == jRobot) {
106 robot_global_positions_[jRobot] - robot_global_positions_[iRobot];
108 robot_neighbors_pos.push_back(robot_global_positions_[jRobot]);
111 PointVector robot_positions(robot_neighbors_pos.size() + 1);
113 robot_positions[0] = robot_global_positions_[iRobot] - map_translation;
117 for (
Point2 const &pos : robot_neighbors_pos) {
118 robot_positions[count] = pos - map_translation;
122 Voronoi voronoi(robot_positions, robot_local_map, map_size,
125 voronoi_mass_[iRobot] = vcell.mass();
126 goals_[iRobot] = vcell.centroid() + robot_positions[0] + map_translation;
127 if (goals_[iRobot][0] < 0 or goals_[iRobot][0] > params_.
pWorldMapSize or
128 goals_[iRobot][1] < 0 or goals_[iRobot][1] > params_.
pWorldMapSize) {
129 std::cout <<
"Goal out of bounds: " << goals_[iRobot][0] <<
" "
130 << goals_[iRobot][1] << std::endl;
131 std::cout << robot_global_positions_[iRobot][0] <<
" "
132 << robot_global_positions_[iRobot][1] << std::endl;
133 std::cout << vcell.centroid()[0] <<
" " << vcell.centroid()[1]
135 std::cout << map_translation[0] <<
" " << map_translation[1]
137 std::cout << robot_local_map.sum() << std::endl;
138 throw std::runtime_error(
139 "Goal out of bounds: this should not have happened for convex "