Skip to content

Commit

Permalink
Revert "Move radar delay to carParams (commaai#1224)"
Browse files Browse the repository at this point in the history
This reverts commit c0a9ab5.
  • Loading branch information
cydia2020 committed Sep 6, 2024
1 parent dcd58eb commit 10a4df2
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 2 deletions.
1 change: 0 additions & 1 deletion opendbc/car/honda/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ 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: 2 additions & 0 deletions opendbc/car/honda/radar_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ 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: 1 addition & 0 deletions opendbc/car/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ 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: 0 additions & 1 deletion opendbc/car/structs.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,6 @@ 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 10a4df2

Please sign in to comment.