Move radar delay to carParams (#1224)

move radar delay to CP
This commit is contained in:
Shane Smiskol 2024-09-05 15:45:42 -07:00 committed by GitHub
parent 3dde383593
commit c0a9ab5c39
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 2 additions and 3 deletions

View File

@ -206,6 +206,7 @@ class CarInterface(CarInterfaceBase):
ret.steerActuatorDelay = 0.1
ret.steerLimitTimer = 0.8
ret.radarDelay = 0.1
return ret

View File

@ -20,8 +20,6 @@ class RadarInterface(RadarInterfaceBase):
self.radar_off_can = CP.radarUnavailable
self.radar_ts = CP.radarTimeStep
self.delay = int(round(0.1 / CP.radarTimeStep)) # 0.1s delay of radar
# Nidec
if self.radar_off_can:
self.rcp = None

View File

@ -260,7 +260,6 @@ class RadarInterfaceBase(ABC):
self.CP = CP
self.rcp = None
self.pts: dict[int, structs.RadarData.RadarPoint] = {}
self.delay = 0
self.radar_ts = CP.radarTimeStep
self.frame = 0

View File

@ -385,6 +385,7 @@ class CarParams:
carFw: list['CarParams.CarFw'] = auto_field()
radarTimeStep: float = 0.05 # time delta between radar updates, 20Hz is very standard
radarDelay: float = auto_field()
fingerprintSource: 'CarParams.FingerprintSource' = field(default_factory=lambda: CarParams.FingerprintSource.can)
# Where Panda/C2 is integrated into the car's CAN network
networkLocation: 'CarParams.NetworkLocation' = field(default_factory=lambda: CarParams.NetworkLocation.fwdCamera)