* modeld: Retain pre-20hz drive model support
* Method not available anymore on OP
* some fixes
* Revert "Long planner get accel: new function args (#34288)"
* Revert "Fix low-speed allow_throttle behavior in long planner (#33894)"
* Revert "long planner: allow throttle reflects usage (#33792)"
* Revert "Gate acceleration on model gas press predictions (#33643)"
* Reapply "Gate acceleration on model gas press predictions (#33643)"
This reverts commit 76b08e37cb8eb94266ad9f6fed80db227e7c3428.
* Reapply "long planner: allow throttle reflects usage (#33792)"
This reverts commit c75244ca4e9c48084b0205b7c871e1a4e0f4e693.
* Reapply "Fix low-speed allow_throttle behavior in long planner (#33894)"
This reverts commit b2b7d21b7b685a2785d1beede3d223f0bb954807.
* Reapply "Long planner get accel: new function args (#34288)"
This reverts commit 74dca2fccf4da59cc8ac62ba9c0ad10ba3fc264b.
* don't need
* retain snpe
* wrong
* they're symlinks
* remove
* put back into VCS
* add back
* don't include built
* Refactor model runner retrieval with caching support
Added caching for active model runner type via `ModelRunnerTypeCache` to enhance performance and avoid redundant checks. Introduced a `force_check` flag to bypass the cache when necessary. Updated related code to handle cache clearing during onroad transitions.
* Update model runner determination logic with caching fix
Enhances `get_active_model_runner` to utilize caching more effectively by ensuring type consistency and updating cache only when necessary. Also updates `is_snpe_model` to pass the `started` state to the runner determination function, improving behavior for dynamic checks.
* default to none
* enable in next PR
* more
---------
Co-authored-by: DevTekVE <devtekve@gmail.com>
* Increase timeout for test report creation by 1 minute
Adjusted the `timeout-minutes` value to allow more time for the
test report creation step.
* Add script to disable power save in build workflow
This commit integrates the `disable-powersave.py` script into the sunnypilot build workflow. It ensures power save mode is disabled during the build process, improving reliability and consistency.
* Set PYTHONPATH before running disable-powersave.py
The change ensures the correct Python module path is set when executing the disable-powersave script. This update prevents potential import issues by including the GitHub workspace in the PYTHONPATH.
* Refactor powersave handling with a dedicated script
Replaced inline powersave disable logic with a new script `manage-powersave.py` to handle enabling and disabling power saving mode. Updated the CI workflow to use this script and added a step to re-enable powersave after builds. This improves clarity and modularity for power management operations.
* Enable CPU core count display in power save script
Introduce multiprocessing to show the number of CPU cores available. Added messages to indicate power save mode state and core count, improving script feedback and user clarity.
* Refine power save mode logging output.
Improve clarity of logging messages in `manage-powersave.py` by indicating CPU core counts before and after applying changes. Simplified the power save state message for better readability.
* Updated scons cache key restore logic in GitHub workflows
This commit updates the restore key logic in two GitHub workflow config files (sunnypilot-build-model.yaml and sunnypilot-build-prebuilt.yaml). The restore key sequence has been revised for improved accuracy and consistency. This should optimize the cache hit rate and speed up the subsequent builds.
* Add comments on GitHub Actions cache isolation behavior
Clarifies the cache isolation enforced by GitHub Actions for security reasons. Notes that only caches from the default branch are shared across all builds, and this behavior cannot be changed. This improves maintainability and understanding of the workflow configuration.
Ensure the cache is treated as expired when last_sync is zero. This prevents potential issues with uninitialized or missing sync timestamps, enhancing reliability.
* cabana: enhance message heatmap visualization (#34239)
* enhance message heatmap visualization
* TODO
* improve log_factor
* typo
* bit_flip_counts
* Openpilot webcam support improved (#34215)
* control webcam with ENV vars
* WIP: actual instructions
* wording
* file no longer exists
* this is expected behavior, just untested
* more readable
* tested on fresh install
* wording tweaks
* explicit USE_WEBCAM toggle required
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
* debug-ability improved
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
* newline removed
---------
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
* Update metadrive wheel (#34292)
* test
* new wheel
* fix IR power scaling (#34293)
* fix IR power scaling
* Update system/hardware/tici/hardware.h
* replay: Update video immediately after seek when paused. (#34237)
replay: Update video immediately after seeking when paused.
Otherwise, if paused then have to resume playback for the video
frame to update and show the new location.
Implemented by temporarily un-pausing replay for a single
frame time.
* cabana: add live and time-window heatmap modes for enhanced signal analysis (#34296)
add live and time-window heatmap modes
* timed: diff against absolute value of timedelta (#34299)
* cabana: miscellaneous bug fixes and enhancements (#34297)
* toHexString
* use QToolBar
* fix incorrect groove rect
* limit CAN_MAX_DATA_BYTES
* add series type selector to chart toolbar
* dim inactive messages
* rename
* add help to chart
* cleanup
* cabana: real-time cursor and video frame sync for chart and video (#34301)
* sync cursor and thumbnail between chart and video
* Revert "replay: Update video immediately after seek when paused. (#34237)"
This reverts commit 3363881844.
* use thumbnails while scrubing
* draw alert
* no update on resume
* draw timestamp
* cleanup
* replay: fix various synchronization and event handling issues (#34254)
fix various synchronization and event handling issues
* cabana: fix crash in live streaming mode by skipping thumbnail display (#34302)
resolve crash in live streaming mode
* bump panda
* [bot] Update Python packages (#34304)
Update Python packages
Co-authored-by: Vehicle Researcher <user@comma.ai>
* cleanup touch_replay (#34305)
mathematics
* uv from brew doesn't have self update
* Skip registration on newer devices (#34316)
* tici: fix cpp device type (#34315)
fix cpp
* Tinygrad upstream master (#34325)
Upstream master
* [bot] Update Python packages (#34320)
Update Python packages
Co-authored-by: Vehicle Researcher <user@comma.ai>
* cabana: fix missing transmitter after undoing DBC message removal (#34329)
fix missing transmitter after undoing DBC message removal
* Quick GC pass heading into 2025 (#34330)
* first pass
* bye bye snpe
* [bot] Update Python packages (#34334)
Update Python packages
Co-authored-by: Vehicle Researcher <user@comma.ai>
* Notre Dame model in tinygrad (#34324)
* release model: 6f23a03f-486b-4d3e-a314-19d149644c7c/700
* old style model in tinygrad
* fix desire
* tg hack
* 20Hz
* no gas probs
* No gas here
* better indexing
---------
Co-authored-by: Yassine Yousfi <yyousfi1@binghamton.edu>
---------
Co-authored-by: Dean Lee <deanlee3@gmail.com>
Co-authored-by: Mike Busuttil <31480000+MikeBusuttil@users.noreply.github.com>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: Maxime Desroches <desroches.maxime@gmail.com>
Co-authored-by: Angus Gratton <gus@projectgus.com>
Co-authored-by: commaci-public <60409688+commaci-public@users.noreply.github.com>
Co-authored-by: Vehicle Researcher <user@comma.ai>
Co-authored-by: Harald Schäfer <harald.the.engineer@gmail.com>
Co-authored-by: Yassine Yousfi <yyousfi1@binghamton.edu>
* release model: 6f23a03f-486b-4d3e-a314-19d149644c7c/700
* old style model in tinygrad
* fix desire
* tg hack
* 20Hz
* no gas probs
* No gas here
* better indexing
---------
Co-authored-by: Yassine Yousfi <yyousfi1@binghamton.edu>
* Update model manager logic and handle offroad transitions
Added is_onroad state tracking in SoftwarePanelSP to handle offroad transitions. Updated model manager conditions for improved bundle validation. Removed unnecessary clear operation for ModelManager_DownloadIndex during offroad transitions to optimize behavior.
* Using is_onroad softwarePanel
* Enable model label button only when conditions are met
Previously, the button's state update was misplaced, leading to potential issues with its interactive availability. The logic has been adjusted to ensure it is properly enabled or disabled based on onroad status and download progress. This change improves UX consistency and prevents unintended actions.
* Remove redundant setEnabled call for currentModelLblBtn
The setEnabled call was unnecessary as its functionality was not required in this context. Cleaning up this code improves readability and removes redundant operations. No changes to functionality or behavior were introduced.
---------
Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
* tinygrad with snpe
* force with snpe to validate
* fix path
* fix more paths
* Adjust modeld execution logic based on active model runner
Introduced a check to conditionally execute `modeld` based on the active model runner. Added support for distinguishing between SNPE and TinyGrad runners using new helper functions and updated `custom.capnp` definitions. This change optimizes process management by ensuring compatibility with the selected model runner.
* Refactor modeld process function checks.
Introduce `is_stock_model` to clarify logic and replace direct uses of `is_snpe_model` where the stock model condition is needed. Additionally, rename the duplicate "modeld" process in sunnyPilot to "modeld_snpe" for clarity and consistency.
* ignore tg
* fix process name
* ruff
* fix thneed paths
* mypy
* remove our own
* use upstream compile3
* fix thneed
* try this
* Revert "remove our own"
This reverts commit 1cf4f57502565c274628e185c66f1eb04c4d9bbe.
* try using compile2.py again
* add back symlink
* fix path
* more fix
* wrong path again
* Revert "wrong path again"
This reverts commit f5301c19d594defb23cda2604168bcb02c830f3e.
* update
* hardcode path to our submodule
* force path
* try this
* fix file name
* try this
* again
* Revert "again"
This reverts commit 17c8cd73768a2de5aaf2a34d202aa6f03d59d72d.
* Revert "try this"
This reverts commit 767f78bbcf17b08edbc20f283d10a1990bf4264f.
* Revert "fix file name"
This reverts commit 485eef68da981da571fe9a9ebf3aecdb95e5588c.
* Revert "try this"
This reverts commit 41fef87680cdda1ba8cbd7e5c59256e6c57010a0.
* Revert "force path"
This reverts commit 5c3b408937bff0f61b150971b328d127501c5bf0.
* Revert "hardcode path to our submodule"
This reverts commit 5ee1950b6f4fce73e7e73b6971b996a9989d0a93.
* Revert "update"
This reverts commit fb313bd7fbeb50111f3c4a11137b4cfd9cabc3fa.
* Reapply "wrong path again"
This reverts commit 309639aeb3575e20b215bbbcc27e48923ee95c87.
* Revert "wrong path again"
This reverts commit f5301c19d594defb23cda2604168bcb02c830f3e.
* Revert "more fix"
This reverts commit 23dd423e78e60bd6a0bd73e921bfba9a5aad88bd.
* Revert "fix path"
This reverts commit 75d338f2bda2dfa77044e33f4c6553390621b13b.
* Revert "add back symlink"
This reverts commit 9f71ad0b8ae2068e431c455af9d4f954d024eec7.
* Revert "try using compile2.py again"
This reverts commit 914117d2e1c6c4270f7bef1a5305847a1d7bab17.
* Reapply "remove our own"
This reverts commit b1996377b346658f2094cba9032a66230784cb3e.
* don't even compile anymore
* need it for default snpe model
* add to lfs
* bring onnx back for sim
* must add this back
* need this
---------
Co-authored-by: DevTekVE <devtekve@gmail.com>
* onroad init
* init model renderer
* Add default virtual destructors to HudRenderer and AnnotatedCameraWidget
This ensures proper cleanup of derived classes if they override these destructors. Adding default destructors promotes better memory safety and adheres to modern C++ best practices.
---------
Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
* Add Sunnylink integration for improved device communication
This commit introduces Sunnylink support, including modules for API interactions, device registration, logging, and uploader processes. Key changes involve adding Sunnylink-related components, such as sunnylinkd, manage_sunnylinkd, and associated utilities, along with seamless integration into process management.
* Refactor Sunnylink modules and update import paths
Standardize parameter handling in Sunnylink functions by initializing Params within functions as needed. Update imports to use fully-qualified paths for better clarity and consistency. Also, refactor logging messages for improved readability and maintainability.
* Add Sunnylink support and improve log handling
Introduced Sunnylink-specific functionality, including compression for oversized logs and platform-specific socket handling for macOS. Improved logging mechanisms, refactored log queue management, and fixed exception handling in sunnylinkd.
* Refactor and fix minor coding style inconsistencies
Remove unnecessary string concatenation, adjust spacing for better readability, and ensure cleaner code in `athenad.py` and `sunnylink.py`. Added a macOS-specific comment for TCP_KEEPALIVE configuration to improve code clarity.
* Replace platform system check with sys platform in athenad.py
To check for macOS platform, the code in athenad.py has been altered. Originally, the platform.system() function was used. However, the function has been replaced with sys.platform for a more consistent and preferable syntax. Particularly, this has been modified in the context of setting socket options.
* Apply suggestions from code review
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
* Simplify imports and reformat API function.
Removed unused `platform` import for cleanup in `athenad.py`. Improved readability of `api_get` in `__init__.py` by reformatting the long return statement into multiple lines.
* Adjust backoff logic and refactor API call formatting.
Introduce randomness to backoff calculation in Sunnylink API to reduce synchronization issues. Minor code refactoring improves readability in the API call logic.
* Refactor Sunnylink network check logic.
Removed hardware-based network check due to performance concerns and replaced it with a real-time device state monitoring loop. This improves efficiency and ensures accurate online status before proceeding with Sunnylink registration.
* Apply suggestions from code review
* `Refactor saveParams error handling and simplify logic`
Removed redundant try-except block wrapping the entire method for clarity. Moved error logging directly inside the loop to handle individual parameter exceptions more effectively. Simplified dictionary construction and improved error logging format.
* Add BACKUP flag to select persistent parameters
This commit introduces a new BACKUP flag and applies it to specific persistent parameters in `params.cc` and `params.h`. The BACKUP flag enhances data retention by designating parameters for inclusion in backups, ensuring crucial information is preserved across sessions.
* Simplify Sunnypilot params formatting
Removed unnecessary blank lines and adjusted the Sunnypilot comment format for better readability and consistency. No functional changes were made.
* SP: Move Sunnypilot-related code to sunnypilot/sunnylink (#504)
* Refactor and relocate sunnylink-related modules
sunnylink components have been reorganized for better modularity and clarity, with files moved under `sunnypilot/sunnylink`. Unused code was removed, and reusable utilities were separated for easier maintenance. Adjusted references across the project to reflect these changes.
* Permissions
* adding init py
* Add sunnylink toggle to developer panel and translations
This commit introduces a new toggle for enabling or disabling sunnylink in the developer panel. Corresponding translation entries have been added for all supported languages to ensure compatibility across the UI.
* Add SunnyLink integration and multi-language support updates
Enhanced SidebarSP with SunnyLink connection status and temperature display. Extended translations for multiple languages, including new strings. Updated build scripts and added utility functions for SunnyPilot-specific features.
* Need it this way as it's intentionally shortened. Sorry
* format
* only block drawing
* format
* format
* fix path
* cleanup translations
* sunnylink panel
* offroad transition
* remove stretch
* add panel to ui preview
* Translating to spanish
* just reorder params
* Refactor sidebar drawing method names and remove unused code.
Renamed `paintSidebar` to `drawSidebar` for better clarity across both `Sidebar` and `SidebarSP` classes. Removed unused utility functions `drawRoundedRect` and `interpColor` to streamline the codebase and improve maintainability.
* Updating translations
---------
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
* Add Sunnylink integration for improved device communication
This commit introduces Sunnylink support, including modules for API interactions, device registration, logging, and uploader processes. Key changes involve adding Sunnylink-related components, such as sunnylinkd, manage_sunnylinkd, and associated utilities, along with seamless integration into process management.
* Refactor Sunnylink modules and update import paths
Standardize parameter handling in Sunnylink functions by initializing Params within functions as needed. Update imports to use fully-qualified paths for better clarity and consistency. Also, refactor logging messages for improved readability and maintainability.
* Add Sunnylink support and improve log handling
Introduced Sunnylink-specific functionality, including compression for oversized logs and platform-specific socket handling for macOS. Improved logging mechanisms, refactored log queue management, and fixed exception handling in sunnylinkd.
* Refactor and fix minor coding style inconsistencies
Remove unnecessary string concatenation, adjust spacing for better readability, and ensure cleaner code in `athenad.py` and `sunnylink.py`. Added a macOS-specific comment for TCP_KEEPALIVE configuration to improve code clarity.
* Replace platform system check with sys platform in athenad.py
To check for macOS platform, the code in athenad.py has been altered. Originally, the platform.system() function was used. However, the function has been replaced with sys.platform for a more consistent and preferable syntax. Particularly, this has been modified in the context of setting socket options.
* Apply suggestions from code review
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
* Simplify imports and reformat API function.
Removed unused `platform` import for cleanup in `athenad.py`. Improved readability of `api_get` in `__init__.py` by reformatting the long return statement into multiple lines.
* Adjust backoff logic and refactor API call formatting.
Introduce randomness to backoff calculation in Sunnylink API to reduce synchronization issues. Minor code refactoring improves readability in the API call logic.
* Refactor Sunnylink network check logic.
Removed hardware-based network check due to performance concerns and replaced it with a real-time device state monitoring loop. This improves efficiency and ensures accurate online status before proceeding with Sunnylink registration.
* Apply suggestions from code review
* `Refactor saveParams error handling and simplify logic`
Removed redundant try-except block wrapping the entire method for clarity. Moved error logging directly inside the loop to handle individual parameter exceptions more effectively. Simplified dictionary construction and improved error logging format.
* Add BACKUP flag to select persistent parameters
This commit introduces a new BACKUP flag and applies it to specific persistent parameters in `params.cc` and `params.h`. The BACKUP flag enhances data retention by designating parameters for inclusion in backups, ensuring crucial information is preserved across sessions.
* Simplify Sunnypilot params formatting
Removed unnecessary blank lines and adjusted the Sunnypilot comment format for better readability and consistency. No functional changes were made.
* SP: Move Sunnypilot-related code to sunnypilot/sunnylink (#504)
* Refactor and relocate sunnylink-related modules
sunnylink components have been reorganized for better modularity and clarity, with files moved under `sunnypilot/sunnylink`. Unused code was removed, and reusable utilities were separated for easier maintenance. Adjusted references across the project to reflect these changes.
* Permissions
* adding init py
* more
---------
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
* allow re-regage
* bump opendbc
* bump panda
* apply pause/resume fix for hyundai (should do this in a separate PR)
* bump opendbc
* fix
* rename
* Fix?
* make sure to disengage for allow always cars
* fix
* combine
* more fix
* not needed
* check if engagement is from openpilot's state machine
* Rename
* fix panda safety
* fix
* no fake lfa button for @devtekve ;)
* fix non drive gear re-engage
* fix settings
* combine
* add replace method
* use replace
* remoev already checks if it exists
* fix
* group
* add todo
* reserve events
* cleaner
* hyundai: only allow for cars with lfa button
* sunnyParams
* make sure it's car only
* Move car-specific changes to opendbc
* no need
* bump opendbc
* more fixes
* no more available
* more!
* final?
* always emit user disable
* no longer needed
* move unit test
* add sunnypilot to unit tests
* bump opendbc
* use new cereal
* bump opendbc
* static analysis
* no unittest
* no need available
* UI border update
* show MADS updates
* Add TODO
* no longer needed
* fix changed events
* fix cluster enabled
* don't add pre enable if not long
* should use enabled
* enabled <-> active
* better format
* bump opendbc
* static analysis
* static analysis
* Rename test as collector was dying
* Show our overriding
* Revert "show MADS updates"
This reverts commit daf0ad62
Revert "fix changed events"
This reverts commit 31d8c97f
* ignoring reserved events
* adjusting creation delays
* back to stock
removing allow_cancel
* should be enabled
* revert
* silent lkas disable
* no need
* user disable tests
* just warning
* MUST REMOVE test process replay
* fix no entry
* fixme
* bump opendbc
* need this check
* cleanup
* allow entering paused state if no entry from disabled
* brake hold should apply to all
* in lists
* update unit test
* simpler
* unused
* same thing
* fix
* only mads in enabled state and long in disabled state
* unify silent enable
* do this for dlob
* bump submodules
* fix
* bump submodules
* bump opendbc
* less frequent
* more events
* fix
* allow no entry to paused for non-drive gears
* fix
* use cereal
* Revert "allow no entry to paused for non-drive gears"
This reverts commit 6d64a4dd9c6de5ad14ef1e88dbc3b6ad174232d8.
* allow in all
* Revert "allow in all"
This reverts commit 6375f1489176dc6c69cb7fa388676e482713f80a.
* should not be all!
* rename for clarity
* silent park brake
* flipped
* bump submodules
* Bump to latest mads-new panda
* bump panda
* more nissan
* bump panda
* bump msgq
* bump panda
* bump submodules
* bump opendbc
* bump opendbc
* improving the state
* Revert "PlayStation® model (#34133)"
This reverts commit 5160bee543.
* should be none
* bump panda
* bump opendbc
* Apply suggestions from code review
* bump panda
* bump ref panda
* add todo-sp
* bump panda ref
* bump more panda
* changing refs
* nuke nuke nuke
* use sunny's newer states
* bump with new panda
* bump panda
* Parse more flags from alt exp, more tests, hyundai main cruise allowed
* Parse more flags from alt exp, more tests, hyundai main cruise allowed
* missed
* mutation for controls allowed rising edge
* ford mutation
* license
* remove
* unused
* bump submodules
* use always allowed mads button alt exp
* fix
* whitelist jason's lastname to codespell
* test_processes: update ref logs to 82c0278
* bump submodules
* bump submodules
* bump submodules
* bump panda
* add controls mismatch lateral event
* Simplify lateral disengagement logic for MADS configuration
Reversed the conditional to align the logic with the `disengage_lateral_on_brake` parameter. This ensures that lateral disengagement behavior is more intuitive and matches the expected configuration. Improves code readability and reduces potential misconfigurations.
* remove unified engagement mode in panda
* controls allow should be allowed at all times
* squash! treat MADS button as user entry
* heartbeat for mads
* heartbeat mismatch exit control
* remove always allow mads button from alt
* move to safety_mads
* remove main cruise allowed from alt
* bump panda
* heartbeat engaged mads mismatch mutation test
* bump panda
* use mads the third panda
* ignore pre enable with mads
* only force exit if actually actuating
* use brake signal instead of pedal events when dlob is active
* fix tests
* fix panda tests
* bump panda
* new events to retain long blocks
* format
* uem: do not engage mads if long is engaged
* bump submodules
* fix not allowed engaged bug
* block uem from engaging
* flipped
* use different heartbeat check if dlob
* hard code to skip heartbeat check
* remove toyota lta status for lkas, causes weird behaviors
* block tesla
* bump panda
* bump to merged panda
* bump opendbc
* bump opendbc
* bump opendbc
* bump opendbc
* Apply suggestions from code review
* code ignore spells
* needs to be in carstate
* Bump opendbc
* Update MADS toggle descriptions for clarity.
Added notes to clarify behavior of the "MadsMainCruiseAllowed" setting, particularly its impact on vehicles without LFA/LKAS buttons. This ensures users are informed about potential implications when disabling this feature.
* Updating translations + Adding spanish
* Disengage Lateral on Brake -> Pause Lateral on Brake
* test_processes: update ref logs to dd41005
* Apply suggestions from code review
* fix mads button not allowed
* bump submodules
* bump submodule
* test_processes: update ref logs to 0a0b998
* has multiple lists
* Revert "has multiple lists"
This reverts commit a37c1d26feac02f63bfb86a08f9b6fb06b095cf1.
* base
* Reapply "has multiple lists"
This reverts commit d1cd8dcc815721a4113b26ab98ee2571c071e225.
* migrate mads toggles to sp panel
* this is why it keeps crashing
* house keeping
* more housekeeping
* more housekeeping
* don't show description by default (yet)
* reset to main panel when clicked away
* more
* some more with interactions
* don't stretch cause it looks weird with descriptions
* simpler to handle offroad transition
* some are toggleable while onroad
* remove unused event
* slight cleanup
* default to true for HKG main cruise toggle
* append to list after
* add Customize MADS to UI preview
* simpler
* move to sp list
* how tf was this removed
* update mads settings button on show event
* test_processes: update ref logs to efa9c32
---------
Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
* Introduce Model Manager to handle downloads and verification
This commit introduces a new Model Manager responsible for handling model downloads, including driving and navigation application models. The manager also verifies file hashes and communicates download progress for an improved user experience.
The Model Manager is asynchronous and utilizes asyncio and aiohttp for enhanced performance, including robust error handling.
Impacted files in the 'cereal', 'common', 'sunnypilot', and 'system' directories have been updated accordingly. The 'ModelsFetcher' process configuration has been modified to run only when off-road, ensuring optimum resource management.
This update aims to enhance code clarity, improve performance, and streamline the handling of model downloads.
* "Update model management and fetching for SunnyPilot"
This update refactors the model management, downloading and cache verification mechanisms of SunnyPilot. New functionalities, such as smart cache handling, have been implemented in ModelFetcher in sunnypilot/models/model_fetcher.py. Also, the model downloading process has been moved to a separate async function _download_bundle in ModelManagerSP in sunnypilot/models/model_manager.py. Hash verification of files is now performed in an async function verify_file in sunnypilot/models/model_helper.py. Changes in system parameters related to model management have been reflected in system/manager/manager.py.
* Integrate download ETA calculations in model manager
This commit introduces a new feature that calculates and tracks the Estimated Time of Arrival (ETA) for downloading models in the model manager component. The 'eta' property in the 'DownloadProgress' structure in 'custom.capnp' is changed from 'Float32' to 'UInt32'.
In the 'model_manager.py' file, a new method '_calculate_eta' has been added to perform ETA calculations. An additional dictionary '_download_start_times' has been created to keep track of the start time of each model download. The ETA is calculated every time a portion of the model file is downloaded, and it gets updated in the 'DownloadProgress' structure. Finally, the start time is cleared after the download completes.
In 'model_manager_audit.py', an additional check is added to only print downloadProgress for the downloads currently in progress.
* format
* no default model cache {} because it can be considered a valid json, we do not want that
* Refactor typing annotations to use PEP 604 syntax.
Updated type hints to adopt PEP 604 union syntax (`X | None`) and replaced `List` and `Dict` with modern built-in `list` and `dict`. This change improves consistency and readability while aligning with Python 3.10+ standards.
* Simplify logging messages and remove unused imports.
Removed an unused import from `model_manager.py` to improve clarity and maintainability. Also refined a log message in `model_fetcher.py` by removing unnecessary formatting for consistency.
* Refactor model handling and simplify cache fallback logic.
Updated type annotations for `selected_bundle` in `model_manager.py` for clarity. Streamlined cache fallback logic in `model_fetcher.py` by removing redundant conditionals while preserving functionality. These changes improve code readability and maintainability.
* "Fix formatting for ModelManager_DownloadIndex retrieval
Condensed parameter alignment in the get method for improved readability and adherence to style guidelines. This change does not affect functionality but ensures consistent code formatting."
* Need to have main defined for process_config to be able to run it
* Refactor model management to support active bundle tracking
Introduce the concept of an active model bundle with a new persistent parameter and API updates. Added fields for `generation` and `environment` in model metadata, improved caching, and updated methods to manage active model states efficiently.
* UI commit (#515)
* Refactor model management to support active bundle tracking
Introduce the concept of an active model bundle with a new persistent parameter and API updates. Added fields for `generation` and `environment` in model metadata, improved caching, and updated methods to manage active model states efficiently.
* Add new driving model selection feature to settings
This commit introduces a new feature to the settings that allows users to select different driving models. It fetches available models and displays their download progress. The created UI also suggests a calibration reset after model download. The changes include the creation of 'SoftwarePanelSP' within 'settings.' Additionally, 'sunnypilot/SConscript' has been updated to include 'settings.cc' and 'software_panel.cc'. Changes also include localization for this feature.
* Show model description during download status
This update ensures the model description is displayed when a model is in the downloading state. It improves the user interface by providing real-time feedback during the download process.
* Update translations for multiple languages
Added new and updated translation strings in several language files, including Spanish, Arabic, Chinese (Simplified and Traditional), Turkish, Korean, Thai, Japanese, and Brazilian Portuguese. These updates include placeholder translations for new UI elements and features.
* Refactor model name handling and add generation check.
Replaced `bundleName` with `model_name` for better clarity in status messages. Added a generation mismatch check before showing the reset parameters dialog to avoid unnecessary prompts.
* Update model handling in SoftwarePanelSP
Remove unused "common/model.h" and replace "CURRENT_MODEL" with "..." as the default return value in GetModelName. Adjust logic to check for active bundles instead of selected bundles for improved accuracy. Minor text change for clarity in UI label.
* Rename `GetModelName` to `GetActiveModelName` for clarity.
The new name better reflects the function's purpose of retrieving the active model name, improving code readability. All relevant calls and references have been updated to ensure consistency across the codebase.
* Update sunnypilot/models/model_helper.py
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
* Refactor download status handling and add 'cached' state
Introduce 'cached' as a new download status and adjust relevant logic across components to support it. Simplify and streamline model status handling in the software panel for better readability and maintainability. Ensure consistent status reporting for all model types.
* Update translations for multiple languages
Refined and expanded translations across various languages, replacing placeholders with meaningful text. This improves clarity and user experience in the multilingual interface.
* Update terminology from 'bundle' to 'model' in UI texts
Replaced occurrences of 'bundle' with 'model' in button labels, dialog titles, and messages in the SoftwarePanelSP code. This improves clarity and aligns terminology with current functionality.
* Update translation placeholders for model fetching texts
Replaced "Fetching bundles" with "Fetching models" across multiple languages to align text placeholders with the updated functionality. Adjusted related background download messages for clarity and consistency.
* cleanup
* not used, and likely not needed
---------
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
* cleaning up
* Update system/manager/process_config.py
* Simplify model parsing and index handling logic.
Refactored `ModelManager_DownloadIndex` retrieval to use the walrus operator, streamlining the conditional logic. Additionally, restructured model list initialization in `_parse_bundle` for improved readability and maintainability. These changes enhance code clarity and reduce redundancy.
* `Improve error handling in model cache retrieval`
Revised the `get` method to ensure it returns an empty dictionary on errors or missing data, avoiding potential `None`-related issues. Added logging for clearer diagnostics when cached model data is unavailable or retrieval fails. This improves reliability and debuggability of the model fetching process.
* Fix cached model data handling by parsing JSON response
Previously, cached model data was returned as a raw string, causing potential issues when using the data. The change ensures the cached data is properly parsed into JSON format before returning, improving reliability and consistency.
* Adjust modelManagerSP rate and Ratekeeper frequency
Reduced the rate for modelManagerSP in services and aligned the Ratekeeper frequency in model_manager.py to 0.1.
* Update model fetcher URL and adjust modelManagerSP rate
Updated the model fetcher URL to point to the correct resource for driving models. Adjusted the rate of modelManagerSP in both its service definition and the corresponding Ratekeeper initialization to 1 Hz for improved consistency.
* Refactor model download logic for clarity and efficiency
Simplify the logic for finding the model to download by combining redundant constructs into a single line. This improves code readability and reduces unnecessary variable assignments.
* Fix cache keys for manual prebuilt actions because they were missing the cache when manually built
* no need to log
* formatting
* revert ci changes
* Refactor and restructure `modeld` to `models` module.
Renamed `modeld` directory to `models` for clarity and consistency. Updated all references and imports to reflect the new structure. This improves maintainability and aligns with naming conventions.
---------
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
* Add script for squash and merge workflow automation
Introduced `squash_and_merge.py` to automate the process of squashing a source branch and merging it into a target branch. The script handles backups, commit message creation, stashing, cleanup, and includes optional push functionality. Provides user prompts and error handling to simplify complex merge workflows.
* temp1
* Switch to PEP 604 style for optional and generic type hints
Replaces `Optional` and `List` with the simpler `X | None` and `list[X]` syntax introduced in Python 3.10. Updated all function signatures accordingly for consistency and modernity. Also made minor string formatting consistency adjustments.
* Fix type annotation for temp_branch variable
Updated the temp_branch variable to include a proper type annotation (`str | None`). This change improves code clarity and aligns with Python typing standards.
* more hints
* add sp flag
* return if sp macro
* controls
* drive stats
* some more
* more
* skip the whole thing
* missed
* more
* more main
* not ready to push yet but sure
* get them icons
* later
* own icons
* Revert "own icons"
This reverts commit e07bd8e6708a46e7ae84a30a23a6d811ad517a59.
* blank icon
* render differently on mac
* static
* set toggle and title space properly
* format
* remove prior objects
* good spacing for ButtonParamControlSP
* more space formatting
* on device fix
* update home wifi prompt
* handle AbstractControlSP_SELECTOR hide events properly
* use sp
* ignore name
* more
* keep spacing
* better flag
* settings button moved
* small cleanup
* move files to sp dir
* remove for now
* developer different icon
* add scrolling to ui test
* Revert "add scrolling to ui test"
This reverts commit c8d1c65d89b238b079b5d0ee0c873b5f7e619749.
* format
* make them virtual
* do we still need this?
* Apply suggestions from code review
Co-authored-by: DevTekVE <devtekve@gmail.com>
* revert for now
* shorter license
---------
Co-authored-by: DevTekVE <devtekve@gmail.com>
* Add CLion run configs and external tools setup
Introduced CLion configuration files for "Build Debug" and "Build Release," along with external tool definitions for Poetry SCons commands. Additionally, commented out `.idea` in `.gitignore` to track necessary project-specific settings.
* rename
* only exclude specific files from gitignore
* wildcard
---------
Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
* Add support for GitHub Actions runner management
Introduce a new process and configuration to manage a GitHub Actions runner. Added a persistent "EnableGithubRunner" parameter and a script to control the runner service. Integrated the feature into the system's process manager logic.
* Restrict GitHub runner usage on metered networks.
This update modifies the `use_github_runner` function to include a check for metered networks using `HARDWARE.get_network_metered()`. This ensures the GitHub runner is not enabled when the network is metered, improving network usage efficiency.
* Add GitHub runner service toggle to developer panel
Introduces a new toggle in the developer panel to enable or disable the GitHub runner service. This provides developers with a convenient way to control the service from the UI.
* translations
* Refactor network condition check for GitHub runner.
Updated `use_github_runner` to include network type in metered network checks. This ensures more accurate validation by considering specific network types when determining metered status.
* Mark as executable
* Update paths and shebangs for consistency across scripts
Modified file paths to align with the new directory structure under `/data/media/0/github` and updated the shebang in `github_runner.sh` for better environment compatibility. Adjusted the `BUILD_DIR` in the GitHub workflow to reflect the new path.
* Fix string translation for GitHub runner parameter text
Added translation support for the GitHub runner service description text. This ensures consistent localization across the UI.
* Remove gitlab_runner.sh from Sunnypilot blacklist.
The script is no longer required to be blacklisted, likely due to updates or changes in its usage. This improves the maintainability of the blacklist by removing unnecessary entries.
* lang stuff
* Update BASE_DIR determination based on mount point
Refactored scripts to dynamically set BASE_DIR depending on whether /data/media is a valid mount point. This ensures compatibility with different environments and improves robustness of path resolution.
* Refactor GitHub runner logic in process_config.
Simplified enabling conditions for the GitHub runner by removing dependency on hardware network checks and adding a logical combination of offroad and runner-related functions. This improves code readability and reduces hardware coupling.
Update version identifier in workflow for staging and release
Appended "-staging" and "-release" to the VERSION variable in the GitHub Actions workflow to clearly distinguish build types. This ensures clarity in versioning for staging and release environments.