diff --git a/sunnypilot/mads/helpers.py b/sunnypilot/mads/helpers.py index 95f39bf43a..42a76589c3 100644 --- a/sunnypilot/mads/helpers.py +++ b/sunnypilot/mads/helpers.py @@ -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") diff --git a/sunnypilot/mads/mads.py b/sunnypilot/mads/mads.py index 0c52e3dc23..0e0dde3225 100644 --- a/sunnypilot/mads/mads.py +++ b/sunnypilot/mads/mads.py @@ -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):