From abad7649d6395023ebf5443a836d3cc9c9dbfcfb Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Mon, 14 Apr 2025 17:17:59 -0700 Subject: [PATCH] Rename experimental long (#35011) * now alpha long * fix * rename param * thought i did this * debug * debug * more * more * moar * Revert "moar" This reverts commit e347106246583982e1be206485ad4d8eb944f817. * Revert "more" This reverts commit 0746e6d2e400ce1715614c62af84a9680c4d65c1. * Revert "more" This reverts commit 0db5a8792c01bb2d687f9152e6ba37fb76d4a453. * Revert "debug" This reverts commit 72f235b13727980e4331ff487998ddc7c7f7fb63. * Revert "debug" This reverts commit 7871b69f8c1bdffed386c2baac99542fcc50f7eb. --- common/params_keys.h | 2 +- opendbc_repo | 2 +- selfdrive/car/card.py | 4 ++-- selfdrive/car/tests/test_car_interfaces.py | 2 +- selfdrive/car/tests/test_models.py | 10 +++++----- selfdrive/debug/set_car_params.py | 2 +- selfdrive/selfdrived/selfdrived.py | 4 ++-- selfdrive/test/process_replay/process_replay.py | 4 ++-- selfdrive/ui/qt/offroad/developer_panel.cc | 8 ++++---- selfdrive/ui/qt/offroad/settings.cc | 2 +- selfdrive/ui/qt/util.cc | 4 ++-- selfdrive/ui/tests/test_ui/run.py | 2 +- tools/sim/bridge/common.py | 2 +- 13 files changed, 24 insertions(+), 24 deletions(-) diff --git a/common/params_keys.h b/common/params_keys.h index e63079235..ca779a5b5 100644 --- a/common/params_keys.h +++ b/common/params_keys.h @@ -34,7 +34,7 @@ inline static std::unordered_map keys = { {"DoReboot", CLEAR_ON_MANAGER_START}, {"DoShutdown", CLEAR_ON_MANAGER_START}, {"DoUninstall", CLEAR_ON_MANAGER_START}, - {"ExperimentalLongitudinalEnabled", PERSISTENT | DEVELOPMENT_ONLY}, + {"AlphaLongitudinalEnabled", PERSISTENT | DEVELOPMENT_ONLY}, {"ExperimentalMode", PERSISTENT}, {"ExperimentalModeConfirmed", PERSISTENT}, {"FirmwareQueryDone", CLEAR_ON_MANAGER_START | CLEAR_ON_ONROAD_TRANSITION}, diff --git a/opendbc_repo b/opendbc_repo index d65fa99e2..3b33a71a2 160000 --- a/opendbc_repo +++ b/opendbc_repo @@ -1 +1 @@ -Subproject commit d65fa99e2aa60a6d98cdfb5acb912665e9e6447e +Subproject commit 3b33a71a2bf08b57dd5b2bf77e26cc376dcd7cc9 diff --git a/selfdrive/car/card.py b/selfdrive/car/card.py index 607f5590c..378543164 100755 --- a/selfdrive/car/card.py +++ b/selfdrive/car/card.py @@ -89,7 +89,7 @@ class Car: if len(can.can) > 0: break - experimental_long_allowed = self.params.get_bool("ExperimentalLongitudinalEnabled") + alpha_long_allowed = self.params.get_bool("AlphaLongitudinalEnabled") num_pandas = len(messaging.recv_one_retry(self.sm.sock['pandaStates']).pandaStates) cached_params = None @@ -98,7 +98,7 @@ class Car: with car.CarParams.from_bytes(cached_params_raw) as _cached_params: cached_params = _cached_params - self.CI = get_car(*self.can_callbacks, obd_callback(self.params), experimental_long_allowed, num_pandas, cached_params) + self.CI = get_car(*self.can_callbacks, obd_callback(self.params), alpha_long_allowed, num_pandas, cached_params) self.RI = interfaces[self.CI.CP.carFingerprint].RadarInterface(self.CI.CP) self.CP = self.CI.CP diff --git a/selfdrive/car/tests/test_car_interfaces.py b/selfdrive/car/tests/test_car_interfaces.py index e0cd5a1e9..92c7ff8f1 100644 --- a/selfdrive/car/tests/test_car_interfaces.py +++ b/selfdrive/car/tests/test_car_interfaces.py @@ -39,7 +39,7 @@ class TestCarInterfaces: args = get_fuzzy_car_interface_args(data.draw) car_params = CarInterface.get_params(car_name, args['fingerprints'], args['car_fw'], - experimental_long=args['experimental_long'], docs=False) + alpha_long=args['alpha_long'], docs=False) car_params = car_params.as_reader() car_interface = CarInterface(car_params) assert car_params diff --git a/selfdrive/car/tests/test_models.py b/selfdrive/car/tests/test_models.py index 906fa9932..53f2bb586 100644 --- a/selfdrive/car/tests/test_models.py +++ b/selfdrive/car/tests/test_models.py @@ -78,7 +78,7 @@ class TestCarModelBase(unittest.TestCase): cls.elm_frame = None cls.car_safety_mode_frame = None cls.fingerprint = gen_empty_fingerprint() - experimental_long = False + alpha_long = False for msg in lr: if msg.which() == "can": can = can_capnp_to_list((msg.as_builder().to_bytes(),))[0] @@ -91,7 +91,7 @@ class TestCarModelBase(unittest.TestCase): elif msg.which() == "carParams": car_fw = msg.carParams.carFw if msg.carParams.openpilotLongitudinalControl: - experimental_long = True + alpha_long = True if cls.platform is None: live_fingerprint = msg.carParams.carFingerprint cls.platform = MIGRATION.get(live_fingerprint, live_fingerprint) @@ -113,7 +113,7 @@ class TestCarModelBase(unittest.TestCase): cls.car_safety_mode_frame = len(can_msgs) assert len(can_msgs) > int(50 / DT_CTRL), "no can data found" - return car_fw, can_msgs, experimental_long + return car_fw, can_msgs, alpha_long @classmethod def get_testing_data(cls): @@ -146,13 +146,13 @@ class TestCarModelBase(unittest.TestCase): raise unittest.SkipTest raise Exception(f"missing test route for {cls.platform}") - car_fw, cls.can_msgs, experimental_long = cls.get_testing_data() + car_fw, cls.can_msgs, alpha_long = cls.get_testing_data() # if relay is expected to be open in the route cls.openpilot_enabled = cls.car_safety_mode_frame is not None cls.CarInterface = interfaces[cls.platform] - cls.CP = cls.CarInterface.get_params(cls.platform, cls.fingerprint, car_fw, experimental_long, docs=False) + cls.CP = cls.CarInterface.get_params(cls.platform, cls.fingerprint, car_fw, alpha_long, docs=False) assert cls.CP assert cls.CP.carFingerprint == cls.platform diff --git a/selfdrive/debug/set_car_params.py b/selfdrive/debug/set_car_params.py index 6060dfbc3..aec30b4d7 100755 --- a/selfdrive/debug/set_car_params.py +++ b/selfdrive/debug/set_car_params.py @@ -15,7 +15,7 @@ if __name__ == "__main__": else: CP = car.CarParams.new_message() CP.openpilotLongitudinalControl = True - CP.experimentalLongitudinalAvailable = False + CP.alphaLongitudinalAvailable = False cp_bytes = CP.to_bytes() for p in ("CarParams", "CarParamsCache", "CarParamsPersistent"): diff --git a/selfdrive/selfdrived/selfdrived.py b/selfdrive/selfdrived/selfdrived.py index c2e825913..face7dab2 100755 --- a/selfdrive/selfdrived/selfdrived.py +++ b/selfdrive/selfdrived/selfdrived.py @@ -89,8 +89,8 @@ class SelfdriveD: car_recognized = self.CP.brand != 'mock' # cleanup old params - if not self.CP.experimentalLongitudinalAvailable: - self.params.remove("ExperimentalLongitudinalEnabled") + if not self.CP.alphaLongitudinalAvailable: + self.params.remove("AlphaLongitudinalEnabled") if not self.CP.openpilotLongitudinalControl: self.params.remove("ExperimentalMode") diff --git a/selfdrive/test/process_replay/process_replay.py b/selfdrive/test/process_replay/process_replay.py index 9715e4861..613984632 100755 --- a/selfdrive/test/process_replay/process_replay.py +++ b/selfdrive/test/process_replay/process_replay.py @@ -363,7 +363,7 @@ def get_car_params_callback(rc, pm, msgs, fingerprint): with car.CarParams.from_bytes(cached_params_raw) as _cached_params: cached_params = _cached_params - CP = get_car(*can_callbacks, lambda obd: None, Params().get_bool("ExperimentalLongitudinalEnabled"), cached_params=cached_params).CP + CP = get_car(*can_callbacks, lambda obd: None, Params().get_bool("AlphaLongitudinalEnabled"), cached_params=cached_params).CP if not params.get_bool("DisengageOnAccelerator"): CP.alternativeExperience |= ALTERNATIVE_EXPERIENCE.DISABLE_DISENGAGE_ON_GAS @@ -777,7 +777,7 @@ def generate_params_config(lr=None, CP=None, fingerprint=None, custom_params=Non params_dict["CarParamsCache"] = CP.as_builder().to_bytes() if CP.openpilotLongitudinalControl: - params_dict["ExperimentalLongitudinalEnabled"] = True + params_dict["AlphaLongitudinalEnabled"] = True if CP.notCar: params_dict["JoystickDebugMode"] = True diff --git a/selfdrive/ui/qt/offroad/developer_panel.cc b/selfdrive/ui/qt/offroad/developer_panel.cc index 365aec09c..a095228da 100644 --- a/selfdrive/ui/qt/offroad/developer_panel.cc +++ b/selfdrive/ui/qt/offroad/developer_panel.cc @@ -26,7 +26,7 @@ DeveloperPanel::DeveloperPanel(SettingsWindow *parent) : ListWidget(parent) { addItem(longManeuverToggle); experimentalLongitudinalToggle = new ParamControl( - "ExperimentalLongitudinalEnabled", + "AlphaLongitudinalEnabled", tr("openpilot Longitudinal Control (Alpha)"), QString("%1

%2") .arg(tr("WARNING: openpilot longitudinal control is in alpha for this car and will disable Automatic Emergency Braking (AEB).")) @@ -68,8 +68,8 @@ void DeveloperPanel::updateToggles(bool _offroad) { capnp::FlatArrayMessageReader cmsg(aligned_buf.align(cp_bytes.data(), cp_bytes.size())); cereal::CarParams::Reader CP = cmsg.getRoot(); - if (!CP.getExperimentalLongitudinalAvailable() || is_release) { - params.remove("ExperimentalLongitudinalEnabled"); + if (!CP.getAlphaLongitudinalAvailable() || is_release) { + params.remove("AlphaLongitudinalEnabled"); experimentalLongitudinalToggle->setEnabled(false); } @@ -78,7 +78,7 @@ void DeveloperPanel::updateToggles(bool _offroad) { * - is not a release branch, and * - the car supports experimental longitudinal control (alpha) */ - experimentalLongitudinalToggle->setVisible(CP.getExperimentalLongitudinalAvailable() && !is_release); + experimentalLongitudinalToggle->setVisible(CP.getAlphaLongitudinalAvailable() && !is_release); longManeuverToggle->setEnabled(hasLongitudinalControl(CP) && _offroad); } else { diff --git a/selfdrive/ui/qt/offroad/settings.cc b/selfdrive/ui/qt/offroad/settings.cc index 4d0516bda..7a79413e2 100644 --- a/selfdrive/ui/qt/offroad/settings.cc +++ b/selfdrive/ui/qt/offroad/settings.cc @@ -152,7 +152,7 @@ void TogglesPanel::updateToggles() { QString long_desc = unavailable + " " + \ tr("openpilot longitudinal control may come in a future update."); - if (CP.getExperimentalLongitudinalAvailable()) { + if (CP.getAlphaLongitudinalAvailable()) { if (is_release) { long_desc = unavailable + " " + tr("An alpha version of openpilot longitudinal control can be tested, along with Experimental mode, on non-release branches."); } else { diff --git a/selfdrive/ui/qt/util.cc b/selfdrive/ui/qt/util.cc index 399a1a98d..ff381fe39 100644 --- a/selfdrive/ui/qt/util.cc +++ b/selfdrive/ui/qt/util.cc @@ -193,8 +193,8 @@ QPixmap bootstrapPixmap(const QString &id) { bool hasLongitudinalControl(const cereal::CarParams::Reader &car_params) { // Using the experimental longitudinal toggle, returns whether longitudinal control // will be active without needing a restart of openpilot - return car_params.getExperimentalLongitudinalAvailable() - ? Params().getBool("ExperimentalLongitudinalEnabled") + return car_params.getAlphaLongitudinalAvailable() + ? Params().getBool("AlphaLongitudinalEnabled") : car_params.getOpenpilotLongitudinalControl(); } diff --git a/selfdrive/ui/tests/test_ui/run.py b/selfdrive/ui/tests/test_ui/run.py index 35323cf00..c830680aa 100755 --- a/selfdrive/ui/tests/test_ui/run.py +++ b/selfdrive/ui/tests/test_ui/run.py @@ -56,7 +56,7 @@ def setup_settings_firehose(click, pm: PubMaster): def setup_settings_developer(click, pm: PubMaster): CP = car.CarParams() - CP.experimentalLongitudinalAvailable = True + CP.alphaLongitudinalAvailable = True Params().put("CarParamsPersistent", CP.to_bytes()) setup_settings_device(click, pm) diff --git a/tools/sim/bridge/common.py b/tools/sim/bridge/common.py index bf3be5193..69dec173c 100644 --- a/tools/sim/bridge/common.py +++ b/tools/sim/bridge/common.py @@ -40,7 +40,7 @@ class SimulatorBridge(ABC): def __init__(self, dual_camera, high_quality): set_params_enabled() self.params = Params() - self.params.put_bool("ExperimentalLongitudinalEnabled", True) + self.params.put_bool("AlphaLongitudinalEnabled", True) self.rk = Ratekeeper(100, None)