Resets the waypoint queue and buffer to match the new plan. Also sets the global_plan flag to avoid creating more waypoints :param current_plan: list of (carla.Waypoint, RoadOption) :return:
(self, current_plan)
| 191 | self._waypoints_queue.append((next_waypoint, road_option)) |
| 192 | |
| 193 | def set_global_plan(self, current_plan): |
| 194 | """ |
| 195 | Resets the waypoint queue and buffer to match the new plan. Also |
| 196 | sets the global_plan flag to avoid creating more waypoints |
| 197 | |
| 198 | :param current_plan: list of (carla.Waypoint, RoadOption) |
| 199 | :return: |
| 200 | """ |
| 201 | |
| 202 | # Reset the queue |
| 203 | self._waypoints_queue.clear() |
| 204 | for elem in current_plan: |
| 205 | self._waypoints_queue.append(elem) |
| 206 | self._target_road_option = RoadOption.LANEFOLLOW |
| 207 | |
| 208 | # and the buffer |
| 209 | self._waypoint_buffer.clear() |
| 210 | for _ in range(self._buffer_size): |
| 211 | if self._waypoints_queue: |
| 212 | self._waypoint_buffer.append( |
| 213 | self._waypoints_queue.popleft()) |
| 214 | else: |
| 215 | break |
| 216 | |
| 217 | self._global_plan = True |
| 218 | |
| 219 | def run_step(self, debug=False): |
| 220 | """ |
no test coverage detected