Skip to content

Commit

Permalink
Reapply "Move radar delay to carParams (commaai#1224)"
Browse files Browse the repository at this point in the history
This reverts commit 10a4df2.
  • Loading branch information
cydia2020 committed Sep 6, 2024
1 parent 10a4df2 commit 891cd9f
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 @@ -207,6 +207,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 @@ -261,7 +261,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 @@ -390,6 +390,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 891cd9f

Please sign in to comment.