Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate radarTimeStep #1407

Merged
merged 3 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion opendbc/car/car.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,6 @@ struct CarParams {
transmissionType @43 :TransmissionType;
carFw @44 :List(CarFw);

radarTimeStep @45: Float32 = 0.05; # time delta between radar updates, 20Hz is very standard
radarDelay @74 :Float32;
fingerprintSource @49: FingerprintSource;
networkLocation @50 :NetworkLocation; # Where Panda/C2 is integrated into the car's CAN network
Expand Down Expand Up @@ -719,4 +718,5 @@ struct CarParams {
maxSteeringAngleDegDEPRECATED @54 :Float32;
longitudinalActuatorDelayLowerBoundDEPRECATED @61 :Float32;
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
}
5 changes: 1 addition & 4 deletions opendbc/car/ford/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 DBC, Ecu, FordFlags, RADAR
from opendbc.car.ford.values import Ecu, FordFlags
from opendbc.car.interfaces import CarInterfaceBase

TransmissionType = structs.CarParams.TransmissionType
Expand All @@ -15,9 +15,6 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experime
ret.dashcamOnly = bool(ret.flags & FordFlags.CANFD)

ret.radarUnavailable = True
if DBC[candidate]['radar'] == RADAR.DELPHI_MRR:
ret.radarTimeStep = 0.03 # 33.3 Hz

ret.steerControlType = structs.CarParams.SteerControlType.angle
ret.steerActuatorDelay = 0.2
ret.steerLimitTimer = 1.0
Expand Down
1 change: 0 additions & 1 deletion opendbc/car/gm/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experime
ret.steerActuatorDelay = 0.1 # Default delay, not measured yet

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

if candidate == CAR.CHEVROLET_VOLT:
Expand Down
1 change: 0 additions & 1 deletion opendbc/car/gm/radar_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ def __init__(self, CP):

self.trigger_msg = LAST_RADAR_MSG
self.updated_messages = set()
self.radar_ts = CP.radarTimeStep

def update(self, can_strings):
if self.rcp is None:
Expand Down
1 change: 0 additions & 1 deletion opendbc/car/honda/radar_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ def __init__(self, CP):
self.radar_fault = False
self.radar_wrong_config = False
self.radar_off_can = CP.radarUnavailable
self.radar_ts = CP.radarTimeStep

# Nidec
if self.radar_off_can:
Expand Down
3 changes: 1 addition & 2 deletions opendbc/car/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,12 +259,11 @@ def __init__(self, CP: structs.CarParams):
self.CP = CP
self.rcp = None
self.pts: dict[int, structs.RadarData.RadarPoint] = {}
self.radar_ts = CP.radarTimeStep
self.frame = 0

def update(self, can_packets: list[tuple[int, list[CanData]]]) -> structs.RadarDataT | None:
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 None

Expand Down
1 change: 0 additions & 1 deletion opendbc/car/toyota/radar_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class RadarInterface(RadarInterfaceBase):
def __init__(self, CP):
super().__init__(CP)
self.track_id = 0
self.radar_ts = CP.radarTimeStep

if CP.carFingerprint in TSS2_CAR:
self.RADAR_A_MSGS = list(range(0x180, 0x190))
Expand Down
Loading