:param vehicle: actor to apply to local planner logic onto :param opt_dict: dictionary of arguments with the following semantics: dt -- time difference between physics control in seconds. This is typically fixed from server side using the arguments -ben
(self, vehicle, opt_dict=None)
| 41 | MIN_DISTANCE_PERCENTAGE = 0.9 |
| 42 | |
| 43 | def __init__(self, vehicle, opt_dict=None): |
| 44 | """ |
| 45 | :param vehicle: actor to apply to local planner logic onto |
| 46 | :param opt_dict: dictionary of arguments with the following semantics: |
| 47 | dt -- time difference between physics control in seconds. This is typically fixed from server side |
| 48 | using the arguments -benchmark -fps=F . In this case dt = 1/F |
| 49 | |
| 50 | target_speed -- desired cruise speed in Km/h |
| 51 | |
| 52 | sampling_radius -- search radius for next waypoints in seconds: e.g. 0.5 seconds ahead |
| 53 | |
| 54 | lateral_control_dict -- dictionary of arguments to setup the lateral PID controller |
| 55 | {'K_P':, 'K_D':, 'K_I':, 'dt'} |
| 56 | |
| 57 | longitudinal_control_dict -- dictionary of arguments to setup the longitudinal PID controller |
| 58 | {'K_P':, 'K_D':, 'K_I':, 'dt'} |
| 59 | """ |
| 60 | self._vehicle = vehicle |
| 61 | self._map = self._vehicle.get_world().get_map() |
| 62 | |
| 63 | self._dt = None |
| 64 | self._target_speed = None |
| 65 | self._sampling_radius = None |
| 66 | self._min_distance = None |
| 67 | self._current_waypoint = None |
| 68 | self._target_road_option = None |
| 69 | self._next_waypoints = None |
| 70 | self.target_waypoint = None |
| 71 | self._vehicle_controller = None |
| 72 | self._global_plan = None |
| 73 | # queue with tuples of (waypoint, RoadOption) |
| 74 | self._waypoints_queue = deque(maxlen=20000) |
| 75 | self._buffer_size = 5 |
| 76 | self._waypoint_buffer = deque(maxlen=self._buffer_size) |
| 77 | |
| 78 | # initializing controller |
| 79 | self._init_controller(opt_dict) |
| 80 | |
| 81 | def __del__(self): |
| 82 | if self._vehicle: |
nothing calls this directly
no test coverage detected