mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-06-25 18:32:06 +08:00
dynamic outputs toggle
This commit is contained in:
@@ -150,6 +150,7 @@ inline static std::unordered_map<std::string, uint32_t> keys = {
|
||||
{"MadsUnifiedEngagementMode", PERSISTENT | BACKUP},
|
||||
|
||||
// Model Manager params
|
||||
{"DynamicModeldOutputs", PERSISTENT | BACKUP},
|
||||
{"ModelManager_ActiveBundle", PERSISTENT},
|
||||
{"ModelManager_DownloadIndex", CLEAR_ON_MANAGER_START | CLEAR_ON_ONROAD_TRANSITION},
|
||||
{"ModelManager_LastSyncTime", CLEAR_ON_MANAGER_START | CLEAR_ON_OFFROAD_TRANSITION},
|
||||
|
||||
@@ -89,6 +89,14 @@ ModelsPanel::ModelsPanel(QWidget *parent) : QWidget(parent) {
|
||||
|
||||
list->addItem(horizontal_line());
|
||||
|
||||
// Dynamic Modeld Outputs toggle
|
||||
dynamicModeldOutputs = new ParamControlSP("DynamicModeldOutputs", tr("Allow Dynamic Model Outputs"),
|
||||
tr("Enable this to allow potentially smoother Gas and Brake controls on all models produced "
|
||||
"after September, 2024."),
|
||||
"../assets/offroad/icon_shell.png");
|
||||
dynamicModeldOutputs->showDescription();
|
||||
list->addItem(dynamicModeldOutputs);
|
||||
|
||||
// LiveDelay toggle
|
||||
lagd_toggle_control = new ParamControlSP("LagdToggle", tr("Live Learning Steer Delay"), "", "../assets/offroad/icon_shell.png");
|
||||
lagd_toggle_control->showDescription();
|
||||
@@ -304,6 +312,7 @@ void ModelsPanel::updateLabels() {
|
||||
handleBundleDownloadProgress();
|
||||
currentModelLblBtn->setEnabled(!is_onroad && !isDownloading());
|
||||
currentModelLblBtn->setValue(GetActiveModelInternalName());
|
||||
dynamicModeldOutputs->showDescription();
|
||||
|
||||
// Update lagdToggle description with current value
|
||||
QString desc = tr("Enable this for the car to learn and adapt its steering response time. "
|
||||
|
||||
@@ -64,6 +64,7 @@ private:
|
||||
bool is_onroad = false;
|
||||
|
||||
ButtonControlSP *currentModelLblBtn;
|
||||
ParamControlSP *dynamicModeldOutputs;
|
||||
ParamControlSP *lagd_toggle_control;
|
||||
OptionControlSP *delay_control;
|
||||
QProgressBar *supercomboProgressBar;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import numpy as np
|
||||
from openpilot.common.params import Params
|
||||
from openpilot.sunnypilot.models.split_model_constants import SplitModelConstants
|
||||
from openpilot.sunnypilot.models.helpers import get_active_bundle
|
||||
|
||||
@@ -25,6 +26,7 @@ def softmax(x, axis=-1):
|
||||
class Parser:
|
||||
def __init__(self, ignore_missing=False):
|
||||
self.ignore_missing = ignore_missing
|
||||
self._params = Params()
|
||||
model_bundle = get_active_bundle()
|
||||
self.generation = model_bundle.generation if model_bundle is not None else None
|
||||
|
||||
@@ -92,7 +94,7 @@ class Parser:
|
||||
outs[name + '_stds'] = pred_std_final.reshape(final_shape)
|
||||
|
||||
def parse_dynamic_outputs(self, outs: dict[str, np.ndarray]) -> None:
|
||||
if self.generation >= 12:
|
||||
if self._params.get_bool("DynamicModeldOutputs") or (self.generation >= 12):
|
||||
if 'lead' in outs:
|
||||
if outs['lead'].shape[1] == 2 * SplitModelConstants.LEAD_MHP_SELECTION *SplitModelConstants.LEAD_TRAJ_LEN * SplitModelConstants.LEAD_WIDTH:
|
||||
self.parse_mdn('lead', outs, in_N=0, out_N=0,
|
||||
|
||||
@@ -55,6 +55,7 @@ def manager_init() -> None:
|
||||
("CustomAccShortPressIncrement", "1"),
|
||||
("DeviceBootMode", "0"),
|
||||
("DynamicExperimentalControl", "0"),
|
||||
("DynamicModeldOutputs", "0"),
|
||||
("HyundaiLongitudinalTuning", "0"),
|
||||
("InteractivityTimeout", "0"),
|
||||
("LagdToggle", "1"),
|
||||
|
||||
Reference in New Issue
Block a user