no tesla or rivian yet

This commit is contained in:
Jason Wen
2025-05-16 15:46:21 -04:00
parent f3f6626dc8
commit 89b4ac76ab
2 changed files with 10 additions and 21 deletions
+8 -15
View File
@@ -18,9 +18,6 @@ class MadsSteeringModeOnBrake:
def read_steering_mode_param(CP: structs.CarParams, params: Params):
if CP.brand in ("rivian", "tesla"):
return MadsSteeringModeOnBrake.DISENGAGE
try:
return int(params.get("MadsSteeringMode"))
except (ValueError, TypeError):
@@ -49,16 +46,12 @@ def set_car_specific_params(CP: structs.CarParams, CP_SP: structs.CarParamsSP, p
CP_SP.flags |= HyundaiFlagsSP.LONGITUDINAL_MAIN_CRUISE_TOGGLEABLE.value
CP_SP.safetyParam |= HyundaiSafetyFlagsSP.LONG_MAIN_CRUISE_TOGGLEABLE
# MADS is currently not supported in Tesla due to lack of consistent states to engage controls
# TODO-SP: To enable MADS for Tesla, identify consistent signals for MADS toggling
if CP.brand == "tesla":
params.put("MadsSteeringMode", "2")
params.put_bool("MadsUnifiedEngagementMode", True)
params.remove("MadsMainCruiseAllowed")
# MADS is currently not supported in Tesla due to lack of consistent states to engage controls
# TODO-SP: To enable MADS for Tesla, identify consistent signals for MADS toggling
if CP.brand == "tesla":
params.remove("Mads")
# MADS is currently not supported in Rivian due to lack of consistent states to engage controls
# TODO-SP: To enable MADS for Rivian, identify consistent signals for MADS toggling
if CP.brand == "rivian":
params.put("MadsSteeringMode", "2")
params.put_bool("MadsUnifiedEngagementMode", True)
params.remove("MadsMainCruiseAllowed")
# MADS is currently not supported in Rivian due to lack of consistent states to engage controls
# TODO-SP: To enable MADS for Rivian, identify consistent signals for MADS toggling
if CP.brand == "rivian":
params.remove("Mads")
+2 -6
View File
@@ -31,7 +31,6 @@ class ModularAssistiveDrivingSystem:
self.active = False
self.available = False
self.allow_always = False
self.no_main_cruise = False
self.selfdrive = selfdrive
self.selfdrive.enabled_prev = False
self.state_machine = StateMachine(self)
@@ -42,17 +41,14 @@ class ModularAssistiveDrivingSystem:
if self.selfdrive.CP.flags & (HyundaiFlags.HAS_LDA_BUTTON | HyundaiFlags.CANFD):
self.allow_always = True
if self.selfdrive.CP.brand in ("rivian", "tesla"):
self.no_main_cruise = True
# read params on init
self.enabled_toggle = self.params.get_bool("Mads")
self.main_enabled_toggle = self.params.get_bool("MadsMainCruiseAllowed") and not self.no_main_cruise
self.main_enabled_toggle = self.params.get_bool("MadsMainCruiseAllowed")
self.steering_mode_on_brake = read_steering_mode_param(self.selfdrive.CP, self.params)
self.unified_engagement_mode = self.params.get_bool("MadsUnifiedEngagementMode")
def read_params(self):
self.main_enabled_toggle = self.params.get_bool("MadsMainCruiseAllowed") and not self.no_main_cruise
self.main_enabled_toggle = self.params.get_bool("MadsMainCruiseAllowed")
self.unified_engagement_mode = self.params.get_bool("MadsUnifiedEngagementMode")
def update_events(self, CS: structs.CarState):