From 5aaad511073986e62f15335a64a7918d9c4180ff Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Wed, 23 Oct 2024 23:22:50 -0500 Subject: [PATCH] Ford: set radar delay (#1416) * set delay * some tolerance * better wording * back --- opendbc/car/ford/interface.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/opendbc/car/ford/interface.py b/opendbc/car/ford/interface.py index fbd027a2dc..dfc64747cb 100644 --- a/opendbc/car/ford/interface.py +++ b/opendbc/car/ford/interface.py @@ -2,7 +2,7 @@ from opendbc.car import get_safety_config, structs from opendbc.car.common.conversions import Conversions as CV from opendbc.car.ford.fordcan import CanBus -from opendbc.car.ford.values import Ecu, FordFlags +from opendbc.car.ford.values import DBC, Ecu, FordFlags, RADAR from opendbc.car.interfaces import CarInterfaceBase TransmissionType = structs.CarParams.TransmissionType @@ -19,6 +19,11 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experime ret.steerActuatorDelay = 0.2 ret.steerLimitTimer = 1.0 + if DBC[candidate]['radar'] == RADAR.DELPHI_MRR: + # average of 33.3 Hz radar timestep / 4 scan modes = 60 ms + # MRR_Header_Timestamps->CAN_DET_TIME_SINCE_MEAS reports 61.3 ms + ret.radarDelay = 0.06 + CAN = CanBus(fingerprint=fingerprint) cfgs = [get_safety_config(structs.CarParams.SafetyModel.ford)] if CAN.main >= 4: