MCPcopy Create free account
hub / github.com/OpenDriveLab/DriveAdapter / set_global_plan

Method set_global_plan

agents/navigation/local_planner.py:193–217  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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 """

Callers 3

_apply_local_plannerMethod · 0.95
set_destinationMethod · 0.45
set_destinationMethod · 0.45

Calls 1

clearMethod · 0.80

Tested by

no test coverage detected