From 5667a9d9947d5b26aae98a4fa370a6fc94dd78dd Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Mon, 19 May 2025 10:52:47 -0400 Subject: [PATCH] just rivian --- opendbc_repo | 2 +- .../qt/offroad/settings/lateral/mads_settings.h | 2 +- sunnypilot/mads/helpers.py | 13 +++++++++---- sunnypilot/mads/mads.py | 2 +- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/opendbc_repo b/opendbc_repo index 3c7b3e16db..6e56eb028a 160000 --- a/opendbc_repo +++ b/opendbc_repo @@ -1 +1 @@ -Subproject commit 3c7b3e16db3ff4f2150f1436e967f4a9646d4813 +Subproject commit 6e56eb028aca9b83b8de6483723198c22e88ba70 diff --git a/selfdrive/ui/sunnypilot/qt/offroad/settings/lateral/mads_settings.h b/selfdrive/ui/sunnypilot/qt/offroad/settings/lateral/mads_settings.h index 804b978c96..33a68bdf1a 100644 --- a/selfdrive/ui/sunnypilot/qt/offroad/settings/lateral/mads_settings.h +++ b/selfdrive/ui/sunnypilot/qt/offroad/settings/lateral/mads_settings.h @@ -12,7 +12,7 @@ #include "selfdrive/ui/sunnypilot/qt/offroad/settings/settings.h" #include "selfdrive/ui/sunnypilot/qt/widgets/controls.h" -const std::vector mads_limited_settings_brands = {"rivian", "tesla"}; +const std::vector mads_limited_settings_brands = {"rivian"}; enum class MadsSteeringMode { REMAIN_ACTIVE = 0, diff --git a/sunnypilot/mads/helpers.py b/sunnypilot/mads/helpers.py index 819b5af163..dd1390d56a 100644 --- a/sunnypilot/mads/helpers.py +++ b/sunnypilot/mads/helpers.py @@ -18,7 +18,7 @@ class MadsSteeringModeOnBrake: def read_steering_mode_param(CP: structs.CarParams, params: Params): - if CP.brand in ("rivian", "tesla"): + if CP.brand in ("rivian", ): return MadsSteeringModeOnBrake.DISENGAGE try: @@ -49,9 +49,14 @@ 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 Rivian/Tesla due to lack of consistent states to engage controls - # TODO-SP: To enable MADS for Rivian/Tesla, identify consistent signals for MADS toggling - if CP.brand in ("rivian", "tesla"): + # 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 in ("rivian", ): 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") diff --git a/sunnypilot/mads/mads.py b/sunnypilot/mads/mads.py index faf59b827b..2fff01b555 100644 --- a/sunnypilot/mads/mads.py +++ b/sunnypilot/mads/mads.py @@ -45,7 +45,7 @@ class ModularAssistiveDrivingSystem: if self.CP.flags & (HyundaiFlags.HAS_LDA_BUTTON | HyundaiFlags.CANFD): self.allow_always = True - if self.selfdrive.CP.brand in ("rivian", "tesla"): + if self.selfdrive.CP.brand in ("rivian", ): self.no_main_cruise = True # read params on init