|
|
@ -1,6 +1,6 @@ |
|
|
|
import os |
|
|
|
import os |
|
|
|
import time |
|
|
|
import time |
|
|
|
from abc import abstractmethod |
|
|
|
from abc import abstractmethod, ABC |
|
|
|
from typing import Dict, Tuple, List |
|
|
|
from typing import Dict, Tuple, List |
|
|
|
|
|
|
|
|
|
|
|
from cereal import car |
|
|
|
from cereal import car |
|
|
@ -23,7 +23,7 @@ ACCEL_MIN = -3.5 |
|
|
|
# generic car and radar interfaces |
|
|
|
# generic car and radar interfaces |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class CarInterfaceBase(): |
|
|
|
class CarInterfaceBase(ABC): |
|
|
|
def __init__(self, CP, CarController, CarState): |
|
|
|
def __init__(self, CP, CarController, CarState): |
|
|
|
self.CP = CP |
|
|
|
self.CP = CP |
|
|
|
self.VM = VehicleModel(CP) |
|
|
|
self.VM = VehicleModel(CP) |
|
|
@ -170,7 +170,7 @@ class CarInterfaceBase(): |
|
|
|
return events |
|
|
|
return events |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class RadarInterfaceBase(): |
|
|
|
class RadarInterfaceBase(ABC): |
|
|
|
def __init__(self, CP): |
|
|
|
def __init__(self, CP): |
|
|
|
self.pts = {} |
|
|
|
self.pts = {} |
|
|
|
self.delay = 0 |
|
|
|
self.delay = 0 |
|
|
@ -184,7 +184,7 @@ class RadarInterfaceBase(): |
|
|
|
return ret |
|
|
|
return ret |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class CarStateBase: |
|
|
|
class CarStateBase(ABC): |
|
|
|
def __init__(self, CP): |
|
|
|
def __init__(self, CP): |
|
|
|
self.CP = CP |
|
|
|
self.CP = CP |
|
|
|
self.car_fingerprint = CP.carFingerprint |
|
|
|
self.car_fingerprint = CP.carFingerprint |
|
|
|