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)
| 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 | """ |
no test coverage detected