Commit Graph

15086 Commits

Author SHA1 Message Date
Jason Wen 93d135b54a unnecessary 2025-03-24 20:39:47 -04:00
Jason Wen 7ab994a71d brake pedal release should not allow auto lane change (caught by test) 2025-03-24 20:32:51 -04:00
Jason Wen 135ff49514 tests 2025-03-24 20:32:08 -04:00
Jason Wen 5d8026f8c6 even more explicit 2025-03-24 12:00:00 -04:00
Jason Wen 48533d90e5 more explicit 2025-03-24 11:51:38 -04:00
Jason Wen f87f1782cb check option instead 2025-03-24 11:42:25 -04:00
Jason Wen 0e935fe947 nudgeless should process immediately 2025-03-24 11:36:30 -04:00
Jason Wen 30155a9811 adjust ui preview 2025-03-24 09:35:12 -04:00
Jason Wen af189007a3 run in DH loop directly 2025-03-24 01:18:23 -04:00
Jason Wen f8b838697d some space and lines 2025-03-24 00:39:45 -04:00
Jason Wen 87c3abcaf5 Merge remote-tracking branch 'sunnypilot/sunnypilot/master-new' into alc-new 2025-03-24 00:32:41 -04:00
Jason Wen cc1b233277 ui: vertical space for ListWidget (#706) 2025-03-24 00:32:31 -04:00
Jason Wen 1af11279e0 oops 2025-03-24 00:32:16 -04:00
Jason Wen f9d55ea419 more readable 2025-03-24 00:32:10 -04:00
Jason Wen e259196328 oops 2025-03-24 00:28:51 -04:00
Jason Wen 4c5ff671bb use default states 2025-03-24 00:24:16 -04:00
Jason Wen aecd1cca7a just 3 seconds 2025-03-24 00:13:02 -04:00
Jason Wen 3ce8941d3c split into multiple updates 2025-03-24 00:11:31 -04:00
Jason Wen 18823ceb1c make sure reset happens at the end of every DH loop 2025-03-24 00:00:40 -04:00
Jason Wen 584cfd5c1a shorter 2025-03-23 23:53:33 -04:00
Jason Wen 52987cdbc1 rename 2025-03-23 23:53:04 -04:00
Jason Wen 780224d9f9 more 2025-03-23 23:52:52 -04:00
Jason Wen a1dfa25127 take out magic numbers 2025-03-23 23:49:21 -04:00
Jason Wen d499c4bc89 fix types and params exceptions handling 2025-03-23 23:38:04 -04:00
Jason Wen a452a6a667 style 2025-03-23 23:30:52 -04:00
Jason Wen c5ca9eb2d5 move around 2025-03-23 23:26:16 -04:00
Jason Wen 9262497186 renaming 2025-03-23 23:21:06 -04:00
Jason Wen 1dbc0453f7 Merge remote-tracking branch 'sunnypilot/sunnypilot/master-new' into alc-new 2025-03-23 23:16:49 -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
Jason Wen 982674b4a7 ui: support dynamic state updates for PushButtonSP (#708)
* 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.

* update device panel handling for the new param
2025-03-23 22:54:40 -04:00
rav4kumar c662c7e6da code review 2025-03-23 13:44:07 -07:00
royjr 96d73fe2b3 NNLC: bump max similarity for higher accuracy (#704)
Update helpers.py

Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
2025-03-23 20:04:12 +00:00
Jason Wen a307a08591 ui: fix offset with OptionControlSP for macOS (#705)
ui: fix offset with `OptionControlSP`
2025-03-23 15:50:21 -04:00
Kumar 7c9d73eb20 Merge branch 'master-new' into alc-new 2025-03-22 21:49:02 -07:00
rav4kumar 3d24f43277 review sugg 2025-03-22 21:34:14 -07:00
Kumar 02e4bdba42 Update selfdrive/ui/sunnypilot/qt/offroad/settings/lateral/lane_change_settings.cc
Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
2025-03-22 21:22:25 -07:00
Kumar 08ee65c216 Update selfdrive/ui/sunnypilot/qt/offroad/settings/lateral/lane_change_settings.h
Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
2025-03-22 21:22:05 -07:00
Kumar 912ac7c23c Update selfdrive/ui/sunnypilot/SConscript
Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
2025-03-22 21:21:56 -07:00
Kumar d25df401f0 Update common/params_keys.h
Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
2025-03-22 21:21:48 -07:00
Jason Wen 2a4701548e add ui preview 2025-03-22 23:49:59 -04:00
Jason Wen e6177c49aa athenad: avoid infinite loop waiting for comma registration (#701)
Athenad: avoid infinite loop waiting for comma registration
2025-03-22 22:48:58 -04:00
Jason Wen ed39aaddbc ui: use allKeys to reset sunnypilot settings (#699)
* ui: exclude certain params from deletion during settings reset

* clear all and exclude directly and only reboot after confirmation

* cleaner

* handle this instead

* send it

* 1-liner

* nuke nuke

* space

* less
2025-03-22 22:41:42 -04:00
rav4kumar 2f09579c2e ui 2025-03-22 17:42:31 -07:00
Tim Wilson bab2d776b6 NNLC: use torque substitutes as fuzzy fingerprints (#700)
* NNLC: use torque substitutes as fuzzy fingerprints

* substitutes are not exact matches

* update nnlc helpers

for extra nnlc model path checks, take the first one that passes.

* Update sunnypilot/selfdrive/controls/lib/nnlc/helpers.py

---------

Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
2025-03-22 23:49:05 +00:00
rav4kumar b4ee75d579 rebase fix 2025-03-22 15:54:27 -07:00
rav4kumar 4324dc3918 only for sunny 2025-03-22 15:52:20 -07:00
rav4kumar 55b1292130 init alc controller 2025-03-22 15:52:17 -07:00
Jason Wen 002a37cdc4 ui: show branch selector in all branches (#698) 2025-03-22 16:20:19 -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 efb44aeecd ui: Fix NNLC toggle not staying in persistent state (#697)
The `showEvent` method in `NeuralNetworkLateralControl` was removed as it duplicated functionality now handled in `LateralPanel`. The unused `refresh` method was also removed to streamline the code and improve maintainability.
2025-03-22 11:18:32 -04:00