Initialize NCE 400m before TL 2
This commit is contained in:
parent
655dd94d5d
commit
66ec040672
@ -104,8 +104,12 @@ class Vehicle:
|
|||||||
|
|
||||||
:return: True if NCE invoked, otherwise False
|
: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._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._nce_happened = True
|
||||||
self._last_velocity = self.velocity
|
self._last_velocity = self.velocity
|
||||||
self.velocity = 0
|
self.velocity = 0
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user