From 634ba8f6b203d7fac6e48f02bc33596f885db2bc Mon Sep 17 00:00:00 2001 From: rav4kumar <36933347+rav4kumar@users.noreply.github.com> Date: Wed, 10 Jun 2026 11:27:32 -0700 Subject: [PATCH] sl params --- selfdrive/ui/layouts/settings/toggles.py | 10 ++++++ sunnypilot/sunnylink/params_metadata.json | 32 +++++++++++++------ sunnypilot/sunnylink/settings_ui.json | 20 ++++++++++++ .../settings_ui_src/pages/cruise.yaml | 9 ++++++ 4 files changed, 61 insertions(+), 10 deletions(-) diff --git a/selfdrive/ui/layouts/settings/toggles.py b/selfdrive/ui/layouts/settings/toggles.py index 79cbeb91ee..af016a4287 100644 --- a/selfdrive/ui/layouts/settings/toggles.py +++ b/selfdrive/ui/layouts/settings/toggles.py @@ -36,6 +36,10 @@ DESCRIPTIONS = { "Eco accelerates gently and brakes early and soft; Sport accelerates briskly. " + "Hard-braking authority is always preserved." ), + "RadarDistance": tr_noop( + "Hold a lead through brief radar flicker/dropout so sunnypilot does not lose and re-grab it, " + + "smoothing the hard/late brakes that radar drop-outs cause. Braking is never reduced below stock." + ), "AlwaysOnDM": tr_noop("Enable driver monitoring even when sunnypilot is not engaged."), 'RecordFront': tr_noop("Upload data from the driver facing camera and help improve the driver monitoring algorithm."), "IsMetric": tr_noop("Display speed in km/h instead of mph."), @@ -69,6 +73,12 @@ class TogglesLayout(Widget): "disengage_on_accelerator.png", False, ), + "RadarDistance": ( + lambda: tr("Radar Distance"), + DESCRIPTIONS["RadarDistance"], + "speed_limit.png", + False, + ), "IsLdwEnabled": ( lambda: tr("Enable Lane Departure Warnings"), DESCRIPTIONS["IsLdwEnabled"], diff --git a/sunnypilot/sunnylink/params_metadata.json b/sunnypilot/sunnylink/params_metadata.json index 1e95fd91aa..639ee74127 100644 --- a/sunnypilot/sunnylink/params_metadata.json +++ b/sunnypilot/sunnylink/params_metadata.json @@ -1,4 +1,12 @@ { + "AccelPersonality": { + "title": "Acceleration Profile", + "description": "Eco accelerates gently and brakes early and soft; Sport accelerates briskly. Hard-braking authority is always preserved." + }, + "AccelPersonalityEnabled": { + "title": "Enable Acceleration Profiles", + "description": "Enable Eco/Normal/Sport acceleration profiles, including early soft braking." + }, "AccessToken": { "title": "AccessTokenIsNice", "description": "" @@ -1098,6 +1106,10 @@ "title": "Quiet Mode", "description": "" }, + "RadarDistance": { + "title": "Radar Distance", + "description": "Holds a lead through brief radar flicker/dropout so sunnypilot does not lose and re-grab it, smoothing the hard/late brakes that radar drop-outs cause. Braking is never reduced below stock." + }, "RainbowMode": { "title": "Rainbow Mode", "description": "" @@ -1328,19 +1340,11 @@ "step": 0.1, "unit": "m/s\u00b2" }, - "ToyotaAutoHold": { + "ToyotaAutoHold": { "title": "Toyota: Auto Brake Hold FOR TSS2 HYBRID CARS", "description": "" }, - "ToyotaEnhancedBsm": { - "title": "Toyota: Prius TSS2 BSM and some tssp", - "description": "" - }, - "ToyotaTSS2Long": { - "title": "Toyota: custom longitudinal for TSS2", - "description": "" - }, - "ToyotaDriveMode": { + "ToyotaDriveMode": { "title": "Enable drive mode btn link", "description": "" }, @@ -1348,10 +1352,18 @@ "title": "Toyota: Enforce Factory Longitudinal Control", "description": "When enabled, sunnypilot will not take over control of gas and brakes. Factory Toyota longitudinal control will be used." }, + "ToyotaEnhancedBsm": { + "title": "Toyota: Prius TSS2 BSM and some tssp", + "description": "" + }, "ToyotaStopAndGoHack": { "title": "Toyota: Stop and Go Hack (Alpha)", "description": "sunnypilot will allow some Toyota/Lexus cars to auto resume during stop and go traffic. This feature is only applicable to certain models that are able to use longitudinal control. This is an alpha feature. Use at your own risk." }, + "ToyotaTSS2Long": { + "title": "Toyota: custom longitudinal for TSS2", + "description": "" + }, "TrainingVersion": { "title": "Training Version", "description": "" diff --git a/sunnypilot/sunnylink/settings_ui.json b/sunnypilot/sunnylink/settings_ui.json index f5e30239c7..3b2716515c 100644 --- a/sunnypilot/sunnylink/settings_ui.json +++ b/sunnypilot/sunnylink/settings_ui.json @@ -587,6 +587,26 @@ } ] }, + { + "key": "RadarDistance", + "widget": "toggle", + "title": "Radar Distance", + "description": "Holds a lead through brief radar flicker/dropout so sunnypilot does not lose and re-grab it, smoothing the hard/late brakes that radar drop-outs cause. Braking is never reduced below stock.", + "visibility": [ + { + "type": "capability", + "field": "has_longitudinal_control", + "equals": true + } + ], + "enablement": [ + { + "type": "capability", + "field": "has_longitudinal_control", + "equals": true + } + ] + }, { "key": "DisengageOnAccelerator", "widget": "toggle", diff --git a/sunnypilot/sunnylink/settings_ui_src/pages/cruise.yaml b/sunnypilot/sunnylink/settings_ui_src/pages/cruise.yaml index 78f029b4a5..6e7698d929 100644 --- a/sunnypilot/sunnylink/settings_ui_src/pages/cruise.yaml +++ b/sunnypilot/sunnylink/settings_ui_src/pages/cruise.yaml @@ -24,6 +24,15 @@ sections: - $ref: '#/macros/longitudinal' enablement: - $ref: '#/macros/longitudinal' + - key: RadarDistance + widget: toggle + title: Radar Distance + description: Holds a lead through brief radar flicker/dropout so sunnypilot does not lose and re-grab + it, smoothing the hard/late brakes that radar drop-outs cause. Braking is never reduced below stock. + visibility: + - $ref: '#/macros/longitudinal' + enablement: + - $ref: '#/macros/longitudinal' - key: DisengageOnAccelerator widget: toggle title: Disengage Cruise on Accelerator Pedal