Compare commits

...

11 Commits

Author SHA1 Message Date
Jason Wen d5262f1785 Merge remote-tracking branch 'sunnypilot/sunnypilot/master' into honda-nidec-stock-long
# Conflicts:
#	opendbc_repo
2026-02-19 23:28:36 -05:00
Jason Wen 25bea8e9e3 don't need 2026-02-19 23:28:09 -05:00
Jason Wen 71372410c3 bosch only pls, need to allow force cancel for nidec now 2026-02-16 00:52:07 -05:00
Jason Wen ddb2dc9d0c should apply when the param was initialized 2026-02-15 16:21:34 -05:00
Jason Wen bcec06810c Merge branch 'master' into honda-nidec-stock-long 2026-02-15 01:10:06 -05:00
Jason Wen 00c0b24fb0 well ofc it didn't work 2026-02-15 00:16:42 -05:00
Jason Wen 0211f1adac misra 2026-02-13 21:18:03 -05:00
Jason Wen 10bf1c4d2c c3x toggle it 2026-02-13 21:07:18 -05:00
Jason Wen 6f91271ca7 link it 2026-02-13 21:05:34 -05:00
Jason Wen cb742e3cbd bump 2026-02-13 21:02:41 -05:00
Jason Wen d5b7d79c79 init 2026-02-13 20:45:23 -05:00
5 changed files with 52 additions and 1 deletions
+1
View File
@@ -213,6 +213,7 @@ inline static std::unordered_map<std::string, ParamKeyAttributes> keys = {
{"BackupManager_RestoreVersion", {PERSISTENT, STRING}},
// sunnypilot car specific params
{"HondaEnforceStockLongitudinal", {PERSISTENT | BACKUP, BOOL, "0"}},
{"HyundaiLongitudinalTuning", {PERSISTENT | BACKUP, INT, "0"}},
{"SubaruStopAndGo", {PERSISTENT | BACKUP, BOOL, "0"}},
{"SubaruStopAndGoManualParkingBrake", {PERSISTENT | BACKUP, BOOL, "0"}},
@@ -5,11 +5,52 @@ This file is part of sunnypilot and is licensed under the MIT License.
See the LICENSE.md file in the root directory for more details.
"""
from openpilot.selfdrive.ui.sunnypilot.layouts.settings.vehicle.brands.base import BrandSettings
from openpilot.selfdrive.ui.ui_state import ui_state
from openpilot.system.ui.lib.application import gui_app
from openpilot.system.ui.lib.multilang import tr, tr_noop
from openpilot.system.ui.widgets import DialogResult
from openpilot.system.ui.widgets.confirm_dialog import ConfirmDialog
from openpilot.system.ui.sunnypilot.widgets.list_view import toggle_item_sp
DESCRIPTIONS = {
'enforce_stock_longitudinal': tr_noop(
'sunnypilot will not take over control of gas and brakes. Factory Honda Nidec longitudinal control will be used.'
),
}
class HondaSettings(BrandSettings):
def __init__(self):
super().__init__()
self.enforce_stock_longitudinal = toggle_item_sp(
lambda: tr("Nidec: Enforce Factory Longitudinal Control"),
description=lambda: tr(DESCRIPTIONS["enforce_stock_longitudinal"]),
initial_state=ui_state.params.get_bool("HondaEnforceStockLongitudinal"),
callback=self._on_enable_enforce_stock_longitudinal,
enabled=lambda: not ui_state.engaged,
)
self.items = [self.enforce_stock_longitudinal, ]
def _on_enable_enforce_stock_longitudinal(self, state: bool):
if state:
def confirm_callback(result: int):
if result == DialogResult.CONFIRM:
ui_state.params.put_bool("HondaEnforceStockLongitudinal", True)
ui_state.params.put_bool("OnroadCycleRequested", True)
else:
self.enforce_stock_longitudinal.action_item.set_state(False)
content = (f"<h1>{self.enforce_stock_longitudinal.title}</h1><br>" +
f"<p>{self.enforce_stock_longitudinal.description}</p>")
dlg = ConfirmDialog(content, tr("Enable"), rich=True)
gui_app.set_modal_overlay(dlg, callback=confirm_callback)
else:
ui_state.params.put_bool("HondaEnforceStockLongitudinal", False)
ui_state.params.put_bool("OnroadCycleRequested", True)
def update_settings(self):
pass
+5
View File
@@ -112,6 +112,11 @@ def setup_interfaces(CI: CarInterfaceBase, params: Params = None) -> None:
def initialize_params(params) -> list[dict[str, Any]]:
keys: list = []
# honda
keys.extend([
"HondaEnforceStockLongitudinal",
])
# hyundai
keys.extend([
"HyundaiLongitudinalTuning",
@@ -374,6 +374,10 @@
"title": "[TIZI/TICI only] Speedometer: Hide from Onroad Screen",
"description": "When enabled, the speedometer on the onroad screen is not displayed."
},
"HondaEnforceStockLongitudinal": {
"title": "Honda Nidec: Enforce Factory Longitudinal Control",
"description": "When enabled, sunnypilot will not take over control of gas and brakes. Factory Honda Nidec longitudinal control will be used."
},
"HyundaiLongitudinalTuning": {
"title": "Hyundai Longitudinal Tuning",
"description": "",