Commit Graph

103 Commits

Author SHA1 Message Date
Kumar
3faf709387 ui: Visuals Panel Lead Chevron Info (#1033)
* lead info

* ui:chevron params

* Update system/manager/manager.py.

---------

Co-authored-by: DevTekVE <devtekve@gmail.com>
2025-07-19 15:17:19 +02:00
James Vecellio-Grant
47833ed73a ui: Disable Updates Toggle (#1040)
* Disable Updates

* Add default to manager.py

* Add enabled state and alternate descriptions

---------

Co-authored-by: Nayan <nayan8teen@gmail.com>
Co-authored-by: DevTekVE <devtekve@gmail.com>
2025-07-19 15:01:39 +02:00
Nayan
92f1977666 UI: Custom Interactivity Timeout (#1032)
custom interactivity timeout
2025-07-10 07:30:10 +02:00
James Vecellio-Grant
d0bd8cc4a3 liveDelay: Add live delay toggle to vehicles using torqued (#1001)
* Add live delay toggle to torqued.py and twilsonco NNLC

* Set this in init

* Clean up

* Live delay toggle refactor

* ModeldLagd -> LagdToggle

* This is for lagd_toggle.py

* Add to NNLC

* Lagd toggle:

Display current values on UI

* Add break

* LagdToggleDelay

Live edit software_delay when livedelay is toggled `off`

* Always show description

* Add description as to why values don't update offroad

---------

Co-authored-by: Kumar <36933347+rav4kumar@users.noreply.github.com>
2025-07-05 14:42:36 -07:00
DevTekVE
ea8eaed1aa Merge remote-tracking branch 'comma/master' into sync-20250627
# Conflicts:
#	README.md
#	opendbc_repo
#	panda
#	selfdrive/ui/qt/offroad/settings.cc
#	selfdrive/ui/translations/main_ar.ts
#	selfdrive/ui/translations/main_de.ts
#	selfdrive/ui/translations/main_es.ts
#	selfdrive/ui/translations/main_fr.ts
#	selfdrive/ui/translations/main_ja.ts
#	selfdrive/ui/translations/main_ko.ts
#	selfdrive/ui/translations/main_pt-BR.ts
#	selfdrive/ui/translations/main_th.ts
#	selfdrive/ui/translations/main_tr.ts
#	selfdrive/ui/translations/main_zh-CHS.ts
#	selfdrive/ui/translations/main_zh-CHT.ts
#	system/manager/build.py
#	system/ui/spinner.py
#	tinygrad_repo
#	tools/lib/framereader.py
Merge branch 'comma-202506127-bedcb896644528aed6af448e63eeadb3dd8b2c77' into sync-20250627

# Conflicts:
#	opendbc/safety/tests/libsafety/SConscript
Merge branch 'comma-202506127-bedcb896644528aed6af448e63eeadb3dd8b2c77' into sync-20250627

# Conflicts:
#	opendbc/safety/tests/libsafety/SConscript
Merge remote-tracking branch 'comma/master' into sync-20250627

# Conflicts:
#	opendbc/safety/tests/libsafety/SConscript
Merge branch 'comma-20250627-1020d355584265391eb3acb556e4353b581fa9c0' into sync-20250627
Merge branch 'comma-20250627-1020d355584265391eb3acb556e4353b581fa9c0' into sync-20250627
Sync: `commaai/opendbc:master` into `sunnypilot/opendbc:master-new`

Sync: `commaai/opendbc:master` into `sunnypilot/opendbc:master-new`
Sync: `commaai/panda:master` into `sunnypilot/panda:master-new`

Sync: `commaai/panda:master` into `sunnypilot/panda:master-new`
2025-06-28 21:43:38 +02:00
Shane Smiskol
5e3fc13751 Update TOTAL_SCONS_NODES 2025-06-20 13:46:10 -07:00
Nayan
0cb0bf8028 Longitudinal: Custom ACC setpoint increments support (#889)
* Add Reverse ACC Change parameter and update cruise control logic

* lint lint lint (and lint has been summoned!)

* Add test for speed adjustment on reverse ACC button presses

* Fix formatting in cruise speed test for reverse ACC button presses

* Fix assertion in cruise speed test for reverse ACC button presses

* Enhance speed adjustment test for reverse ACC functionality

* Refactor speed adjustment test for clarity and consistency in reverse ACC behavior

* Fix metric conversion in cruise speed update for reverse ACC functionality

* custom-acc-speed-increments

* simplify

* remove unused params

* move params & add test

* lets see if this works

* minor cosmetic stuff

* clean up class names & old code

* remove unused import

* moved params to card

* stupid strings

* Add settings for developer reverse acceleration configuration

* Refactor cruise control parameters to use a dictionary for custom acceleration increments

* adjust for the default behavior

* Remove unused param

* Fuck pytest consistently failing on macos. Need to force a fail on the pipeline or I won't have confidence on the tests.

* Revert "Fuck pytest consistently failing on macos. Need to force a fail on the pipeline or I won't have confidence on the tests."

This reverts commit 05bac46a0c.

* Refactor custom acceleration increment handling to improve clarity and initialization

* Refactor AccIncrementOptionControl to accept range and per_value_change parameters for improved flexibility

* Refactor custom acceleration increment handling to improve clarity and functionality

* Adjusting tests

* Static

* no need for space changes

* no need for space changes

* no need for space changes

* Refactor constructor formatting in AccIncrementOptionControl

* Rename

* Meaningless change to test CI

* allow 1/5/10 increments for long press
move developer panel src to /offroad/settings

* update boundary condition for long press

* clamp increments of 5/10 regardless of short or long press

* update tests

* update test for long_press non-standard values

* move to cruise panel

* init

* use cereal

* update tests

* merge

* bump

* clean up

* more clean up

* no more layout warnings

* trying to resolve dev ci merge conflicts

* damn ui preview

* stack layout
enable only with oplong

* bump opendbc

* fix width

* bump tinygrad

* switch to params

* remove cereal changes

* sort params

* cleanup

* more cleanup

* lint

* rename

* split vcruise_helper

* move params to card thread
hide widget for pcm cruise

* simplify tests

* further simplify tests

* tests!!

* Revert "tests!!"

This reverts commit 85310a155e.

* move tuple from init to update_v_cruise

* lint

* temp remove tests to check

* Revert "temp remove tests to check"

This reverts commit da1c96a5db.

* handle exception

* formatting

* handle none condition

* remove from tests

* flip inheritance

* read directly

* set default

* not needed

* refactor inheritence

* rename

* already checks before invoking

* unused

* slight cleanup

* lint

* rename

* diff

* circular

* just 1 parent for now

* fix

* fix increment check with remainder

* red diff

* type hint

* update tests

* clip them

* formatting

* always check toggle visibility

* spaces are free

* hide widgets when disabled

* less

* handle more states

* private instead

* red diff says wuuuut

* fix panel click

---------

Co-authored-by: DevTekVE <devtekve@gmail.com>
Co-authored-by: Discountchubbs <159560811+Discountchubbs@users.noreply.github.com>
Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
2025-06-10 22:48:46 -04:00
Nayan
fa4c3a80b6 device: customizable wake-up behavior (start offroad) (#861)
* allow always offroad at boot

* update description

* move buttons down again

* device boot mode

* update description

* offroad on sleep

* update name & description

* cleanup

* update signal name

* Update selfdrive/ui/sunnypilot/qt/offroad/settings/device_panel.cc

---------

Co-authored-by: DevTekVE <devtekve@gmail.com>
Co-authored-by: Kumar <36933347+rav4kumar@users.noreply.github.com>
Co-authored-by: James Vecellio-Grant <159560811+Discountchubbs@users.noreply.github.com>
2025-06-07 14:41:39 +02:00
Jason Wen
ab6d192714 mapd (#989)
* init

* some fixes

* move

* more

* old navd helpers

* bring back cereal

* fix linting

* more

* add to cereal first

* sp events

* lint

* implement in long plan

* fixme-sp

* refactor state machine

* wrong state

* start refactor controller

* some type hints

* init these

* enable debug print

* ui? ui!

* print them out

* fix spinner import

* fix path

* let's use gps chips directly for now

* service missing

* publish events

* no nav for now

* need to sub

* no car state speed yet

* missed event

* Car: `CarStateSP`

* fix tests

* bring back car state speed limit

* fix

* use old controller for now

* fix

* fix source

* type hints

* none for now

* formatting

* more

* create directory if does not exist

* mypy my bt

* policy param catch exceptions

* handle all params with exceptions

* more

* single method

* define types in init

* rename

* simpler op enabled check

* more mypy stuff

* rename

* no need for brake pressed

* don't reset if gas pressed

* type hint all

* type hint all

* back to upstream

* in another pr

* no longer need data type

* qlog

* slc in another pr

* use horizontal accuracy

* set core affinity for all realtime processes

* unused

* sort

* unused

* type hint and slight cleanup

* from old implementation

* use directly

* combine pm

* slight more cleanup

* type hints

* even more type hint

* lint

* more cleanup

* even less

* license
2025-06-07 03:47:09 -04:00
Kumar
1979b00cc0 UI: Visual indicator for blind spot (#834)
* Refactor and extend ModelRenderer for custom Sunnypilot logic

Refactored `ModelRenderer` to `ModelRendererSP` with enhanced features such as lane line updates, path drawing, and lead management for Sunnypilot. Introduced new methods for model updates, lead drawing, and improved path rendering with experimental mode support. Ensured compatibility by integrating with Sunnypilot-specific HUD and camera components.

* Update selfdrive/ui/sunnypilot/qt/onroad/model.cc

* Refactor `ModelRenderer` for modularity

Moved constants and `get_path_length_idx` function to the header file for reuse and clarity. Updated `drawPath` and related methods to better handle surface dimensions, improving rendering flexibility. Made key functions virtual to allow further customization in derived classes.

* Cleaning logic on ModelRenderSP

Given that we've refactored slightly the original ModelRender, we no longer need to duplicate the logic on our own implementation

* Enable blind spot detection and visualization.

Added support for blind spot warnings, including gradient-colored visualizations for left and right blind spots on the on-road UI. Introduced a new "BlindSpot" parameter with related logic for detection and rendering, as well as a settings option for user toggling.

* Cleanup format

Clean

Cleanup and fixes

* Let's backup the BlindSpot setting

* add false for restart-needed

* Add blind spot warning toggle to VisualsPanel

Moved blind spot warning toggle from settings.cc to VisualsPanel and implemented support for dynamic parameter updates. This change introduces a dedicated layout for managing visual settings and improves modularity in the settings interface.

* Update Blind Spot Warnings setting description

Clarified the description to specify that warnings are displayed only if the car supports Blind Spot Monitoring (BSM). This ensures better user understanding of the feature's requirements.

* Avoid diff on settings.cc

* More cleanup

---------

Co-authored-by: DevTekVE <devtekve@gmail.com>
Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
Co-authored-by: Nayan <nayan8teen@gmail.com>
2025-06-06 22:39:26 +02:00
Dean Lee
541bd4d4d9 ui: switch spinner and text window back to standalone process (#35470)
switch spinner and text window back to standalone process
2025-06-06 13:20:05 -07:00
royjr
debba0c9f9 ui: add brightness controls (#974)
* brightness

* better brightness

* cleanup

---------

Co-authored-by: DevTekVE <devtekve@gmail.com>
2025-06-06 21:51:05 +02:00
James Vecellio-Grant
65c512acc0 ui/models panel: liveDelay Toggle (#971)
* Model panel

* Get this outta here and use sunnylink instead

* Remove space

* 'not' because we want gas gating to use e2e/mpc blend

* Add toggles to models_panel.cc

* "keep enabled for stock behavior"

* Add this here

* Cloudlog result

* change cloudlog to debug, and add latsmooth to steer actuator delay.

Need to edit json. Will do locally so when this is merged its a simple ready to go push.

* Cleanup

* Update longitudinal_planner.py

* Remove gasgating for now.. may need to be placed in model

---------

Co-authored-by: DevTekVE <devtekve@gmail.com>
2025-06-06 20:43:10 +02:00
Jason Wen
4d12f880bd Merge branch 'upstream/openpilot/master' into sync-20250605
# Conflicts:
#	opendbc_repo
#	panda
2025-06-05 22:27:18 -04:00
Dean Lee
23ea85dca6 ui: kick watchdog (#35460)
* kick watchdog

* use global

* use monotonic
2025-06-05 13:14:57 -07:00
Andrei Radulescu
3ad74b440c macos: no logcatd and proclogd (#35457)
* don't build proclogd on mac

* don't run logcatd and proclogd on mac
2025-06-05 10:23:27 -07:00
Jason Wen
0c506c868d Controls: Pause lateral control based on blinker state and vehicle speed (#983)
* Controls: Pause lateral control based on blinker state and vehicle speed

* in its own module

* tests

* cleanup tests

* ui

* always refresh on show panel

* remove default

* change to 20 default

* need to update params live

* shorter

* off by default

* lol lint

* use ExpandableToggleRow

* not needed

* shorter

* ci ui preview delay for all offroad

* more

* Revert "more"

This reverts commit 809cfd99da.

* Revert "ci ui preview delay for all offroad"

This reverts commit ab38292fa8.

---------

Co-authored-by: nayan8teen <nayan8teen@gmail.com>
2025-06-05 00:21:58 -04:00
DevTekVE
9e3f33dd16 Merge remote-tracking branch 'comma/master' into sync-20250604
# Conflicts:
#	opendbc_repo
#	panda
#	selfdrive/ui/translations/main_ar.ts
#	selfdrive/ui/translations/main_de.ts
#	selfdrive/ui/translations/main_es.ts
#	selfdrive/ui/translations/main_fr.ts
#	selfdrive/ui/translations/main_ja.ts
#	selfdrive/ui/translations/main_ko.ts
#	selfdrive/ui/translations/main_pt-BR.ts
#	selfdrive/ui/translations/main_th.ts
#	selfdrive/ui/translations/main_tr.ts
#	selfdrive/ui/translations/main_zh-CHS.ts
#	selfdrive/ui/translations/main_zh-CHT.ts
2025-06-04 21:55:32 -04:00
Adeeb Shihadeh
ad58fea2f0 no more pylint (#35418)
* no more pylint

* bump opendbc
2025-06-01 16:34:22 -07:00
DevTekVE
82487ba136 Merge remote-tracking branch 'comma/master' into sync-20250531
# Conflicts:
#	.github/workflows/selfdrive_tests.yaml
#	common/params_keys.h
#	msgq_repo
#	opendbc_repo
#	panda
#	selfdrive/car/card.py
#	selfdrive/car/tests/test_car_interfaces.py
#	selfdrive/car/tests/test_models.py
#	selfdrive/test/process_replay/process_replay.py
#	selfdrive/ui/qt/offroad/settings.cc
#	selfdrive/ui/translations/main_ar.ts
#	selfdrive/ui/translations/main_es.ts
#	selfdrive/ui/translations/main_fr.ts
#	selfdrive/ui/translations/main_ja.ts
#	selfdrive/ui/translations/main_ko.ts
#	selfdrive/ui/translations/main_pt-BR.ts
#	selfdrive/ui/translations/main_th.ts
#	selfdrive/ui/translations/main_tr.ts
#	selfdrive/ui/translations/main_zh-CHS.ts
#	selfdrive/ui/translations/main_zh-CHT.ts
2025-05-31 14:12:30 -04:00
Adeeb Shihadeh
2f80854644 sensord: rewrite in Python (#35353)
* py sensord

* fix up mmc

* temp

* port over accel

* lil more

* kinda works

* rm that

* gpiochip

* mostly there

* lil more

* lil more

* irq timestamps

* fix ts

* fix double deg2rad

* test passes

* fix up mypy

* rm one more

* exception

* lint:

* read in all events

* bump that

* get under budget:

* accel self test

* gyro self-test

* keep these readable

* give it more cores

* debug

* valid

* rewrite that

---------

Co-authored-by: Comma Device <device@comma.ai>
2025-05-30 13:31:07 -07:00
DevTekVE
ff5b587fd1 ui: Bumping the total scons nodes for progress bar (#965)
Bumping the total scons nodes
2025-05-30 13:14:30 +02:00
Jason Wen
ebe56410d3 MADS: Steering Mode on Brake Pedal Press (#924)
* MADS: Steering Mode on Brake Pedal Press

* bump

* bump

* descriptions

* bump

* bump

* no tesla or rivian yet

* codecov v5

* Revert "codecov v5"

This reverts commit a347e3fb27.

* cleanup

* refactor description

* sync name

* fix

* make sure we don't allow if brake was already being pressed

* fix

* diff

* fix description

* in another PR
2025-05-19 01:25:11 -04:00
Jason Wen
bf6123c4ad Reapply "Hyundai: custom longitudinal tuning" (#894)
* Reapply "Hyundai: custom longitudinal tuning" (#892)

This reverts commit 68c593db5f.

* fix panel behavior

* dynamic description

* try to merge and use the same scrollview

* fix for all to update

* dynamic update and fix description

* minimize changes for all brands

* init

* minimize changes for all brands

* more

* even less diff

* more

* even less diff

* more less

* wow srsly

* more less

* wow srsly
2025-05-10 12:58:08 -04:00
Jason Wen
68c593db5f Revert "Hyundai: custom longitudinal tuning" (#892)
* Revert "Hyundai: custom longitudinal tuning (#658)"

This reverts commit 72f09ec9f5.

* bump

* Revert "bump"

This reverts commit a437f3538d.

* bump
2025-05-09 14:53:56 -04:00
Discountchubbs
72f09ec9f5 Hyundai: custom longitudinal tuning (#658)
* Maybe I was asleep but somehow it worked.

* Maybe I was asleep but somehow it worked.

* 70/30 split

* 60/35 split

* 67:33 split

* use Sqrt for tiny values to increase factor. Oh, also add a test file.

* use Sqrt for tiny values to increase factor. Oh, also add a test file.

* use Sqrt for tiny values to increase factor. Oh, also add a test file.

* Raise these to restart tests

* Raise these to restart tests

* Update jerk calculation mimicking j_ego math.

* README.md

* Update timestep

* Fix test

* Readability

* Lower time

* Add higher limits for CANFD

* Send these as a floating object. update comments to add TODO msg.

* Conditional flags

* yes its a little weird but heres why:

` "aReqValue": long_state.accel_value if enabled else a_val`

its only to not have merge conflicts with syncs from this file, because if not enabled a_val is already at 0 anyways.

* Make it easier to read

* Chronological order

* Trigger rebuild

* This is an internal test on my end. Disregard, for now

* fw version for my car...

* remove fw version as that was a test

* bump submodules

* refactor that while passing internal tests

* bump safety mutation test

* all should match 50 Hz

* bump safety mutation test

* match stock behavior for accel

* do our own clipping

* apply upper/lower dynamically

* bump test

* bump test

* Higher lower limit

* move desired accel force zero in tuning controller

* bump

* bump

* abs it here

* fix logic

* make sure it resets to 0, enforced in safety

* Test a few things

* Higher jerk for VOACC

* Elantra specific

* raise `off` to stock

* bump opendbc test

* allow jerk calculations at all times

* bump

* bump

* match aReqVale

* we dont need such high accel jerk when above 20m/s. This is cruise control, not a racecar.

* 0.45 default long actuator delay

* align type hint

* add lower jerk multiplier for HYUNDAI_IONIQ

* Change min jerk

* should be float

* Change min jerk

* Change min jerk upper

* Change max jerk upper

* Change max jerk upper

* Change max jerk upper

* step + threshold + first order filter to smooth

* constants

* nah

* multiplier to 1.5

* step updates for parabolic accel/braking

* step updates for parabolic accel/braking

* even less

* test multiplier

* Merge remote-tracking branch 'sunnypilot/opendbc/master-new' into HKG-long-tune

* back to default delay for now

* update test

* update config

* update test

* update config.py

* update test

* Remove stoppingDecelRate **No need for this anymore**

* multiplier to 1.0

* Variable lower dependency

* Variable lower dependency

* Variable lower jerk minimum

* Variable lower jerk minimum
planned_accel -> desired_acel

* Revert some scaling

* .01 here

* .01 here

* try even smoother stopping

* missed a `tuning` here that instead calls itself to inf.

* what is math

* Red Diff

* Red Diff

* bring some back

* bring some back

* stronger when needed

* something simple

* simplify more

* simplify more

* dont use future

* whoops

* why

* reset

* Refactor longitudinal controller for better jerk handling

Revised `calculate_a_value` and jerk processing logic to improve acceleration and jerk handling, particularly under dynamic conditions. Adjusted test cases to cover the new logic.

* Refactor longitudinal controller for better jerk handling

Revised `calculate_a_value` and jerk processing logic to improve acceleration and jerk handling, particularly under dynamic conditions. Adjusted test cases to cover the new logic.

* Refactor longitudinal controller for better jerk handling

Revised `calculate_a_value` and jerk processing logic to improve acceleration and jerk handling, particularly under dynamic conditions. Adjusted test cases to cover the new logic.

* Adjust lower_jerk interpolation for improved accuracy

* Lowered the acceleration error threshold from -0.01 to -0.001

* Adjust jerk interpolation thresholds for Hyundai tuning.

Updated the interpolation range  for smaller acceleration errors.

* Move it up

* -.03 not -.05

* radarUnavailable = higher limit patch

* Commit the real change

* Updated the interpolation values and logic for lower_jerk to refine acceleration behavior.

* Updated the interpolation values and logic for lower_jerk to refine acceleration behavior.

* Updated the interpolation values and logic for lower_jerk to refine acceleration behavior.

* Updated the interpolation values and logic for lower_jerk to refine acceleration behavior.

* THIS. THIS WILL STOP FOR LEADS

* Higher for VOACC

* Higher for VOACC

* Rename `make_jerk` to `calculate_jerk` in test cases.

* Adjust jerk tuning for Hyundai longitudinal control

Updated the interpolation table for lower jerk values to improve deceleration handling. This adjustment refines control behavior during higher deceleration requests.

* Updated the interpolation breakpoint from -0.03 to -0.025

* Adjust longitudinal control jerk tuning for smoother response

Updated interpolation values in the jerk tuning logic to improve acceleration smoothing in Hyundai longitudinal control. These changes aim to provide a more consistent and predictable driving experience, particularly during deceleration scenarios.

* Handle radar unavailability in longitudinal tuning check

* Introduce `toggleDisableMsg` to streamline determining toggle states and descriptions.

* `sunnypilot`

* `Refactor longitudinal control acceleration and jerk handling`

Removed unused `FirstOrderFilter` and simplified acceleration and jerk calculations for improved clarity and maintainability. Adjusted logic to replace redundant return statements, streamline jerk computation, and reduce unnecessary dependencies.

* `Refactor longitudinal control acceleration and jerk handling`

Removed unused `FirstOrderFilter` and simplified acceleration and jerk calculations for improved clarity and maintainability. Adjusted logic to replace redundant return statements, streamline jerk computation, and reduce unnecessary dependencies.

* Simplify test to be straight to the point.

* Adjust upper_speed_factor and integrate ramp_update logic

* Adjust upper_speed_factor and integrate ramp_update logic

* Adjust upper_speed_factor and integrate ramp_update logic

* Refine acceleration and jerk tuning logic.

* greater than 0

* bump

* bring back ramp update for jerk upper

* Update opendbc_repo

* Revert "Update opendbc_repo"

This reverts commit b790387c90.

* bump

* bump

* bump

* using count seems to work better

* Refine jerk tuning logic and expand test coverage

* bump vals

* fix logic

* Adjust jerk tuning parameters for Hyundai longitudinal control

* retry lfs check

* bump submodule

* Fix acceleration blending and enhance test coverage

* Update lower_jerk breakpoints

* bump

* Adjust lower jerk parameters and include accel_cmd condition

* Adjust vars

* "Adjust Hyundai longitudinal jerk limits and tuning logic"

* Adjust jerk limits and tuning logic for better control

* Update Hyundai longitudinal tuning and add dynamic jerk logic

Refactored longitudinal configuration to include "lookahead" parameters and revised "jerk_limits" for improved tuning flexibility. Implemented dynamic jerk adaptation logic (Gen1) for smoother braking and acceleration transitions.

* Adjust Hyundai longitudinal control parameters for tuning

* bump to original branch

* QSize Policy to stretch toggle to screen size

* bump

* completely blocked xD

* Sunnypilot -> openpilot

* Whitespace

* Clean up toggle name

* Still allow ramp while in standstill for EV

* Adjust Kia Niro EV tuning parameters for smoother control

* self.cp.flags

* bump submodule

* bump

* Remove ramp for lower desired jerk

* update README.md

* update README.md

* Adjust lookahead_jerk_lower_v values in Hyundai longitudinal config.

* update tuning

* Update tune one last time to vals from device which are much smoother.

* Accel error

* bump

* fix

* rename flag and slight cleanup

* start ui stuff

* long_state -> tuning

* Prep for clean up

* small changes

* less in main

* no longer

* format

* bump

* init panel

* expose signal for other panels to interact with

* split into its own

* unused

* move around

* actually modify CP_SP

* fix offroad transition

* rename

* back

* don't update unless we're looking at it

* move around

* use min length

* do this

* whoops

* move

* bump

* bump

* this is fine

* bump

---------

Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
Co-authored-by: DevTekVE <devtekve@gmail.com>
Co-authored-by: royjr <royjr96@gmail.com>
2025-05-09 01:06:45 -04:00
rav4kumar
cf9b45783d Merge remote-tracking branch 'comma/master' into sync-20250427 2025-04-28 14:06:18 -04:00
Cameron Clough
9d17c73f6b avoid importing Raylib UI (#35078) 2025-04-25 19:09:19 -07:00
Cameron Clough
362ddfc0c7 ui: replace qt text window with raylib (#35064)
* remove qt text window

* use wrapper, render text window in thread

* add wait_for_exit method

* update imports
2025-04-25 14:17:47 +01:00
Cameron Clough
3ee2882093 ui: replace qt spinner with raylib (#35059)
* use raylib spinner

* remove qt spinner

* use wrapper, render spinner in thread

* english

* fix?

* match Qt font size more closely
2025-04-24 21:16:38 +01:00
Jason Wen
b9385a2368 Merge branch 'upstream/openpilot/master' into sync-20250422
# Conflicts:
#	.github/workflows/selfdrive_tests.yaml
#	.github/workflows/ui_preview.yaml
#	common/params_keys.h
#	opendbc_repo
#	panda
#	selfdrive/car/card.py
#	selfdrive/car/tests/test_car_interfaces.py
#	selfdrive/car/tests/test_models.py
#	selfdrive/controls/lib/longitudinal_planner.py
#	selfdrive/modeld/fill_model_msg.py
#	selfdrive/test/process_replay/process_replay.py
#	selfdrive/ui/qt/offroad/developer_panel.cc
#	selfdrive/ui/qt/offroad/settings.cc
#	selfdrive/ui/translations/main_de.ts
Sync: `commaai/opendbc:master` into `sunnypilot/opendbc:master-new`

Sync: `commaai/panda:master` into `sunnypilot/panda:master-new`
2025-04-23 00:44:53 -04:00
Nayan
f1d703e6e4 Device: Customizable Max Time Offroad (#796)
* Max Time Offroad

* Refactor & Fix param

* Error Handling

* rename SP variable

* Update selfdrive/ui/sunnypilot/qt/widgets/controls.h

Co-authored-by: DevTekVE <devtekve@gmail.com>

* Update selfdrive/ui/sunnypilot/qt/widgets/controls.h

Co-authored-by: DevTekVE <devtekve@gmail.com>

* Update selfdrive/ui/sunnypilot/qt/widgets/controls.h

Co-authored-by: DevTekVE <devtekve@gmail.com>

* Update selfdrive/ui/sunnypilot/qt/widgets/controls.h

Co-authored-by: DevTekVE <devtekve@gmail.com>

* Update selfdrive/ui/sunnypilot/qt/widgets/controls.cc

Co-authored-by: DevTekVE <devtekve@gmail.com>

* Update selfdrive/ui/sunnypilot/qt/offroad/settings/lateral/max_time_offroad.h

Co-authored-by: DevTekVE <devtekve@gmail.com>

* Update selfdrive/ui/sunnypilot/qt/offroad/settings/lateral/max_time_offroad.cc

Co-authored-by: DevTekVE <devtekve@gmail.com>

* UI layout changes for better alignment

selector is not big enough -> make it bigger ;)

OptionControlSP now includes a QMap argument to allow actual values to be set in param directly

* Rebase & resolve reviews

* change default to be closer to OP default

* me dumb

* MaxTimeOffroad: Add support for 30h limit and improve label formatting

* power_monitoring: Refactor MaxTimeOffroad parameter handling for clarity

* test: Add unit tests for MaxTimeOffroad parameter handling

* power_monitoring: Update MaxTimeOffroad handling to use seconds and improve shutdown logic

* power_monitoring: Improve exception handling and remove redundant shutdown check for MaxTimeOffroad

---------

Co-authored-by: DevTekVE <devtekve@gmail.com>
Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
2025-04-12 16:33:17 +02:00
Kacper Rączy
f237649a7a Reapply "Online lateral lag learning" (#34975)
* Online lateral lag learning (#34974)

This reverts commit b4cc9e68d1.

* pad to the best size for fft

* Fix static analysis

* Add typing

* Fix typing

* MAX_LAG

* Calculate cross correlation regardless if the points are valid

* Back to lagd

* Add lagd to process_config

* Lagd in test onroad

* Move lag estimator for lagd

* Remove duplicate entry from test_onroad

* Update process replay

* pre-fill the data

* Update cpu usage

* 25sec window

* Change the meaning of lateralDelayEstimate

* No newline

* Fix typing

* Prefill

* Update ref commit

* Add a unit test

* Fix static issues

* Time limit

* Or timeout

* Use mocker

* Update estimate every time

* empty test

* DT const

* enable RIVIAN again

* Update ref commit

* Update that again

* Improve the tests

* Fix static

* Add masking test

* Increase timeout

* Add liveDelay to selfdrived

* Add liveDelay to selfdrived in process_replay

* Fix block_avg restore after num_blocks

* regen most

* Update bolt

* Update ref commit

* Change the key name

* Add assert

* True weighted average
2025-04-09 22:31:07 +00:00
Jason Wen
8dec4ea5d7 Revert "MADS: Steering Mode on Brake Pedal Press (#687)" (#789)
This reverts commit bf2731b4
2025-04-04 22:43:00 -04:00
Kumar
34bbdf4d7f Controls: Automatic lane change (#653)
* init alc controller

* only for sunny

* rebase fix

* ui

* add ui preview

* Update common/params_keys.h

Co-authored-by: Jason Wen <haibin.wen3@gmail.com>

* Update selfdrive/ui/sunnypilot/SConscript

Co-authored-by: Jason Wen <haibin.wen3@gmail.com>

* Update selfdrive/ui/sunnypilot/qt/offroad/settings/lateral/lane_change_settings.h

Co-authored-by: Jason Wen <haibin.wen3@gmail.com>

* Update selfdrive/ui/sunnypilot/qt/offroad/settings/lateral/lane_change_settings.cc

Co-authored-by: Jason Wen <haibin.wen3@gmail.com>

* review sugg

* code review

* renaming

* move around

* style

* fix types and params exceptions handling

* take out magic numbers

* more

* rename

* shorter

* make sure reset happens at the end of every DH loop

* split into multiple updates

* just 3 seconds

* use default states

* oops

* more readable

* oops

* some space and lines

* run in DH loop directly

* adjust ui preview

* nudgeless should process immediately

* check option instead

* more explicit

* even more explicit

* tests

* brake pedal release should not allow auto lane change (caught by test)

* unnecessary

* no continuous auto lane change

* Revert "unnecessary"

This reverts commit 93d135b54a.

* more tests

* less

* less less

* update again

* more cleanup

* better

* AutoLaneChangeState -> AutoLaneChangeMode

* update

* lint

* unused

* test all states

* license

---------

Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
2025-03-24 22:26:48 -04:00
Kumar
029a601674 Device: Quiet Mode (#654)
* init quiet mode

* only for sunny

* static

* toggle

* let's back this up

* review sugg

* oh okay

* review

* fix: ensure boolean conversion for QuietDrive parameter

* Refactor return statement to use boolean conversion for clarity in quiet mode logic

* Update selfdrive/ui/sunnypilot/quietmode.py

* rename

* sunny

* Revert "sunny"

This reverts commit 6ac4cf4b8d.

* sunny

* Revert "sunny"

This reverts commit c2bffddc05.

* sunny

* ui: support dynamic state updates for `PushButtonSP`

* test btn

* override mouse release events

* Revert "test btn"

This reverts commit cd9c9dde9a.

* Reapply "test btn"

This reverts commit 9b36b2e085.

* abstract param flipping

* Revert "Reapply "test btn""

This reverts commit 8104a262b0.

* use new button state for PushButtonSP

* Quiet Drive -> Quiet Mode

* driver camera btn moved

---------

Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
2025-03-23 23:15:11 -04:00
DevTekVE
43e43849ad sunnylink: Settings backup & restore (#681)
* Add AES encryption and utility methods

This commit introduces a new AESCipher class that can be used for AES encryption with support for both AES-128 and AES-256. It also adds a set of utility functions, including methods for RSA to AES key derivation, file decryption and compression, and encryption and decompression. These changes provide fundamental cryptographic functionalities for data security within the system.

* Revised backup management system with new structures

This update introduces important revisions to the backup management system. A new struct named 'BackupManagerSP' has been integrated into the 'custom.capnp' file, replacing 'CustomReserved6'. This new struct includes several variables that help keep track of backup and restore status, progress and related messages.

Additional code modifications were made in 'base.py' and 'api.py' to include a 'json' parameter in the 'api_get' method. Lastly, 'manager.py' has been updated with functions to manage device configuration backups to and from sunnylink.

The changes promote better handling and management of data backup and restoration processes. The update is specifically designed to ensure that the backup information is well integrated into the system, with properly tracked status and progress.

* Refactor `allKeys` to filter by parameter key type

Updated the `allKeys` method to support filtering by `ParamKeyType`, allowing more specific key retrieval. Added a default value for backward compatibility and updated related bindings and keys to reflect this change.

* Improve Backup and Restore mechanisms

The commit refactors and improves several aspects of the backup and restore mechanisms in the `BackupManagerSP` class.

These improvements include removing redundant status tracking variables and replacing them with unified ones, updating the messaging system to handle all changes correctly, and including an enumeration `OperationType` to keep track of the type of operation currently being processed.

This commit also applies stricter conditions for restore operations, such that it only restores parameters that are currently marked as backupable, and skips those that are not. This is a preventive measure against potential issues when restoring parameters that are no longer relevant or could conflict with current versions.

Also, the encryption and decryption methods were updated to use AES-256 for more security. These changes have increased the robustness and reliability of the backup and restoration processes.

* copyright

* Add backup_manager process to offroad sunnypilot tasks

The backup_manager process is introduced to handle backups during offroad mode when SunnyLink is ready. This ensures proper backup management functionality integrated into the system.

* Simplify backup endpoint construction in restore method

Replaced conditional expression with a more concise and readable `or` operation for constructing the backup endpoint. This makes the code cleaner and easier to maintain while preserving functionality.

* Added support for backing up and restoring sunnypilot settings

An update to the sunnypilot functionality now provides two new features that allow users to backup and restore their sunnypilot settings. The changes include the addition of UI controls for initiating backup and restore operations, and the creation of a system-wide state management function for tracking these operations. This enhancement significantly improves the user experience by providing a safety net for user settings in case of software failures, bugs, or unintended changes.

* Refactor type hints to use PEP 604 syntax for clarity

Replaced `Optional` and `Dict` type hints with `|` and `dict` syntax for improved readability and compliance with Python 3.10+. Updated related imports and adjusted list comprehension for cleaner code.

* Update import path for hardware module in utils.py

Replaced the import path for the `Paths` module to align with the new directory structure under `openpilot`. This ensures compatibility with recent project reorganization and avoids import errors.

* Improve RSA key handling and fix backup status comparison

Added explicit RSA key type checks to handle invalid key formats. Enhanced type safety in `manager.py` by ensuring the backup status comparison returns a boolean. These changes improve robustness and error handling in backups.

* format

* more

* Improve backup and restore flow with progress tracking and fixes

Added proper progress tracking and cleanup logic during restore operations. Enhanced restore experience by resetting progress after completion and introducing confirmation dialogs for errors and completion. Updated API compatibility with a version query parameter for backups.

* Enable backup button only when restore process is complete

Previously, the backup button could be enabled during a restore operation, which might cause unintended behavior. This update introduces a check to ensure the backup button remains disabled while a restore process is active. This improves user experience and prevents potential conflicts.

* Fix restore button state handling during restore process

Ensure the restore button is disabled consistently when a restore is in progress. This prevents user interaction issues and aligns the button state with the restore operation status.

* "Refactor restore logic and improve button state handling"

Replaced `is_restoring` with `restore_request_pending` for clarity and better state management. Adjusted button behavior to immediately disable upon user action, ensuring improved UX and preventing repeat inputs. Refined restore completion flow for better consistency and reliability.

* Refine restore process logic for SunnyLink settings.

Introduced `restore_request_started` to improve handling of restore states and ensure accurate UI updates during the process. Adjusted case handling to enhance clarity and maintain proper behavior when restoring settings, especially during ongoing or completed requests.

* revert

* move around

* fix enabled states for different statuses

* add prompt to notify backup is complete

* same states as restore

* disable buttons if sunnylink is off

* can use the same texts

---------

Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
2025-03-22 15:58:04 +00:00
Jason Wen
309304a352 Controls: Neural Network Lateral Control (NNLC) for Torque Lateral Accel Control (#695)
* init

* more init

* keep it alive

* fixes

* more fixes

* more fix

* new submodule for nn data

* bump submodule

* update path to submodule

* spacing???

* update submodule path

* update submodule path

* bump

* dump

* bump

* introduce params

* Add Neural Network Lateral Control toggle to developer panel

This introduces a new toggle for enabling Neural Network Lateral Control (NNLC), providing detailed descriptions of its functionality and compatibility. It includes UI integration, car compatibility checks, and feedback links for unsupported vehicles.

* decouple even more

* static

* codespell

* remove debug

* in structs

* fix import

* convert to capnp

* fixes

* debug

* only initialize if NNLC is enabled or allow to enable

* oops

* fix initialization

* only allow engage if nnlc is off

* fix toggle param

* fix tests

* lint

* fix more test

* capnp test

* try this out

* validate if it's not None

* make it 33 to match

* align

* share the same friction input calculation

* return stock values if not enabled

* unused

* split base and child

* space

* rename

* NeuralNetworkFeedForwardModel

* less

* just use file name

* try this

* more explicit

* rename

* move it

* child class for additional controllers

* rename

* time to split out custom lateral acceleration

* move around

* space

* fix

* TODO-SP

* TODO-SP

* update regardless, it's an extension now

* update name and expose toggle

* ui: sunnypilot Panel -> Steering Panel

* Update selfdrive/ui/sunnypilot/qt/offroad/settings/lateral_panel.h

* merge

* move to steering panel

* no need for this

* live params in a thread

* no live for now

* new structs

* more ui

* more flexible

* more ui

* no longer needed

* another ui

* cereal changes

* bump opendbc

* simplify checks

* all in one place

* split Enhanced Lat Accel

* handle unrecognized platform

* test for fingerprinting

* fix fingerprint

* NNLC: Mock data for unrecognized cars

* fix fingerprints

* test to verify model loading

* bump neural_network_data

* use pytest

* use different one for now

* fix ui preview alignments

* typing

* more type

* show a platform

* show match

* init params for tests

* ok ruff

* make sure to loop through tests

* ok again ruff

* ok we need this lol

---------

Co-authored-by: DevTekVE <devtekve@gmail.com>
2025-03-22 09:40:29 -04:00
Jason Wen
0990212edc Revert "Controls: Neural Network Lateral Control (NNLC) for Torque Lateral Accel Control" (#694)
Revert "Controls: Neural Network Lateral Control (NNLC) for Torque Lateral Ac…"

This reverts commit ecb4026269.
2025-03-21 16:13:50 -04:00
Jason Wen
ecb4026269 Controls: Neural Network Lateral Control (NNLC) for Torque Lateral Accel Control (#667)
* init

* more init

* keep it alive

* fixes

* more fixes

* more fix

* new submodule for nn data

* bump submodule

* update path to submodule

* spacing???

* update submodule path

* update submodule path

* bump

* dump

* bump

* introduce params

* Add Neural Network Lateral Control toggle to developer panel

This introduces a new toggle for enabling Neural Network Lateral Control (NNLC), providing detailed descriptions of its functionality and compatibility. It includes UI integration, car compatibility checks, and feedback links for unsupported vehicles.

* decouple even more

* static

* codespell

* remove debug

* in structs

* fix import

* convert to capnp

* fixes

* debug

* only initialize if NNLC is enabled or allow to enable

* oops

* fix initialization

* only allow engage if nnlc is off

* fix toggle param

* fix tests

* lint

* fix more test

* capnp test

* try this out

* validate if it's not None

* make it 33 to match

* align

* share the same friction input calculation

* return stock values if not enabled

* unused

* split base and child

* space

* rename

* NeuralNetworkFeedForwardModel

* less

* just use file name

* try this

* more explicit

* rename

* move it

* child class for additional controllers

* rename

* time to split out custom lateral acceleration

* move around

* space

* fix

* TODO-SP

* TODO-SP

* update regardless, it's an extension now

* update name and expose toggle

* ui: sunnypilot Panel -> Steering Panel

* Update selfdrive/ui/sunnypilot/qt/offroad/settings/lateral_panel.h

* merge

* move to steering panel

* no need for this

* live params in a thread

* no live for now

* new structs

* more ui

* more flexible

* more ui

* no longer needed

* another ui

* cereal changes

* bump opendbc

* simplify checks

* all in one place

* split Enhanced Lat Accel

---------

Co-authored-by: DevTekVE <devtekve@gmail.com>
2025-03-21 15:38:31 -04:00
Jason Wen
bf2731b470 MADS: Steering Mode on Brake Pedal Press (#687)
* reimplement

* bump opendbc

* Apply suggestions from code review

Co-authored-by: DevTekVE <devtekve@gmail.com>

* update toggle positions

* translations from bot later

---------

Co-authored-by: DevTekVE <devtekve@gmail.com>
2025-03-19 18:24:56 -04:00
Jason Wen
dd37a35b59 Revert "MADS: Steering Mode on Brake Pedal Press" (#686)
* Revert "MADS: Steering Mode on Brake Pedal Press (#684)"

This reverts commit 4525659a7e.

* bump
2025-03-19 16:02:45 -04:00
Jason Wen
4525659a7e MADS: Steering Mode on Brake Pedal Press (#684)
* MADS: cleanup param assignments

* MADS: Steering Mode on Brake Pedal Press

* bump opendbc

* translations

* make sure to initialize

* ci try this

* Revert "ci try this"

This reverts commit da975f61c3.

* Revert "translations"

This reverts commit a65aad5911.
2025-03-19 13:57:15 -04:00
DevTekVE
f0abacbc59 Merge branch 'refs/heads/master-at-17032025' into sync-17032025
# Conflicts:
#	opendbc_repo
#	selfdrive/car/card.py
#	selfdrive/car/tests/test_car_interfaces.py
#	selfdrive/car/tests/test_models.py
#	selfdrive/controls/controlsd.py
#	selfdrive/controls/lib/tests/test_latcontrol.py
#	selfdrive/pandad/panda.h
#	system/manager/process_config.py
Sync: `commaai/opendbc:master` into `sunnypilot/opendbc:master-new`
2025-03-18 01:05:34 -04:00
Adeeb Shihadeh
519ea9dcab Make model daemons Python processes (#34880) 2025-03-15 15:55:29 -07:00
DevTekVE
a4ef5ad982 Merge remote-tracking branch 'comma/master' into sync-20250309
# Conflicts:
#	.github/workflows/ui_preview.yaml
#	common/params_keys.h
#	msgq_repo
#	opendbc_repo
#	panda
#	selfdrive/ui/qt/offroad/firehose.h
#	selfdrive/ui/tests/test_ui/run.py
#	system/manager/process_config.py
2025-03-09 14:53:03 +01:00
Jason Wen
290383128e Sync: Fix conflicts 2025-03-09 00:53:06 -05:00
Adeeb Shihadeh
c32c405f65 remove model shims (#34750) 2025-03-02 13:39:36 -08:00
DevTekVE
1a8dd310ae Model: split modeld into it's own contained modeld implementation (#642)
* Add support for TinyGrad model runner processing

Introduced a new function `is_tinygrad_model` to detect TinyGrad as an active model runner. Updated the `is_stock_model` logic to account for TinyGrad models and added a new process entry for TinyGrad in the model manager. This enables handling TinyGrad models alongside existing configurations.

adding modeld back

Add support for `modeld_v2` and update paths for consistency

Updated `SConscript` files to integrate `modeld_v2` alongside `modeld` and adjusted script paths for correct metadata handling. Adjusted various configurations and scripts, such as `labeler.yaml` and `build_release.sh`, to include `modeld_v2` and ensure cohesive project structure.

Refactor imports to use updated `modeld_v2` paths.

Replaced outdated `modeld` references with their `modeld_v2` counterparts for consistency and clarity across the codebase. Also updated `.gitignore` to accommodate new directory structure. This change ensures better maintainability and alignment with the new directory schema.

Refactor and reorganize modeld to sunnypilot/modeld_v2 structure.

Moved and renamed `modeld` components to the new `sunnypilot/modeld_v2` directory for better organization and modularity. Updated imports and file references to align with the new structure, ensuring compatibility and functionality. Streamlined project structure to improve maintainability and future development.

* typo

* Use `stock` model runner and refactor model checks.

Replaces outdated model detection logic with unified `stock` runner integration, simplifying the decision flow for model selection. Includes `stock` as a new enum in the `Runner` type and updates affected references accordingly.

* Handle missing 'sim_pose' in model outputs gracefully.

Added conditional checks to ensure the code handles cases where 'sim_pose' is absent in the model outputs. Fallback behaviors use 'plan' data when 'sim_pose' is unavailable, preventing potential errors and enhancing robustness.
2025-03-02 20:49:30 +01:00
Adeeb Shihadeh
952def7abf start logging services first (#34646)
* start logging services first

* fix test

---------

Co-authored-by: Comma Device <device@comma.ai>
2025-02-20 16:53:07 -08:00