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

Method _trace_route

agents/navigation/behavior_agent.py:139–161  ·  view source on GitHub ↗

This method sets up a global router and returns the optimal route from start_waypoint to end_waypoint. :param start_waypoint: initial position :param end_waypoint: final position

(self, start_waypoint, end_waypoint)

Source from the content-addressed store, hash-verified

137 self.set_destination(new_start, destination)
138
139 def _trace_route(self, start_waypoint, end_waypoint):
140 """
141 This method sets up a global router and returns the
142 optimal route from start_waypoint to end_waypoint.
143
144 :param start_waypoint: initial position
145 :param end_waypoint: final position
146 """
147 # Setting up global router
148 if self._grp is None:
149 wld = self.vehicle.get_world()
150 dao = GlobalRoutePlannerDAO(
151 wld.get_map(), sampling_resolution=self._sampling_resolution)
152 grp = GlobalRoutePlanner(dao)
153 grp.setup()
154 self._grp = grp
155
156 # Obtain route plan
157 route = self._grp.trace_route(
158 start_waypoint.transform.location,
159 end_waypoint.transform.location)
160
161 return route
162
163 def traffic_light_manager(self, waypoint):
164 """

Callers 1

set_destinationMethod · 0.95

Calls 6

setupMethod · 0.95
GlobalRoutePlannerClass · 0.90
get_worldMethod · 0.80
get_mapMethod · 0.80
trace_routeMethod · 0.80

Tested by

no test coverage detected