* 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>
* 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>
* 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
* 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>
* 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>
* 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>
* 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
* 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>
* 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>
* 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>
* 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>
* init dec
* Update sunnypilot/selfdrive/controls/lib/dynamic_experimental_controller.py
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
* Update sunnypilot/selfdrive/controls/lib/dynamic_experimental_controller.py
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
* fix static test
* ff
* fix static test
* unitee testt
* Refactor test_dynamic_controller and fix formatting issues
Added a new import for STOP_AND_GO_FRAME and corrected a float initialization for v_ego in MockCarState. Also fixed indentation in the test_standstill_detection method for consistency.
* Refactor test indentation for dynamic controller tests
Adjust indentation and formatting in test_dynamic_controller.py to ensure consistency and readability. This change does not alter functionality but improves the maintainability of the test code.
* Migrated to pytest using claude
* Integrate radar parameter into dynamic controller's pytest tests
Added a `has_radar` parameter to the test functions in the dynamic controller's pytest file. This allows each function to run both with and without radar inputs, thus enhancing the coverage of our test cases.
* Disabling unittest file to allow checks on the pipeline to succeed.
Pending to remove this, but leaving it to validate the move to pytest is okay before merging
* Replace unittest with pytest for dynamic controller tests
Migrated dynamic controller tests from unittest to pytest for improved readability and maintainability. Refactored mock setup using pytest fixtures and monkeypatching while preserving test coverage.
* new line...
* Refactor and modularize DynamicExperimentalController logic
Moved DynamicExperimentalController logic and helper functions to a dedicated module for better readability and maintainability. Simplified longitudinal planner logic by introducing reusable methods to manage MPC mode and longitudinal plan publishing. Adjusted file structure for dynamic controller-related components and updated relevant imports.
* Add missing import for messaging in helpers.py
The `messaging` module was added to resolve potential issues with undefined references. This change ensures all required imports are present, improving the reliability and maintainability of the code.
* Format
* Formatting
* rebase fix
* Refactor MpcSource definition and update references.
Moved MpcSource enum into LongitudinalPlanSP for better encapsulation. Updated references in helpers.py to use the new path. This change improves code organization and maintains functionality.
* Format
* Refactor DEC into a dedicated longitudinal planner class
Move Dynamic Experimental Control (DEC) logic to a new `DecLongitudinalPlanner` class for better modularity and maintainability. This simplifies the `LongitudinalPlanner` by delegating DEC-specific behavior and consolidates related methods into a single file. Additionally, redundant code was removed to improve readability and reduce complexity.
* **Refactor DEC module structure for better organization**
Moved DEC-related files from `dec` to `lib` for improved clarity and consistency within the project structure. Updated all relevant import paths to reflect the new locations. Ensured functionality remains unaffected with these changes.
* static test
* static
* had moved to car_state
* cleanup
* some more
* static method
* move around
* more cleanup
* stuff
* into their own
* rename
* check live param
* sync with stock
* type hint
* unused
* smoother trans
* window time
* fix type hint
* pass sm.frame from plannerd
* more fixes
* more
* more explicit
* fix test
* Revert "fix test"
This reverts commit 635b15f2bc.
* Revert "pass sm.frame from plannerd"
This reverts commit a8deaa69b8.
* use internal frame
* update name
* never used
* this is why it was never using DEC
* more logs
* slight cleanup
* remove to fail test
* update name
* more
* rename
* move around
* explicit type hints
* move to constants py
* Revert "explicit type hints"
This reverts commit c205497b
* more
* don't set to exp mode initial if DEC is active
* use walrus for None
* Revert "use walrus for None"
This reverts commit 5f2396d490.
* fix wrong typing and variable name
* use walrus (needs cleanup)
* fix tests
* revert smooht lead for now
* dec: how good is FirstOrderFilter?
* Update dec.py
* dec: faster ?
* Revert "dec: faster ?"
This reverts commit 40259cd22a.
* Revert "Update dec.py"
This reverts commit 3f29ccbd99.
* Revert "dec: how good is FirstOrderFilter?"
This reverts commit 01e06df542.
* Update slow-down logic and constants for improved behavior
Adjust the slowdown scaling factor and anomaly handling to refine behavior without abrupt resets. Modify constants to increase window size and adjust probabilities and distances for smoother adaptation. Update version to reflect the new changes.
* Fix lead detection fallback for weighted average check.
Add a fallback value of -1 when computing the weighted average to prevent errors caused by invalid or None values. This ensures robust lead detection and avoids potential crashes or undefined behavior.
* visuals for DEC
* try this
* add opacity
* should be active and dimmer
* even dimmer
* Update dec.py
* Update constants.py
* use another method for drawing
* migrate to sp only
* fix
* init
---------
Co-authored-by: rav4kumar <meetkumardesai@gmail.com>
Co-authored-by: Kumar <36933347+rav4kumar@users.noreply.github.com>
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Co-authored-by: DevTekVE <devtekve@gmail.com>
* init dec
* Update sunnypilot/selfdrive/controls/lib/dynamic_experimental_controller.py
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
* Update sunnypilot/selfdrive/controls/lib/dynamic_experimental_controller.py
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
* fix static test
* ff
* fix static test
* unitee testt
* Refactor test_dynamic_controller and fix formatting issues
Added a new import for STOP_AND_GO_FRAME and corrected a float initialization for v_ego in MockCarState. Also fixed indentation in the test_standstill_detection method for consistency.
* Refactor test indentation for dynamic controller tests
Adjust indentation and formatting in test_dynamic_controller.py to ensure consistency and readability. This change does not alter functionality but improves the maintainability of the test code.
* Migrated to pytest using claude
* Integrate radar parameter into dynamic controller's pytest tests
Added a `has_radar` parameter to the test functions in the dynamic controller's pytest file. This allows each function to run both with and without radar inputs, thus enhancing the coverage of our test cases.
* Disabling unittest file to allow checks on the pipeline to succeed.
Pending to remove this, but leaving it to validate the move to pytest is okay before merging
* Replace unittest with pytest for dynamic controller tests
Migrated dynamic controller tests from unittest to pytest for improved readability and maintainability. Refactored mock setup using pytest fixtures and monkeypatching while preserving test coverage.
* new line...
* Refactor and modularize DynamicExperimentalController logic
Moved DynamicExperimentalController logic and helper functions to a dedicated module for better readability and maintainability. Simplified longitudinal planner logic by introducing reusable methods to manage MPC mode and longitudinal plan publishing. Adjusted file structure for dynamic controller-related components and updated relevant imports.
* Add missing import for messaging in helpers.py
The `messaging` module was added to resolve potential issues with undefined references. This change ensures all required imports are present, improving the reliability and maintainability of the code.
* Format
* Formatting
* rebase fix
* Refactor MpcSource definition and update references.
Moved MpcSource enum into LongitudinalPlanSP for better encapsulation. Updated references in helpers.py to use the new path. This change improves code organization and maintains functionality.
* Format
* Refactor DEC into a dedicated longitudinal planner class
Move Dynamic Experimental Control (DEC) logic to a new `DecLongitudinalPlanner` class for better modularity and maintainability. This simplifies the `LongitudinalPlanner` by delegating DEC-specific behavior and consolidates related methods into a single file. Additionally, redundant code was removed to improve readability and reduce complexity.
* **Refactor DEC module structure for better organization**
Moved DEC-related files from `dec` to `lib` for improved clarity and consistency within the project structure. Updated all relevant import paths to reflect the new locations. Ensured functionality remains unaffected with these changes.
* static test
* static
* had moved to car_state
* cleanup
* some more
* static method
* move around
* more cleanup
* stuff
* into their own
* rename
* check live param
* sync with stock
* type hint
* unused
* smoother trans
* window time
* fix type hint
* pass sm.frame from plannerd
* more fixes
* more
* more explicit
* fix test
* Revert "fix test"
This reverts commit 635b15f2bc.
* Revert "pass sm.frame from plannerd"
This reverts commit a8deaa69b8.
* use internal frame
---------
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Co-authored-by: DevTekVE <devtekve@gmail.com>
Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
* 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>
* 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 6d64a4dd9c.
* allow in all
* Revert "allow in all"
This reverts commit 6375f14891.
* 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 a37c1d26fe.
* base
* Reapply "has multiple lists"
This reverts commit d1cd8dcc81.
* 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>
* No /dev/shm on MacOS so we go to tmp instead given that the /dev/shm makes tests not really work fine on mac
* Cleanups
Fix cereal messaging tests
* keep msgq stock
More shm updates for macos
* typo
* fix return
* Semicolon...