class_docstr: This class provides a very high level route plan.
class_docstr_tok: ["This","class","provides","a","very","high","level","route","plan","."]
docstr: This method returns list of (carla.Waypoint, RoadOption)
  from origin to destination
docstr_tok: ["This","method","returns","list","of","(","carla.Waypoint",",","RoadOption",")","from","origin","to","destination"]
code: def trace_route(self, origin, destination):
      """
      This method returns list of (carla.Waypoint, RoadOption)
      from origin to destination
      """
      route_trace = []
      route = self._path_search(origin, destination)
      current_waypoint = self._wmap.get_waypoint(origin)
      destination_waypoint = self._wmap.get_waypoint(destination)
  
      for i in range(len(route) - 1):
          road_option = self._turn_decision(i, route)
          edge = self._graph.edges[route[i], route[i + 1]]
          path = []
  
          if (
              edge["type"] != RoadOption.LANEFOLLOW
              and edge["type"] != RoadOption.VOID
          ):
              route_trace.append((current_waypoint, road_option))
              exit_wp = edge["exit_waypoint"]
              n1, n2 = self._road_id_to_edge[exit_wp.road_id][
                  exit_wp.section_id
              ][exit_wp.lane_id]
              next_edge = self._graph.edges[n1, n2]
              if next_edge["path"]:
                  closest_index = self._find_closest_in_list(
                      current_waypoint, next_edge["path"]
                  )
                  closest_index = min(
                      len(next_edge["path"]) - 1, closest_index + 5
                  )
                  current_waypoint = next_edge["path"][closest_index]
              else:
                  current_waypoint = next_edge["exit_waypoint"]
              route_trace.append((current_waypoint, road_option))
  
          else:
              path = (
                  path
                  + [edge["entry_waypoint"]]
                  + edge["path"]
                  + [edge["exit_waypoint"]]
              )
              closest_index = self._find_closest_in_list(
                  current_waypoint, path
              )
              for waypoint in path[closest_index:]:
                  current_waypoint = waypoint
                  route_trace.append((current_waypoint, road_option))
                  if (
                      len(route) - i <= 2
                      and waypoint.transform.location.distance(
                          destination
                      )
                      < 2 * self._sampling_resolution
                  ):
                      break
                  elif (
                      len(route) - i <= 2
                      and current_waypoint.road_id
                      == destination_waypoint.road_id
                      and current_waypoint.section_id
                      == destination_waypoint.section_id
                      and current_waypoint.lane_id
                      == destination_waypoint.lane_id
                  ):
                      destination_index = self._find_closest_in_list(
                          destination_waypoint, path
                      )
                      if closest_index > destination_index:
                          break
  
      return route_trace
  
file_path: carla/PythonAPI/carla/agents/navigation/global_route_planner.py
imports: import math
  import numpy
  import networkx
  import carla
  from agents.navigation.local_planner import RoadOption
  from agents.tools.misc import vector
label_desc: Use image node_id 2 for calling the GlobalRoutePlanner obj's underlying member method code with example usage: obj.trace_route(origin, destination) and returns: route_trace