Initialize NCE 400m before TL 2

This commit is contained in:
Tobias Eidelpes 2021-06-17 22:26:34 +02:00
parent 655dd94d5d
commit 66ec040672

View File

@ -104,8 +104,12 @@ class Vehicle:
:return: True if NCE invoked, otherwise False
"""
d = geopy.distance.distance(kilometers=0.4)
tl2_loc = geopy.Point(47.90937, 16.20814)
# Calculate point 400m south of traffic light 2
nce_point = d.destination(point=tl2_loc, bearing=182)
if self._nce_possible and not self._nce_happened:
if self._driven_kms >= NCE_KM:
if self._gps_location.latitude >= nce_point.latitude:
self._nce_happened = True
self._last_velocity = self.velocity
self.velocity = 0