mochi mochi mochi

This commit is contained in:
firestar5683
2026-06-06 17:49:41 -05:00
parent c76b770807
commit f20b1f2a4f
12 changed files with 192 additions and 15 deletions
@@ -3219,6 +3219,13 @@
"description": "Only enable this if the wide camera is broken or for development!\n\nDisabling the wide camera may degrade driving performance and cause instability.\n\nRequires a reboot to take effect.",
"data_type": "bool",
"ui_type": "toggle"
},
{
"key": "AllowImpossibleAcceleration",
"label": "Allow Impossible Acceleration",
"description": "WARNING: This suppresses openpilot's excessive longitudinal actuation diagnostic when measured acceleration looks impossible for the requested gas/brake command.\n\nLeave this OFF unless you are intentionally testing edge cases like shifting to neutral and understand that it can hide a real actuation problem.",
"data_type": "bool",
"ui_type": "toggle"
}
]
}
+36
View File
@@ -2255,6 +2255,30 @@ def _serialize_param_write_value(raw_value):
return raw_value.decode("utf-8", errors="replace")
return str(raw_value or "")
def _offroad_excessive_actuation_type():
alert = _safe_params_get_live_raw("Offroad_ExcessiveActuation")
if not alert:
return ""
if isinstance(alert, bytes):
try:
alert = json.loads(alert.decode("utf-8", errors="replace"))
except json.JSONDecodeError:
return ""
elif isinstance(alert, str):
try:
alert = json.loads(alert)
except json.JSONDecodeError:
return ""
if not isinstance(alert, dict):
return ""
extra = alert.get("extra", "")
if isinstance(extra, bytes):
extra = extra.decode("utf-8", errors="replace")
return str(extra).strip().lower()
def _apply_cellular_metered_setting(metered_enabled):
"""Apply GsmMetered changes to active NetworkManager GSM profiles."""
if not shutil.which("nmcli"):
@@ -3742,6 +3766,18 @@ def setup(app):
if key == "AutomaticUpdates" and params.get_bool("IsOnroad"):
return jsonify({"error": "Cannot change Automatic Updates while driving."}), 403
if key == "AllowImpossibleAcceleration":
enabled = str_val.strip() in ("1", "true", "True")
params.put_bool(key, enabled)
if enabled and _offroad_excessive_actuation_type() == "longitudinal":
params.remove("Offroad_ExcessiveActuation")
update_starpilot_toggles()
return jsonify({
"message": f"Parameter '{key}' updated successfully.",
"updated": {key: enabled},
}), 200
if key in {"EVTuning", "TruckTuning"}:
enabled = str_val.strip() in ("1", "true", "True")
params.put_bool(key, enabled)