Deprecate radarTimeStep (#1407)

* not used

* more
This commit is contained in:
Shane Smiskol 2024-10-23 16:14:24 -05:00 committed by GitHub
parent 84970d2c74
commit 52d0b51563
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 3 additions and 11 deletions

View File

@ -508,7 +508,6 @@ struct CarParams {
transmissionType @43 :TransmissionType; transmissionType @43 :TransmissionType;
carFw @44 :List(CarFw); carFw @44 :List(CarFw);
radarTimeStep @45: Float32 = 0.05; # time delta between radar updates, 20Hz is very standard
radarDelay @74 :Float32; radarDelay @74 :Float32;
fingerprintSource @49: FingerprintSource; fingerprintSource @49: FingerprintSource;
networkLocation @50 :NetworkLocation; # Where Panda/C2 is integrated into the car's CAN network networkLocation @50 :NetworkLocation; # Where Panda/C2 is integrated into the car's CAN network
@ -719,4 +718,5 @@ struct CarParams {
maxSteeringAngleDegDEPRECATED @54 :Float32; maxSteeringAngleDegDEPRECATED @54 :Float32;
longitudinalActuatorDelayLowerBoundDEPRECATED @61 :Float32; longitudinalActuatorDelayLowerBoundDEPRECATED @61 :Float32;
stoppingControlDEPRECATED @31 :Bool; # Does the car allow full control even at lows speeds when stopping stoppingControlDEPRECATED @31 :Bool; # Does the car allow full control even at lows speeds when stopping
radarTimeStepDEPRECATED @45: Float32 = 0.05; # time delta between radar updates, 20Hz is very standard
} }

View File

@ -2,7 +2,7 @@ from panda import Panda
from opendbc.car import get_safety_config, structs from opendbc.car import get_safety_config, structs
from opendbc.car.common.conversions import Conversions as CV from opendbc.car.common.conversions import Conversions as CV
from opendbc.car.ford.fordcan import CanBus from opendbc.car.ford.fordcan import CanBus
from opendbc.car.ford.values import DBC, Ecu, FordFlags, RADAR from opendbc.car.ford.values import Ecu, FordFlags
from opendbc.car.interfaces import CarInterfaceBase from opendbc.car.interfaces import CarInterfaceBase
TransmissionType = structs.CarParams.TransmissionType TransmissionType = structs.CarParams.TransmissionType
@ -15,9 +15,6 @@ class CarInterface(CarInterfaceBase):
ret.dashcamOnly = bool(ret.flags & FordFlags.CANFD) ret.dashcamOnly = bool(ret.flags & FordFlags.CANFD)
ret.radarUnavailable = True ret.radarUnavailable = True
if DBC[candidate]['radar'] == RADAR.DELPHI_MRR:
ret.radarTimeStep = 0.03 # 33.3 Hz
ret.steerControlType = structs.CarParams.SteerControlType.angle ret.steerControlType = structs.CarParams.SteerControlType.angle
ret.steerActuatorDelay = 0.2 ret.steerActuatorDelay = 0.2
ret.steerLimitTimer = 1.0 ret.steerLimitTimer = 1.0

View File

@ -138,7 +138,6 @@ class CarInterface(CarInterfaceBase):
ret.steerActuatorDelay = 0.1 # Default delay, not measured yet ret.steerActuatorDelay = 0.1 # Default delay, not measured yet
ret.steerLimitTimer = 0.4 ret.steerLimitTimer = 0.4
ret.radarTimeStep = 0.0667 # GM radar runs at 15Hz instead of standard 20Hz
ret.longitudinalActuatorDelay = 0.5 # large delay to initially start braking ret.longitudinalActuatorDelay = 0.5 # large delay to initially start braking
if candidate == CAR.CHEVROLET_VOLT: if candidate == CAR.CHEVROLET_VOLT:

View File

@ -40,7 +40,6 @@ class RadarInterface(RadarInterfaceBase):
self.trigger_msg = LAST_RADAR_MSG self.trigger_msg = LAST_RADAR_MSG
self.updated_messages = set() self.updated_messages = set()
self.radar_ts = CP.radarTimeStep
def update(self, can_strings): def update(self, can_strings):
if self.rcp is None: if self.rcp is None:

View File

@ -18,7 +18,6 @@ class RadarInterface(RadarInterfaceBase):
self.radar_fault = False self.radar_fault = False
self.radar_wrong_config = False self.radar_wrong_config = False
self.radar_off_can = CP.radarUnavailable self.radar_off_can = CP.radarUnavailable
self.radar_ts = CP.radarTimeStep
# Nidec # Nidec
if self.radar_off_can: if self.radar_off_can:

View File

@ -259,12 +259,11 @@ class RadarInterfaceBase(ABC):
self.CP = CP self.CP = CP
self.rcp = None self.rcp = None
self.pts: dict[int, structs.RadarData.RadarPoint] = {} self.pts: dict[int, structs.RadarData.RadarPoint] = {}
self.radar_ts = CP.radarTimeStep
self.frame = 0 self.frame = 0
def update(self, can_packets: list[tuple[int, list[CanData]]]) -> structs.RadarDataT | None: def update(self, can_packets: list[tuple[int, list[CanData]]]) -> structs.RadarDataT | None:
self.frame += 1 self.frame += 1
if (self.frame % int(100 * self.radar_ts)) == 0: if (self.frame % 5) == 0: # 20 Hz is very standard
return structs.RadarData() return structs.RadarData()
return None return None

View File

@ -23,7 +23,6 @@ class RadarInterface(RadarInterfaceBase):
def __init__(self, CP): def __init__(self, CP):
super().__init__(CP) super().__init__(CP)
self.track_id = 0 self.track_id = 0
self.radar_ts = CP.radarTimeStep
if CP.carFingerprint in TSS2_CAR: if CP.carFingerprint in TSS2_CAR:
self.RADAR_A_MSGS = list(range(0x180, 0x190)) self.RADAR_A_MSGS = list(range(0x180, 0x190))