From b8ca4e6bfacee459604e095477ce13c0c452d833 Mon Sep 17 00:00:00 2001 From: Marco Zeisler Date: Sat, 15 May 2021 16:45:35 +0200 Subject: [PATCH] let car drive north: BEARING = 0; evaluate self.nce before self.velocity; --- components/i_feed/vehicle.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/components/i_feed/vehicle.py b/components/i_feed/vehicle.py index 062755e..bf8872a 100644 --- a/components/i_feed/vehicle.py +++ b/components/i_feed/vehicle.py @@ -12,7 +12,7 @@ STARTING_POINT = geopy.Point(48.853, 2.349) # in km/h STARTING_VELOCITY = 130 # Driving direction in degrees: 0=N, 90=E, 180=S, 270=W -BEARING = 90 +BEARING = 0 # Scale speed of vehicles by factor x SCALING = 1 # At x km the NCE shall happen @@ -49,9 +49,9 @@ class Vehicle: def daf(self): return DAF(vehicle_identification_number=self.vin, gps_location=self.gps_location, - velocity=self.velocity, timestamp=self.timestamp, - near_crash_event=self.nce + near_crash_event=self.nce, + velocity=self.velocity, ) @property @@ -79,7 +79,7 @@ class Vehicle: # Define a general distance object, initialized with a distance of 1 km. d = geopy.distance.distance(kilometers=kilometers) - # Use the `destination` method with a bearing of bearing degrees (90 is east) + # Use the `destination` method with a bearing of bearing degrees # in order to go from point `start` to kilometers km bearing. self._gps_location = d.destination(point=start, bearing=BEARING) @@ -107,5 +107,5 @@ if __name__ == "__main__": v1 = Vehicle(vin='SB164ABN1PE082986') v1.start_driving() while True: - print(v1.gps_location, v1.driven_kms, v1.nce) + print(v1.daf) time.sleep(1)