* Adding capabilities to route localProxy via sunnylink
* Undo
* Thx lint
* get api token
* cert is not valid when it's an IP. Still use cert, but don't validate
Adjust the spinner vertical position when displaying text or a progress bar
- When displaying the progress bar, center the comma logo and spinner in the middle of the screen
- When displaying text, center the entire content vertically
Also updated `wrap_text` to not include an empty line in the array if it's the first line, so that `wrap_text("")` always returns `[]`
- Wrap text onto separate lines
- Increase font size to be closer to Qt
- Remove extra letter spacing - 0.0 should use font default spacing, and this is used in `wrap_text`
Will fix vertical alignment separately, as both the text and progress bar layouts need to be considered
* ui(raylib): reduce spinner rotation artifact
A visual artifact (white pixels) appeared on the edge of the
rotating spinner track texture, likely due to RGB color bleed during
bilinear filtering in Raylib.
Pre-multiplying the alpha channel of the spinner track image using
`rl.image_alpha_premultiply` significantly reduces the visibility of the
artifact.
* lint
* 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>
* 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
* 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>
* 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>
* 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>
* 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>