(self, vehicle, timestamp, distance_traveled)
| 19 | self._last_lane_id = None |
| 20 | |
| 21 | def tick(self, vehicle, timestamp, distance_traveled): |
| 22 | ev_loc = vehicle.get_location() |
| 23 | ev_yaw = vehicle.get_transform().rotation.yaw |
| 24 | self._is_outside_driving_lanes(ev_loc) |
| 25 | self._is_at_wrong_lane(ev_loc, ev_yaw) |
| 26 | |
| 27 | info = None |
| 28 | if self._outside_lane_active or self._wrong_lane_active: |
| 29 | info = { |
| 30 | 'step': timestamp['step'], |
| 31 | 'simulation_time': timestamp['relative_simulation_time'], |
| 32 | 'ev_loc': [ev_loc.x, ev_loc.y, ev_loc.z], |
| 33 | 'distance_traveled': distance_traveled, |
| 34 | 'outside_lane': self._outside_lane_active, |
| 35 | 'wrong_lane': self._wrong_lane_active |
| 36 | } |
| 37 | return info |
| 38 | |
| 39 | def _is_outside_driving_lanes(self, location): |
| 40 | """ |
nothing calls this directly
no test coverage detected