diff --git a/selfdrive/common/params.cc b/selfdrive/common/params.cc index 54c937f25..99b0299b6 100644 --- a/selfdrive/common/params.cc +++ b/selfdrive/common/params.cc @@ -135,6 +135,7 @@ std::unordered_map keys = { {"ControlsReady", CLEAR_ON_MANAGER_START | CLEAR_ON_PANDA_DISCONNECT | CLEAR_ON_IGNITION_ON}, {"CurrentRoute", CLEAR_ON_MANAGER_START | CLEAR_ON_IGNITION_ON}, {"DisablePowerDown", PERSISTENT}, + {"DisableRadar_Allow", PERSISTENT}, {"DisableRadar", PERSISTENT}, // WARNING: THIS DISABLES AEB {"DisableUpdates", PERSISTENT}, {"DongleId", PERSISTENT}, diff --git a/selfdrive/manager/manager.py b/selfdrive/manager/manager.py index bcbd74f99..49c223a9e 100755 --- a/selfdrive/manager/manager.py +++ b/selfdrive/manager/manager.py @@ -43,6 +43,9 @@ def manager_init(): if params.get_bool("RecordFrontLock"): params.put_bool("RecordFront", True) + if not params.get_bool("DisableRadar_Allow"): + params.delete("DisableRadar") + # set unset params for k, v in default_params: if params.get(k) is None: diff --git a/selfdrive/ui/qt/offroad/settings.cc b/selfdrive/ui/qt/offroad/settings.cc index 1a5d82331..b64c6526e 100644 --- a/selfdrive/ui/qt/offroad/settings.cc +++ b/selfdrive/ui/qt/offroad/settings.cc @@ -26,6 +26,7 @@ #include "selfdrive/ui/qt/qt_window.h" TogglesPanel::TogglesPanel(QWidget *parent) : ListWidget(parent) { + auto params = Params(); addItem(new ParamControl("OpenpilotEnabledToggle", "Enable openpilot", "Use the openpilot system for adaptive cruise control and lane keep driver assistance. Your attention is required at all times to use this feature. Changing this setting takes effect when the car is powered off.", @@ -69,7 +70,6 @@ TogglesPanel::TogglesPanel(QWidget *parent) : ListWidget(parent) { "In this mode openpilot will ignore lanelines and just drive how it thinks a human would.", "../assets/offroad/icon_road.png", this)); - #ifdef ENABLE_MAPS addItem(new ParamControl("NavSettingTime24h", "Show ETA in 24h format", @@ -77,8 +77,16 @@ TogglesPanel::TogglesPanel(QWidget *parent) : ListWidget(parent) { "../assets/offroad/icon_metric.png", this)); #endif + if (params.getBool("DisableRadar_Allow")) { + addItem(new ParamControl("DisableRadar", + "openpilot Longitudinal Control", + "openpilot will disable the car's radar and will take over control of gas and brakes. Warnning: this disables AEB!", + "../assets/offroad/icon_speed_limit.png", + this)); + + } - bool record_lock = Params().getBool("RecordFrontLock"); + bool record_lock = params.getBool("RecordFrontLock"); record_toggle->setEnabled(!record_lock); }