Skip to content

Commit

Permalink
Move radar delay to carParams (commaai#1224)
Browse files Browse the repository at this point in the history
move radar delay to CP
  • Loading branch information
sshane authored Sep 5, 2024
1 parent 3dde383 commit c0a9ab5
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 3 deletions.
1 change: 1 addition & 0 deletions opendbc/car/honda/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experime

ret.steerActuatorDelay = 0.1
ret.steerLimitTimer = 0.8
ret.radarDelay = 0.1

return ret

Expand Down
2 changes: 0 additions & 2 deletions opendbc/car/honda/radar_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ def __init__(self, CP):
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
Expand Down
1 change: 0 additions & 1 deletion opendbc/car/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ def __init__(self, CP: structs.CarParams):
self.CP = CP
self.rcp = None
self.pts: dict[int, structs.RadarData.RadarPoint] = {}
self.delay = 0
self.radar_ts = CP.radarTimeStep
self.frame = 0

Expand Down
1 change: 1 addition & 0 deletions opendbc/car/structs.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ class LateralTorqueTuning:
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)
Expand Down

0 comments on commit c0a9ab5

Please sign in to comment.