Compare commits

..

216 Commits

Author SHA1 Message Date
DevTekVE a77d1f7eb0 Add ButtonHoldTracker for button hold logic and tests
Introduce a new `ButtonHoldTracker` class to manage button hold durations, replacing manual timer handling in `ExperimentalSwitcher`. Updated `ExperimentalSwitcher` to leverage this implementation for cleaner and more modular code. Added comprehensive unit tests for both `ButtonHoldTracker` and `ExperimentalSwitcher` to ensure functionality and edge case coverage.
2025-01-19 12:58:29 +01:00
Jason Wen 6eb6af5785 Merge branch 'dec-redo' into master-dev-c3-new 2025-01-19 03:39:30 -05:00
Jason Wen 7471bd4029 init 2025-01-19 03:18:05 -05:00
Jason Wen 767f057112 Merge branch 'master-new' into dec-redo 2025-01-19 02:55:46 -05:00
Jason Wen 6ef47dafcf ui: display DEC status via mode button (#592) 2025-01-19 02:54:58 -05:00
Jason Wen 3f6ac7e77a Merge branch 'ui-model-selector-rich' into master-dev-c3-new
# Conflicts:
#	opendbc_repo
#	panda
2025-01-19 02:51:06 -05:00
Jason Wen d8040eea3f Merge branch 'master-new' into ui-model-selector-rich 2025-01-19 02:50:22 -05:00
Jason Wen 155f9ee3b9 bump submodules 2025-01-19 02:50:02 -05:00
Jason Wen d223135ee3 Merge branch 'master-new' into ui-model-selector-rich 2025-01-19 02:49:13 -05:00
Jason Wen 073887221d MADS: Honda: controls, events, and cluster updates (#589)
* MADS: Honda: Cluster icons and events updates

* bump opendbc

* nuke them all to test

* try this

* bring them back

* fix icons

* MADS: Honda: Allow steering

* rename

* match stock

* bump submodules
2025-01-19 02:48:53 -05:00
Jason Wen 8f29ddba45 ui: Model Selector: display prompt with rich text widget 2025-01-19 02:48:32 -05:00
Jason Wen b7c3072a4c Merge branch 'mads-honda-states' into master-dev-c3-new 2025-01-18 23:57:32 -05:00
Jason Wen 3cba24f93a MADS: Honda: Allow steering 2025-01-18 23:57:05 -05:00
Jason Wen f2edd589ba fix 2025-01-18 22:04:30 -05:00
Jason Wen bf0a7b4494 migrate to sp only 2025-01-18 22:02:40 -05:00
Jason Wen 19b96003dc use another method for drawing 2025-01-18 21:51:49 -05:00
Kumar 10ee25d199 Update constants.py 2025-01-18 19:48:02 -07:00
Kumar cd6fb642bd Update dec.py 2025-01-18 19:46:19 -07:00
Jason Wen 3d35164287 even dimmer 2025-01-18 21:43:14 -05:00
Jason Wen a9ca9bbdf8 should be active and dimmer 2025-01-18 21:35:27 -05:00
Jason Wen 0737f311b8 add opacity 2025-01-18 21:31:01 -05:00
Jason Wen dc45d3043c try this 2025-01-18 21:22:55 -05:00
Jason Wen 2eefd0aaf5 visuals for DEC 2025-01-18 21:12:19 -05:00
Jason Wen cb9d92dc3c Merge branch 'master-new' into dec-redo 2025-01-18 20:55:35 -05:00
Jason Wen 2525fdc350 Merge branch 'mads-honda-states' into master-dev-c3-new 2025-01-18 20:41:18 -05:00
Jason Wen 9eb36a0b7e fix icons 2025-01-18 20:41:01 -05:00
Jason Wen b5a5d94a2c bring them back 2025-01-18 20:39:05 -05:00
Jason Wen 36453f2014 Sync: commaai/openpilot:master into sunnypilot/sunnypilot:master-new (#590) 2025-01-18 19:19:51 -05:00
Jason Wen 2792ce472a Merge branch 'upstream/openpilot/master' into sync-20240118
# Conflicts:
#	cereal/custom.capnp
#	cereal/log.capnp
2025-01-18 18:54:56 -05:00
Jason Wen a93dc0047d Merge branch 'mads-honda-states' into master-dev-c3-new 2025-01-18 16:35:34 -05:00
Jason Wen 25d195df72 try this 2025-01-18 16:35:27 -05:00
Jason Wen 3fc2f70eb8 nuke them all to test 2025-01-18 16:34:32 -05:00
Adeeb Shihadeh ae58be87bc cereal fork compatibility (#34414)
* more custom

* cleanup

* lil more
2025-01-18 13:29:02 -08:00
Adeeb Shihadeh f0257a847d Update README.md 2025-01-18 13:27:11 -08:00
Jason Wen 64058c4b7c Merge branch 'mads-honda-states' into master-dev-c3-new 2025-01-18 15:48:12 -05:00
Jason Wen 3044aa6133 bump opendbc 2025-01-18 15:48:01 -05:00
Jason Wen f39f76182a Merge branch 'mads-honda-states' into master-dev-c3-new 2025-01-18 15:45:07 -05:00
Jason Wen 15567bf605 Merge branch 'master-new' into master-dev-c3-new 2025-01-18 15:45:02 -05:00
Jason Wen 3b090e0b01 Merge branch 'master-new' into mads-honda-states 2025-01-18 15:44:51 -05:00
Jason Wen df3e848965 MADS: Honda: Cluster icons and events updates 2025-01-18 15:43:46 -05:00
Jason Wen 4e6cc1f3bc ui: Hide regulatory button on non-comma devices (#585)
Co-authored-by: DevTekVE <devtekve@gmail.com>
2025-01-18 20:22:15 +00:00
DevTekVE b3e3d1b384 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.
2025-01-18 20:48:06 +01:00
DevTekVE b13356d267 Merge branch 'master-new' into dec-redo 2025-01-18 20:41:04 +01:00
Calvin Park 5509850986 Install user SecOCKey to params (#34401)
* Install user SecOCKey to params

* Move it to launch_chffrplus.sh/launch

* Move it to card.py

* Basic error check

* Catch Exception to suppress the linter

* Make it local to secOC section
2025-01-18 11:25:07 -08:00
Dean Lee 7a1bf26aa5 ui: prevent device pairing if no internet or system time is invalid (#34403)
* gate pairing device if system time is invalid

* update translations

* Check for internet connectivity

* Update selfdrive/ui/qt/widgets/prime.cc

* Update selfdrive/ui/qt/widgets/prime.cc

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2025-01-18 11:18:45 -08:00
rav4kumar 0089096d12 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.
2025-01-18 11:26:02 -07:00
rav4kumar 3d135f9831 Revert "dec: how good is FirstOrderFilter?"
This reverts commit 01e06df542.
2025-01-18 11:12:10 -07:00
rav4kumar a219046981 Revert "Update dec.py"
This reverts commit 3f29ccbd99.
2025-01-18 11:12:03 -07:00
rav4kumar 2c9ffdbf03 Revert "dec: faster ?"
This reverts commit 40259cd22a.
2025-01-18 11:11:57 -07:00
DevTekVE f5764c2edf ci: release drafter sort by default (time)
Using sort by title made things look out of order. If we want to organize them a bit furter, we can do that manually before moving forward with a release.
2025-01-18 15:16:43 +01:00
DevTekVE 027023a7ff CI: Update release drafter config (#588)
* Remove contributors section from release drafter template

The contributors section has been removed to simplify the release notes format. This change ensures a cleaner and more focused release draft template.

* Update release-drafter config with new labels and options

Added 'exclude-labels' to filter out 'no-changelog' items and improved category settings with 'collapse-after'. Introduced 'sort-by' for title-based sorting to enhance organization.
2025-01-18 15:10:13 +01:00
DevTekVE da980312d9 Add Release Drafter configuration and workflow (#586)
* Add configuration files for Release Drafter

This commit introduces two configuration files for the Release Drafter. These include release-drafter.yml which will help categorize changes into features, bug fixes, and maintenance, and workflows/release-drafter.yml which defines a GitHub actions workflow to update release drafts.

* Work on both master branches

* Meh static and i dont need this tbh
2025-01-18 14:29:20 +01:00
Shane Smiskol 895c78b09a Revert "bump msgq (#34410)"
This reverts commit 4dc95f6064.
2025-01-17 21:17:05 -08:00
Shane Smiskol 4dc95f6064 bump msgq (#34410)
* bump msgq

* bump
2025-01-17 20:39:14 -08:00
Jason Wen 5014b42650 Merge branch 'ui-regulatory-hide' into master-dev-c3-new 2025-01-17 21:48:20 -05:00
Jason Wen c1f897168a ui: Hide regulatory button on non-comma devices 2025-01-17 21:45:51 -05:00
Jason Wen 1a3f86a542 ui: Transition offroad state for Device panel buttons (#584) 2025-01-18 02:38:29 +00:00
Jason Wen 301174b19a Merge branch 'ui-device-offroad' into master-dev-c3-new 2025-01-17 21:29:58 -05:00
Jason Wen 1b139c4ca1 ui: Transition offroad state for Device panel buttons 2025-01-17 21:29:46 -05:00
Jason Wen 745e7b0b28 Merge branch 'master-new' into master-dev-c3-new 2025-01-17 21:23:34 -05:00
Jason Wen ac255742b6 MADS: Toyota: remove LKAS button support (#583)
* MADS: Toyota: remove LKAS button support

* remove mads button test

* bump submodules

* bump submodules

* test_processes: update ref logs to 4b12690
2025-01-17 19:22:50 -07:00
Jason Wen 1f328c9fda Revert "ui: driver view window should use uiStateSP"
This reverts commit c08b18936d.
2025-01-17 15:02:49 -05:00
Jason Wen eab69c0f3d Revert "try this"
This reverts commit bd8a93af8b.
2025-01-17 15:02:47 -05:00
Jason Wen 97fda2f918 Revert "more"
This reverts commit 2f5f708c2b.
2025-01-17 15:02:44 -05:00
Jason Wen 03e10db82e Merge branch 'ui-dm-cam-freeze' into master-dev-c3-new 2025-01-17 14:59:14 -05:00
Jason Wen 2f5f708c2b more 2025-01-17 14:59:06 -05:00
Jason Wen 413fc15cf8 Merge branch 'ui-dm-cam-freeze' into master-dev-c3-new 2025-01-17 14:52:54 -05:00
Jason Wen bd8a93af8b try this 2025-01-17 14:52:42 -05:00
Jason Wen 928bec2acc Merge branch 'ui-dm-cam-freeze' into master-dev-c3-new 2025-01-17 14:37:39 -05:00
Jason Wen c08b18936d ui: driver view window should use uiStateSP 2025-01-17 14:37:23 -05:00
Jason Wen d15d56b161 sentry: log fingerprints and save exceptions (#581)
* sentry: log fingerprints and save exceptions

* no point

* remove unused imports

* use deprecated

* have to do this

* remove

* cap

* no duplicate

* typo

* don't use deprecated method

* wrap them around

* do this instead

* new endpoint

* no need
2025-01-17 17:22:45 +00:00
Jason Wen 5f94110b7a no need 2025-01-17 12:12:51 -05:00
Jason Wen bca0e7862f Merge branch 'sentry-sp' into master-dev-c3-new 2025-01-17 12:03:17 -05:00
Jason Wen 45c47d0c48 new endpoint 2025-01-17 12:01:11 -05:00
Jason Wen ab8dd45cda do this instead 2025-01-17 10:57:06 -05:00
Jason Wen 66eb3a2532 wrap them around 2025-01-17 10:47:25 -05:00
Jason Wen 59b68e42f6 don't use deprecated method 2025-01-17 10:29:17 -05:00
Jason Wen 976c9ac9bf typo 2025-01-17 02:40:27 -05:00
Jason Wen c65c8a535c no duplicate 2025-01-17 02:39:51 -05:00
Jason Wen 5e79eb774b Merge branch 'sentry-sp' into master-dev-c3-new 2025-01-17 02:06:22 -05:00
Jason Wen 0735fd5553 Merge branch 'dec-redo' into master-dev-c3-new 2025-01-17 02:06:17 -05:00
Jason Wen 5ad8b46158 cap 2025-01-17 02:04:59 -05:00
Jason Wen 3f4e372c34 remove 2025-01-17 01:55:15 -05:00
Jason Wen 7fde68ecf9 have to do this 2025-01-17 01:48:43 -05:00
Jason Wen df1ef23280 use deprecated 2025-01-17 01:41:54 -05:00
Jason Wen 378eb8a4d2 remove unused imports 2025-01-17 01:39:15 -05:00
rav4kumar 40259cd22a dec: faster ? 2025-01-16 23:25:55 -07:00
Kumar 3f29ccbd99 Update dec.py 2025-01-16 23:25:45 -07:00
Jason Wen 189e883116 no point 2025-01-17 01:23:04 -05:00
rav4kumar 01e06df542 dec: how good is FirstOrderFilter? 2025-01-16 23:16:54 -07:00
rav4kumar b1e8824187 revert smooht lead for now 2025-01-16 23:16:00 -07:00
Jason Wen cb1240846b sentry: log fingerprints and save exceptions 2025-01-17 01:15:22 -05:00
Shane Smiskol c515021576 joystick: fix long control state 2025-01-16 16:07:56 -08:00
Shane Smiskol 733206fdd9 fix joystick 2025-01-16 16:06:11 -08:00
Jason Wen fa6ee806f5 Merge branch 'long-distance-btn-exp-mode' into master-dev-c3-new 2025-01-16 18:04:09 -05:00
Jason Wen fefb6a3a25 Merge branch 'dec-redo' into master-dev-c3-new 2025-01-16 18:04:03 -05:00
Jason Wen 13cb725652 Merge branch 'master-new' into long-distance-btn-exp-mode 2025-01-16 18:03:35 -05:00
Jason Wen b219e07ac1 Merge branch 'master-new' into dec-redo
# Conflicts:
#	selfdrive/car/card.py
2025-01-16 18:03:13 -05:00
Jason Wen 429b461eae Sync: commaai/openpilot:master into sunnypilot/sunnypilot:master-new (#580) 2025-01-16 18:00:26 -05:00
Shane Smiskol 1d919221e4 Update build.py 2025-01-16 14:52:26 -08:00
Shane Smiskol 37b4e61b00 Allow brake hold (#34384)
* allow brake hold

* rev
2025-01-16 14:22:02 -08:00
Jason Wen ce3c55c691 test_processes: update ref logs to afde277 2025-01-16 17:13:53 -05:00
Jason Wen afde2771f8 Merge branch 'upstream/openpilot/master' into sync-20250116
# Conflicts:
#    .github/workflows/ui_preview.yaml
#    opendbc_repo
#    panda
#    release/release_files.py
#    selfdrive/test/process_replay/ref_commit
#    selfdrive/ui/tests/test_ui/run.py
2025-01-16 17:12:53 -05:00
Jason Wen 90d38a7968 fix tests 2025-01-16 14:24:27 -05:00
Jason Wen bb83e1fe8f Merge branch 'dec-redo' into master-dev-c3-new 2025-01-16 12:09:28 -05:00
Jason Wen baf0506033 use walrus (needs cleanup) 2025-01-16 12:08:15 -05:00
Jason Wen a3db53044e fix wrong typing and variable name 2025-01-16 12:00:20 -05:00
Jason Wen 8673c31e46 Revert "use walrus for None"
This reverts commit 5f2396d490.
2025-01-16 11:59:13 -05:00
Jason Wen 5f2396d490 use walrus for None 2025-01-16 11:56:07 -05:00
Shane Smiskol 0539df7685 bring back ui.py (#34396)
* bring back uipy

* fix it

* fix
2025-01-15 18:50:44 -08:00
Adeeb Shihadeh a2ced8c8eb Log satellite count in GpsLocationData (#34395)
* Log satellite count in GpsLocationData

* update refs

* forgot to build
2025-01-15 16:53:39 -08:00
Shane Smiskol 69d33ac11d Toyota: allow brake hold (#34394)
toyota okay
2025-01-15 15:03:22 -08:00
Maxime Desroches 707a845218 fix uv (#34393)
uv fix
2025-01-15 14:23:58 -08:00
Adeeb Shihadeh db61cfb2c1 Update RELEASES.md 2025-01-15 14:20:54 -08:00
Adeeb Shihadeh 3f629e97eb release this month 2025-01-15 13:54:58 -08:00
Jason Wen e2ff34417f Merge branch 'dec-redo' into master-dev-c3-new 2025-01-15 15:12:39 -05:00
Jason Wen 4ac4fc855f don't set to exp mode initial if DEC is active 2025-01-15 15:12:13 -05:00
Jason Wen cea20d1945 Merge branch 'long-distance-btn-exp-mode' into master-dev-c3-new 2025-01-15 13:41:45 -05:00
Jason Wen 353aa611e7 Merge branch 'dec-redo' into master-dev-c3-new
# Conflicts:
#	sunnypilot/selfdrive/controls/lib/longitudinal_planner.py
2025-01-15 13:41:22 -05:00
Jason Wen 391a3160a0 no need 2025-01-15 11:00:08 -05:00
Jason Wen 6b4ef00ae6 fix 2025-01-15 10:57:51 -05:00
Jason Wen d937062724 more 2025-01-15 01:51:22 -05:00
Jason Wen f94eeb9780 Revert "explicit type hints"
This reverts commit c205497b
2025-01-15 01:46:31 -05:00
Jason Wen c6474fc3ad move to constants py 2025-01-15 01:45:29 -05:00
Jason Wen d7f0e8dd04 unused 2025-01-15 01:28:15 -05:00
Jason Wen f3d94fc291 Longitudinal: Distance button hold to toggle Chill/Experimental Mode 2025-01-15 01:26:23 -05:00
Shane Smiskol 2258ea310d Hyundai: match cancel button panda safety logic (#34390)
* rising edge

* should work

* TODO

* fix
2025-01-14 21:37:55 -08:00
Jason Wen c205497b15 explicit type hints 2025-01-15 00:18:47 -05:00
Shane Smiskol 38fad751cb card: fix cruise speed initialization w/ buttons (#34386)
* fix initialize w/ buttons

* what

* comment
2025-01-14 19:58:22 -08:00
Shane Smiskol b3fc407538 VW: switch to common pcmCruise check (#34389)
Update car_specific.py
2025-01-14 19:54:28 -08:00
Shane Smiskol 3d38b139bc card: vcruise all in one place (#34387)
* no reason to not be here

* oh this was off by a frame!

* ref
2025-01-14 19:37:44 -08:00
Jason Wen 45f3c70596 move around 2025-01-14 21:55:56 -05:00
Shane Smiskol a1d81e63e1 Fix missing visual car dash alerts (#34385)
* fix missing visual dash alerts

* update refs
2025-01-14 18:52:40 -08:00
Jason Wen 21793721cc rename 2025-01-14 21:29:42 -05:00
Jason Wen d01b02b185 more 2025-01-14 20:50:57 -05:00
Kacper Rączy 2054495e79 process_replay: add cast in migrate_longitudinalPlan (#34383)
* Cast

* Something

* Remove newline
2025-01-15 01:37:28 +00:00
Kacper Rączy ea4a127ab8 process_replay: ignore unknown members in the migration code (#34382)
* Fix the migration for the events

* clean up

clean up

clean up

* no continue

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2025-01-15 00:12:48 +00:00
Sammohana 8eebce75ac Getting rid of openpilot.common.numpy_fast (#34368)
* Got rid openpilot.common.numpy_fast

* fixed some data type erros

* importing numpy instead of importing specific functions

* fixing some numpy importing mistakes

* Update selfdrive/car/cruise.py

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2025-01-14 14:52:56 -08:00
Jason Wen f4af0aa422 update name 2025-01-14 16:42:41 -05:00
commaci-public c54cd4569a Toyota: remove longitudinal derivative (#34378)
* Update Python packages

* update refs

---------

Co-authored-by: Vehicle Researcher <user@comma.ai>
Co-authored-by: Shane Smiskol <shane@smiskol.com>
2025-01-14 13:32:09 -08:00
Jason Young f771ddac88 PlotJuggler: Layout for debugging locationdTemporaryError (#34381)
* PlotJuggler: layout for debugging locationd

* not needed, and codespell doesn't like it
2025-01-14 11:12:05 -08:00
Jason Wen d3ecdbb850 fix dec engagement 2025-01-14 00:23:46 -05:00
Jason Wen 1f39c4ccfb remove to fail test 2025-01-14 00:04:48 -05:00
Jason Wen a56e1e6e69 slight cleanup 2025-01-14 00:01:31 -05:00
Jason Wen e630546250 more logs 2025-01-13 23:57:21 -05:00
Jason Wen 85faddc7af this is why it was never using DEC 2025-01-13 23:46:38 -05:00
Jason Wen 223abdc536 never used 2025-01-13 23:26:07 -05:00
Jason Wen dd12f86804 Merge branch 'master-new' into dec-redo
# Conflicts:
#	common/params.cc
2025-01-13 23:11:06 -05:00
Dean Lee 0e7c697bad raylib: revert auto fit screen size (#34380)
revert auto fit screen size
2025-01-13 19:45:13 -08:00
Adeeb Shihadeh 57abd8b0c2 Remove release files (conceptually) (#34379)
* Remove release files (conceptually)

* fix
2025-01-13 19:31:21 -08:00
Dean Lee 1ab98e38e5 raylib: refactor to implement new App class (#34375)
refactor to implement new App class
2025-01-13 14:52:03 -08:00
commaci-public 4d714113d1 [bot] Update Python packages (#34376)
* Update Python packages

* time -> time_helpers

---------

Co-authored-by: Vehicle Researcher <user@comma.ai>
Co-authored-by: Maxime Desroches <desroches.maxime@gmail.com>
2025-01-13 09:38:17 -08:00
ugtthis 7b09d08764 CI: Add missing uppercase_keyboard UI view (#34347)
* add-uppercase-preview

* testing-UI-on-fork

* change back

* add-my-branch

* needs to see sha from fork for test

* fix missing sha

* change back

* get correct named artifact

* try this

* experimenting coordinates

* try these coordinates

* try these coordinates

* draws circles to see touches - changes coordinates

* try these changes

* better coordinates

* click is more centered

* try again

* revert back

* revert these too

* last revert...
2025-01-13 09:05:22 -08:00
Jason Wen dff2a5796d update name 2025-01-13 11:41:11 -05:00
Jason Wen 70918ccff3 Merge branch 'master-new' into dec-redo 2025-01-13 10:23:12 -05:00
ugtthis 71951566c5 Keyboard: add missing control btns to uppercase (#34344)
* add-slash-to uppercase

* Trigger UI preview workflow
2025-01-13 01:22:04 -08:00
Shane Smiskol db2032c398 Move uds.py (#34374)
* rm uds pt. 1

* rm uds pt. 2

* imports
2025-01-13 00:54:10 -08:00
Jason Wen f6ef036158 use internal frame 2025-01-12 18:57:22 -05:00
Jason Wen 67692babdc Revert "pass sm.frame from plannerd"
This reverts commit a8deaa69b8.
2025-01-12 18:55:38 -05:00
Jason Wen ea6cd3429b Revert "fix test"
This reverts commit 635b15f2bc.
2025-01-12 18:55:33 -05:00
Jason Wen 635b15f2bc fix test 2025-01-12 18:54:17 -05:00
Jason Wen b42c060b2e more explicit 2025-01-12 18:37:47 -05:00
Jason Wen 1c1ef06489 more 2025-01-12 18:28:20 -05:00
Jason Wen 1b2586914f more fixes 2025-01-12 18:24:58 -05:00
Jason Wen a8deaa69b8 pass sm.frame from plannerd 2025-01-12 18:20:06 -05:00
Jason Wen c34a21980e fix type hint 2025-01-12 18:13:52 -05:00
Adeeb Shihadeh 74ed6c5657 oops need raw 2025-01-12 15:07:18 -08:00
rav4kumar 6e86d242cd window time 2025-01-12 16:03:17 -07:00
Adeeb Shihadeh 99bb7da850 third_party: add raygui (#34369) 2025-01-12 15:02:30 -08:00
rav4kumar 7113d4a76a smoother trans 2025-01-12 15:54:50 -07:00
Jason Wen 5074881d6d unused 2025-01-12 17:40:21 -05:00
Jason Wen bf3350b7f2 type hint 2025-01-12 17:38:49 -05:00
Jason Wen c64b679704 sync with stock 2025-01-12 17:16:34 -05:00
Jason Wen f645e2cdb0 check live param 2025-01-12 17:12:31 -05:00
Jason Wen 426d41a0a7 rename 2025-01-12 16:56:57 -05:00
Jason Wen de305a81d5 into their own 2025-01-12 16:52:40 -05:00
Jason Wen e4c29a2c58 stuff 2025-01-12 16:50:16 -05:00
Jason Wen c3fde45000 more cleanup 2025-01-12 16:48:44 -05:00
Jason Wen e7d27f0bb9 move around 2025-01-12 16:46:43 -05:00
Jason Wen 12981e02f7 static method 2025-01-12 16:46:15 -05:00
Jason Wen e1cf216c89 some more 2025-01-12 16:44:54 -05:00
Jason Wen cc507a5cd9 cleanup 2025-01-12 16:40:07 -05:00
rav4kumar 87ca1513f4 had moved to car_state 2025-01-12 14:29:22 -07:00
rav4kumar 1d422ce5cf static 2025-01-12 14:06:50 -07:00
rav4kumar cb04017945 Merge branch 'dec-new-refactored-rebased-no-ui' of https://github.com/sunnypilot/sunnypilot into dec-new-refactored-rebased-no-ui 2025-01-12 13:49:17 -07:00
rav4kumar 7d6c9d1a8c static test 2025-01-12 13:48:08 -07:00
Jason Wen ba6559d32a Merge branch 'master-new' into dec-new-refactored-rebased-no-ui 2025-01-12 15:40:47 -05:00
DevTekVE c0c74e3761 **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.
2025-01-12 21:03:38 +01:00
Adeeb Shihadeh d35ef3b3d5 swaglog: fix locale dependence (#34367) 2025-01-12 11:57:26 -08:00
DevTekVE 898f5b89ed 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.
2025-01-12 20:51:35 +01:00
Dean Lee 47b13f54f6 encoderd: refactor VideoEncoder::publisher_publish to standardize member variable access (#34342)
remove redundant pointer parameter
2025-01-12 11:38:20 -08:00
Dean Lee 1068779294 modeld: properly release OpenCL context in __dealloc__ method (#34353)
release OpenCL context in __dealloc__
2025-01-12 10:15:26 -08:00
Adeeb Shihadeh 55cdf5ad7c release soon 2025-01-12 08:58:53 -08:00
DevTekVE f861e8d678 Format 2025-01-12 16:40:43 +01:00
DevTekVE fd6ec85e20 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.
2025-01-12 16:40:20 +01:00
DevTekVE 4a46bccc20 rebase fix 2025-01-12 16:33:23 +01:00
DevTekVE 73e658bf8c Formatting 2025-01-12 16:33:23 +01:00
DevTekVE ec25ca070a Format 2025-01-12 16:33:23 +01:00
DevTekVE 84b6af094f 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.
2025-01-12 16:33:23 +01:00
DevTekVE 55b6eae92e 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.
2025-01-12 16:33:22 +01:00
DevTekVE 760e7e847a new line... 2025-01-12 16:33:22 +01:00
DevTekVE 4b64f85f85 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.
2025-01-12 16:33:22 +01:00
DevTekVE 8dd750fd83 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
2025-01-12 16:33:21 +01:00
DevTekVE 5e62ccad12 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.
2025-01-12 16:33:21 +01:00
DevTekVE 2fb0545344 Migrated to pytest using claude 2025-01-12 16:33:21 +01:00
DevTekVE 684431e3f6 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.
2025-01-12 16:33:21 +01:00
DevTekVE ba9fbd52d7 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.
2025-01-12 16:33:20 +01:00
rav4kumar 1dfaf347f8 unitee testt 2025-01-12 16:33:20 +01:00
rav4kumar 91922fb9b6 fix static test 2025-01-12 16:33:20 +01:00
rav4kumar c4ed5a4617 ff 2025-01-12 16:33:20 +01:00
rav4kumar 90435f0a92 fix static test 2025-01-12 16:33:19 +01:00
Kumar 3c434e78e2 Update sunnypilot/selfdrive/controls/lib/dynamic_experimental_controller.py
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
2025-01-12 16:33:19 +01:00
Kumar 75f6f73798 Update sunnypilot/selfdrive/controls/lib/dynamic_experimental_controller.py
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
2025-01-12 16:33:19 +01:00
rav4kumar c5524c6d42 init dec 2025-01-12 16:33:19 +01:00
Cameron Clough 08779941e5 loggerd: typing and remove unused default arg (#34349) 2025-01-09 22:12:10 +00:00
Cameron Clough f761f53205 deleter cleanups (#34345) 2025-01-09 20:00:45 +00:00
153 changed files with 1745 additions and 184 deletions
+43
View File
@@ -0,0 +1,43 @@
exclude-labels:
- 'no-changelog'
categories:
- title: '🚀 Features'
labels:
- 'feature'
- 'enhancement'
- title: '🐛 Bug Fixes'
collapse-after: 5
labels:
- 'fix'
- 'bugfix'
- 'bug'
- title: '🧰 Maintenance'
collapse-after: 5
label: 'chore'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: '\<*_&'
replacers:
- search: '/[Ss][Uu][Nn][Nn][Yy][Pp][Ii][Ll][Oo][Tt]/g'
replace: 'sunnypilot'
- search: '/\b[Ss][Pp]\b/g'
replace: 'SP'
version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
patch:
labels:
- 'patch'
default: patch
name-template: 'v$RESOLVED_VERSION 🚀'
tag-template: 'v$RESOLVED_VERSION'
version-template: "0.$MAJOR.$MINOR.$PATCH" # The day OP becomes v1, we need to bump this
tag-prefix: "v0." # The day OP becomes v1, we need to bump this
prerelease-identifier: "staging"
template: |
## Changes
$CHANGES
+29
View File
@@ -0,0 +1,29 @@
name: Release Drafter
on:
push:
branches:
- master-new
- master
tags:
- 'v*'
pull_request_target:
types: [opened, reopened, synchronize]
workflow_dispatch:
permissions:
contents: read
jobs:
update_release_draft:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v6
with:
config-name: release-drafter.yml
prerelease: ${{ !startsWith(github.ref, 'refs/tags/v') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+44
View File
@@ -29,6 +29,50 @@ then means breaking backwards-compatibility with all old logs of your fork. So w
[custom.capnp](custom.capnp) that we will leave empty in mainline cereal/openpilot. **If you only modify those, you can ensure your
fork will remain backwards-compatible with all versions of mainline openpilot and your fork.**
An example of compatible changes:
```diff
diff --git a/cereal/custom.capnp b/cereal/custom.capnp
index 3348e859e..3365c7b98 100644
--- a/cereal/custom.capnp
+++ b/cereal/custom.capnp
@@ -10,7 +10,11 @@ $Cxx.namespace("cereal");
# DO rename the structs
# DON'T change the identifier (e.g. @0x81c2f05a394cf4af)
-struct CustomReserved0 @0x81c2f05a394cf4af {
+struct SteeringInfo @0x81c2f05a394cf4af {
+ active @0 :Bool;
+ steeringAngleDeg @1 :Float32;
+ steeringRateDeg @2 :Float32;
+ steeringAccelDeg @3 :Float32;
}
struct CustomReserved1 @0xaedffd8f31e7b55d {
diff --git a/cereal/log.capnp b/cereal/log.capnp
index 1209f3fd9..b189f58b6 100644
--- a/cereal/log.capnp
+++ b/cereal/log.capnp
@@ -2558,14 +2558,14 @@ struct Event {
# DO change the name of the field
# DON'T change anything after the "@"
- customReservedRawData0 @124 :Data;
+ rawCanData @124 :Data;
customReservedRawData1 @125 :Data;
customReservedRawData2 @126 :Data;
# DO change the name of the field and struct
# DON'T change the ID (e.g. @107)
# DON'T change which struct it points to
- customReserved0 @107 :Custom.CustomReserved0;
+ steeringInfo @107 :Custom.SteeringInfo;
customReserved1 @108 :Custom.CustomReserved1;
customReserved2 @109 :Custom.CustomReserved2;
customReserved3 @110 :Custom.CustomReserved3;
```
---
Example
---
```python
+47 -3
View File
@@ -7,7 +7,9 @@ $Cxx.namespace("cereal");
# These structs are guaranteed to remain reserved and empty in mainline
# cereal, so use these if you want custom events in your fork.
# you can rename the struct, but don't change the identifier
# DO rename the structs
# DON'T change the identifier (e.g. @0x81c2f05a394cf4af)
struct SelfdriveStateSP @0x81c2f05a394cf4af {
mads @0 :ModularAssistiveDrivingSystem;
@@ -64,7 +66,7 @@ struct ModelManagerSP @0xaedffd8f31e7b55d {
progress @1 :Float32;
eta @2 :UInt32;
}
enum Runner {
snpe @0;
tinygrad @1;
@@ -82,7 +84,19 @@ struct ModelManagerSP @0xaedffd8f31e7b55d {
}
}
struct CustomReserved2 @0xf35cc4560bbf6ec2 {
struct LongitudinalPlanSP @0xf35cc4560bbf6ec2 {
dec @0 :DynamicExperimentalControl;
struct DynamicExperimentalControl {
state @0 :DynamicExperimentalControlState;
enabled @1 :Bool;
active @2 :Bool;
enum DynamicExperimentalControlState {
acc @0;
blended @1;
}
}
}
struct CustomReserved3 @0xda96579883444c35 {
@@ -105,3 +119,33 @@ struct CustomReserved8 @0xf416ec09499d9d19 {
struct CustomReserved9 @0xa1680744031fdb2d {
}
struct CustomReserved10 @0xcb9fd56c7057593a {
}
struct CustomReserved11 @0xc2243c65e0340384 {
}
struct CustomReserved12 @0x9ccdc8676701b412 {
}
struct CustomReserved13 @0xcd96dafb67a082d0 {
}
struct CustomReserved14 @0xb057204d7deadf3f {
}
struct CustomReserved15 @0xbd443b539493bc68 {
}
struct CustomReserved16 @0xfc6241ed8877b611 {
}
struct CustomReserved17 @0xa30662f84033036c {
}
struct CustomReserved18 @0xc86a3d38d13eb3ef {
}
struct CustomReserved19 @0xa4f1eb3323f5f582 {
}
+18 -2
View File
@@ -2629,14 +2629,20 @@ struct Event {
livestreamWideRoadEncodeData @121 :EncodeData;
livestreamDriverEncodeData @122 :EncodeData;
# *********** Custom: reserved for forks ***********
# DO change the name of the field
# DON'T change anything after the "@"
customReservedRawData0 @124 :Data;
customReservedRawData1 @125 :Data;
customReservedRawData2 @126 :Data;
# *********** Custom: reserved for forks ***********
# DO change the name of the field and struct
# DON'T change the ID (e.g. @107)
# DON'T change which struct it points to
selfdriveStateSP @107 :Custom.SelfdriveStateSP;
modelManagerSP @108 :Custom.ModelManagerSP;
customReserved2 @109 :Custom.CustomReserved2;
longitudinalPlanSP @109 :Custom.LongitudinalPlanSP;
customReserved3 @110 :Custom.CustomReserved3;
customReserved4 @111 :Custom.CustomReserved4;
customReserved5 @112 :Custom.CustomReserved5;
@@ -2644,6 +2650,16 @@ struct Event {
customReserved7 @114 :Custom.CustomReserved7;
customReserved8 @115 :Custom.CustomReserved8;
customReserved9 @116 :Custom.CustomReserved9;
customReserved10 @136 :Custom.CustomReserved10;
customReserved11 @137 :Custom.CustomReserved11;
customReserved12 @138 :Custom.CustomReserved12;
customReserved13 @139 :Custom.CustomReserved13;
customReserved14 @140 :Custom.CustomReserved14;
customReserved15 @141 :Custom.CustomReserved15;
customReserved16 @142 :Custom.CustomReserved16;
customReserved17 @143 :Custom.CustomReserved17;
customReserved18 @144 :Custom.CustomReserved18;
customReserved19 @145 :Custom.CustomReserved19;
# *********** legacy + deprecated ***********
model @9 :Legacy.ModelData; # TODO: rename modelV2 and mark this as deprecated
+1
View File
@@ -77,6 +77,7 @@ _services: dict[str, tuple] = {
# sunnypilot
"modelManagerSP": (False, 1., 1),
"selfdriveStateSP": (True, 100., 10),
"longitudinalPlanSP": (True, 20., 10),
# debug
"uiDebug": (True, 0., 1),
+2
View File
@@ -229,6 +229,8 @@ std::unordered_map<std::string, uint32_t> keys = {
{"HyundaiRadarTracksConfirmed", PERSISTENT},
{"HyundaiRadarTracksPersistent", PERSISTENT},
{"HyundaiRadarTracksToggle", PERSISTENT},
{"DynamicExperimentalControl", PERSISTENT},
};
} // namespace
+13
View File
@@ -294,4 +294,17 @@ std::string check_output(const std::string& command) {
return result;
}
bool system_time_valid() {
// Default to August 26, 2024
tm min_tm = {.tm_year = 2024 - 1900, .tm_mon = 7, .tm_mday = 26};
time_t min_date = mktime(&min_tm);
struct stat st;
if (stat("/lib/systemd/systemd", &st) == 0) {
min_date = std::max(min_date, st.st_mtime + 86400); // Add 1 day (86400 seconds)
}
return time(nullptr) > min_date;
}
} // namespace util
+2
View File
@@ -96,6 +96,8 @@ bool create_directories(const std::string &dir, mode_t mode);
std::string check_output(const std::string& command);
bool system_time_valid();
inline void sleep_for(const int milliseconds) {
if (milliseconds > 0) {
std::this_thread::sleep_for(std::chrono::milliseconds(milliseconds));
+1 -1
Submodule panda updated: 96632fa921...d3252abcc4
+1 -1
View File
@@ -191,7 +191,7 @@ class CarSpecificEvents:
events.add(EventName.speedTooHigh)
if CS.cruiseState.nonAdaptive:
events.add(EventName.wrongCruiseMode)
if CS.brakeHoldActive and self.CP.openpilotLongitudinalControl and self.CP.carName != 'toyota':
if CS.brakeHoldActive and self.CP.openpilotLongitudinalControl:
events.add(EventName.brakeHold)
if CS.parkingBrake:
events.add(EventName.parkBrake)
+23 -4
View File
@@ -23,7 +23,7 @@ from openpilot.selfdrive.car.cruise import VCruiseHelper
from openpilot.selfdrive.car.car_specific import MockCarState
from openpilot.sunnypilot.mads.mads import MadsParams
from openpilot.sunnypilot.selfdrive.car.interfaces import setup_car_interface_sp, initialize_car_interface_sp
from openpilot.sunnypilot.selfdrive.car import interfaces
REPLAY = "REPLAY" in os.environ
@@ -102,7 +102,7 @@ class Car:
cached_params = _cached_params
self.CI = get_car(*self.can_callbacks, obd_callback(self.params), experimental_long_allowed, num_pandas, cached_params)
setup_car_interface_sp(self.CI.CP, self.params)
interfaces.setup_car_interface_sp(self.CI.CP, self.params)
self.RI = get_radar_interface(self.CI.CP)
self.CP = self.CI.CP
@@ -122,6 +122,9 @@ class Car:
MadsParams().set_alternative_experience(self.CP)
MadsParams().set_car_specific_params(self.CP)
# Dynamic Experimental Control
self.dynamic_experimental_control = self.params.get_bool("DynamicExperimentalControl")
openpilot_enabled_toggle = self.params.get_bool("OpenpilotEnabledToggle")
controller_available = self.CI.CC is not None and openpilot_enabled_toggle and not self.CP.dashcamOnly
@@ -133,6 +136,15 @@ class Car:
self.CP.safetyConfigs = [safety_config]
if self.CP.secOcRequired and not self.params.get_bool("IsReleaseBranch"):
# Copy user key if available
try:
with open("/cache/params/SecOCKey") as f:
user_key = f.readline().strip()
if len(user_key) == 32:
self.params.put("SecOCKey", user_key)
except Exception:
pass
secoc_key = self.params.get("SecOCKey", encoding='utf8')
if secoc_key is not None:
saved_secoc_key = bytes.fromhex(secoc_key.strip())
@@ -164,6 +176,9 @@ class Car:
# card is driven by can recv, expected at 100Hz
self.rk = Ratekeeper(100, print_delay_threshold=None)
# log fingerprint in sentry
interfaces.log_fingerprint(self.CP)
def state_update(self) -> tuple[car.CarState, structs.RadarDataT | None]:
"""carState update loop, driven by can"""
@@ -192,7 +207,7 @@ class Car:
self.v_cruise_helper.update_v_cruise(CS, self.sm['carControl'].enabled, self.is_metric)
if self.sm['carControl'].enabled and not self.CC_prev.enabled:
# Use CarState w/ buttons from the step selfdrived enables on
self.v_cruise_helper.initialize_v_cruise(self.CS_prev, self.experimental_mode)
self.v_cruise_helper.initialize_v_cruise(self.CS_prev, self.experimental_mode, self.dynamic_experimental_control)
# TODO: mirror the carState.cruiseState struct?
CS.vCruise = float(self.v_cruise_helper.v_cruise_kph)
@@ -237,7 +252,7 @@ class Car:
# Initialize CarInterface, once controls are ready
# TODO: this can make us miss at least a few cycles when doing an ECU knockout
self.CI.init(self.CP, *self.can_callbacks)
initialize_car_interface_sp(self.CP, self.params, *self.can_callbacks)
interfaces.initialize_car_interface_sp(self.CP, self.params, *self.can_callbacks)
# signal pandad to switch to car safety mode
self.params.put_bool_nonblocking("ControlsReady", True)
@@ -266,6 +281,10 @@ class Car:
while not evt.is_set():
self.is_metric = self.params.get_bool("IsMetric")
self.experimental_mode = self.params.get_bool("ExperimentalMode") and self.CP.openpilotLongitudinalControl
# sunnypilot
self.dynamic_experimental_control = self.params.get_bool("DynamicExperimentalControl")
time.sleep(0.1)
def card_thread(self):
+3 -2
View File
@@ -120,12 +120,13 @@ class VCruiseHelper:
self.button_timers[b.type.raw] = 1 if b.pressed else 0
self.button_change_states[b.type.raw] = {"standstill": CS.cruiseState.standstill, "enabled": enabled}
def initialize_v_cruise(self, CS, experimental_mode: bool) -> None:
def initialize_v_cruise(self, CS, experimental_mode: bool, dynamic_experimental_control: bool) -> None:
# initializing is handled by the PCM
if self.CP.pcmCruise:
return
initial = V_CRUISE_INITIAL_EXPERIMENTAL_MODE if experimental_mode else V_CRUISE_INITIAL
initial_experimental_mode = experimental_mode and not dynamic_experimental_control
initial = V_CRUISE_INITIAL_EXPERIMENTAL_MODE if initial_experimental_mode else V_CRUISE_INITIAL
if any(b.type in (ButtonType.accelCruise, ButtonType.resumeCruise) for b in CS.buttonEvents) and self.v_cruise_initialized:
self.v_cruise_kph = self.v_cruise_kph_last
+13 -12
View File
@@ -57,16 +57,16 @@ class TestVCruiseHelper:
for _ in range(2):
self.v_cruise_helper.update_v_cruise(car.CarState(cruiseState={"available": False}), enabled=False, is_metric=False)
def enable(self, v_ego, experimental_mode):
def enable(self, v_ego, experimental_mode, dynamic_experimental_control):
# Simulates user pressing set with a current speed
self.v_cruise_helper.initialize_v_cruise(car.CarState(vEgo=v_ego), experimental_mode)
self.v_cruise_helper.initialize_v_cruise(car.CarState(vEgo=v_ego), experimental_mode, dynamic_experimental_control)
def test_adjust_speed(self):
"""
Asserts speed changes on falling edges of buttons.
"""
self.enable(V_CRUISE_INITIAL * CV.KPH_TO_MS, False)
self.enable(V_CRUISE_INITIAL * CV.KPH_TO_MS, False, False)
for btn in (ButtonType.accelCruise, ButtonType.decelCruise):
for pressed in (True, False):
@@ -90,7 +90,7 @@ class TestVCruiseHelper:
CS.buttonEvents = [ButtonEvent(type=ButtonType.decelCruise, pressed=pressed)]
self.v_cruise_helper.update_v_cruise(CS, enabled=enabled, is_metric=False)
if pressed:
self.enable(V_CRUISE_INITIAL * CV.KPH_TO_MS, False)
self.enable(V_CRUISE_INITIAL * CV.KPH_TO_MS, False, False)
# Expected diff on enabling. Speed should not change on falling edge of pressed
assert not pressed == self.v_cruise_helper.v_cruise_kph == self.v_cruise_helper.v_cruise_kph_last
@@ -100,7 +100,7 @@ class TestVCruiseHelper:
Asserts we don't increment set speed if user presses resume/accel to exit cruise standstill.
"""
self.enable(0, False)
self.enable(0, False, False)
for standstill in (True, False):
for pressed in (True, False):
@@ -120,7 +120,7 @@ class TestVCruiseHelper:
for v_ego in np.linspace(0, 100, 101):
self.reset_cruise_speed_state()
self.enable(V_CRUISE_INITIAL * CV.KPH_TO_MS, False)
self.enable(V_CRUISE_INITIAL * CV.KPH_TO_MS, False, False)
# first decrement speed, then perform gas pressed logic
expected_v_cruise_kph = self.v_cruise_helper.v_cruise_kph - IMPERIAL_INCREMENT
@@ -142,10 +142,11 @@ class TestVCruiseHelper:
"""
for experimental_mode in (True, False):
for v_ego in np.linspace(0, 100, 101):
self.reset_cruise_speed_state()
assert not self.v_cruise_helper.v_cruise_initialized
for dynamic_experimental_control in (True, False):
for v_ego in np.linspace(0, 100, 101):
self.reset_cruise_speed_state()
assert not self.v_cruise_helper.v_cruise_initialized
self.enable(float(v_ego), experimental_mode)
assert V_CRUISE_INITIAL <= self.v_cruise_helper.v_cruise_kph <= V_CRUISE_MAX
assert self.v_cruise_helper.v_cruise_initialized
self.enable(float(v_ego), experimental_mode, dynamic_experimental_control)
assert V_CRUISE_INITIAL <= self.v_cruise_helper.v_cruise_kph <= V_CRUISE_MAX
assert self.v_cruise_helper.v_cruise_initialized
@@ -15,6 +15,8 @@ from openpilot.selfdrive.controls.lib.drive_helpers import CONTROL_N, get_speed_
from openpilot.selfdrive.car.cruise import V_CRUISE_MAX, V_CRUISE_UNSET
from openpilot.common.swaglog import cloudlog
from openpilot.sunnypilot.selfdrive.controls.lib.longitudinal_planner import LongitudinalPlannerSP
LON_MPC_STEP = 0.2 # first step is 0.2s
A_CRUISE_MIN = -1.2
A_CRUISE_MAX_VALS = [1.6, 1.2, 0.8, 0.6]
@@ -66,10 +68,11 @@ def get_accel_from_plan(speeds, accels, action_t=DT_MDL, vEgoStopping=0.05):
return a_target, should_stop
class LongitudinalPlanner:
class LongitudinalPlanner(LongitudinalPlannerSP):
def __init__(self, CP, init_v=0.0, init_a=0.0, dt=DT_MDL):
self.CP = CP
self.mpc = LongitudinalMpc(dt=dt)
LongitudinalPlannerSP.__init__(self, self.CP, self.mpc)
self.fcw = False
self.dt = dt
self.allow_throttle = True
@@ -104,7 +107,10 @@ class LongitudinalPlanner:
return x, v, a, j, throttle_prob
def update(self, sm):
LongitudinalPlannerSP.update(self, sm)
self.mpc.mode = 'blended' if sm['selfdriveState'].experimentalMode else 'acc'
if dec_mpc_mode := self.get_mpc_mode():
self.mpc.mode = dec_mpc_mode
if len(sm['carControl'].orientationNED) == 3:
accel_coast = get_coast_accel(sm['carControl'].orientationNED[1])
@@ -205,3 +211,5 @@ class LongitudinalPlanner:
longitudinalPlan.allowThrottle = bool(self.allow_throttle)
pm.send('longitudinalPlan', plan_send)
self.publish_longitudinal_plan_sp(sm, pm)
+1 -1
View File
@@ -18,7 +18,7 @@ def main():
ldw = LaneDepartureWarning()
longitudinal_planner = LongitudinalPlanner(CP)
pm = messaging.PubMaster(['longitudinalPlan', 'driverAssistance'])
pm = messaging.PubMaster(['longitudinalPlan', 'driverAssistance', 'longitudinalPlanSP'])
sm = messaging.SubMaster(['carControl', 'carState', 'controlsState', 'liveParameters', 'radarState', 'modelV2', 'selfdriveState'],
poll='modelV2', ignore_avg_freq=['radarState'])
+5 -2
View File
@@ -652,8 +652,11 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = {
},
EventName.brakeHold: {
ET.USER_DISABLE: EngagementAlert(AudibleAlert.disengage),
ET.NO_ENTRY: NoEntryAlert("Brake Hold Active"),
ET.WARNING: Alert(
"Press Resume to Exit Brake Hold",
"",
AlertStatus.userPrompt, AlertSize.small,
Priority.LOW, VisualAlert.none, AudibleAlert.none, .2),
},
EventName.parkBrake: {
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6e1555145a4482e4148c2e7a5cdbf370720a3cf684f18686a50bf25de0b55650
size 356302
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:eb4235545588e617a82d698721503bdd048a5858da9d60b9b90eeecc8c969498
size 356186
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0720a28167410da8dc5aa940f9ff916dcd3e1863ba4fb5b91c73ddf8c7e10c6c
size 256451
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c02a2432cb761440b9b5a0e432a13f05f5b03b9890bc5fe99f6c533be4f459f1
size 256426
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:221caa376d9052d375dc82225f6c6f894fa684f4be2f387bf2cf46927ed3cd15
size 332404
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:58c05f3c0b39e0525a586598982923b13e9b54c5ec9f41f87d88156552374a71
size 332428
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d02a7e8de6fcc2f0d2c8371116d9acef752e53f3a0c701f89a8c12927c666678
size 268879
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d66335e9f34ac3baff73188c5042e2292c42979d9c6769a7953ecd17dc9e3956
size 268874
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b17cefe94984aa855dc21f63afabf3514619cc0b4dc5eafc9c3f3594577a655c
size 435709
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:fc70028fe66f0292f208dc4449e9f1291f5b28a8c44ebf8076f24b690364d256
size 435674
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:333ea99fc2d88f0ec405f2ea5f1d86881a5879dc77ceee14700da1063a1319ac
size 308602
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:11025e5a2cc0c21c3525dd002b4834db18006016a606b7ad83e7ec2c2aa8d710
size 308599
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:426f453cd17daaa3db48d98a8e2a34f7f113b91bdfe3da2dbe6d8c13c72f37f6
size 392249
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:177c3c81df0a10f4e56122196ecfc2ebc807491171b405f7caa4f62363856c7a
size 393110
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:88e0d29b9a909c9cb97e47f62e0b42bb5761ac65d6836eb4d415982954df28f0
size 334267
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d35c3b33f528bfcd9f15b53a41031c37d47739604b4b6f721670af44df901280
size 334227
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:77a887290be2730ba5b3d558de4a7c72598c3a20372038f5c9de08b57a84c33b
size 470504
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:572a2b5a4ea929451b3f6aaa8786029f198eb3f3d823ba72e579a791fd0c8af8
size 470462
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6e152e4ffbfb1fa9cfaf3971859ea47ca5815735a3c391dc9b8c6e233a26658d
size 260279
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e55efae47740ead32d95e4d1c677ce07f95441c5cfea72a80c7f2a5cda996633
size 260412
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:03aa9d65b2da189437de176269c698deb3fecd6167e958caf3530737cf15a431
size 217479
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3b1ed44ae652a3eeb4786c989219e2fd09e0755b5003ca53ba1c0ec01cd7d8c0
size 217471
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:bd67adc5e5ea3353ef7cdd306b2e3b0f1b02862739ef3e313f0e4a20372c696a
size 293071
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:05249897ed80e89bfecd69f3719ce6e58112994718d0e0a02b0cd1003beab761
size 293036
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:70fe8b2843fb4721d72e9c7fc524825b067e0b550afec181b636ef329687fc4a
size 260872
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4b1514a19e37f8bcf252380a258633f2496f1c038cc3411aff10bbc934a0ae0e
size 260925
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e5142666f3f837848db872917bd344b05209ddab82c2671a75b13682b709a9f8
size 100116
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c97c909cce68a14b255c91d7dac8cd29aa4e73537d0b4ca4dddd1954471713bb
size 100071
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2808066b4828ae0591957ab3b5ea654843c5a6f3051a0b734e0869dd903f82dc
size 262864
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f3b0432ded38813b7bc9ea00e9c48eb4d35d05cb459b6a574a18079ad19c45f0
size 262901
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:cb2755f77239c319a9528b00fb17f1696c67085b825e2d08cbbe8d47545316cd
size 258556
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d2e934ace7fa186b1989f25cf29c40aaad1a1a1a0a469f298c93c0533c3b44d9
size 259272
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4643cd4e30aec5e5256f6da72748f959310f99ba763bbbf6981f077c64391327
size 268090
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e1889b550401eea6817f397bcce895660710d4d8d81ba715ba48f203ed0152b6
size 268159
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c4a4a300062f80c37686b58ee1382569dcf8e51be523a67d0134e9de8660f8ab
size 305130
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ca312b930dce74d532f8630f4dffa1e8e3596cc9a33e83f655c3c7f823d19a06
size 305087
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a3b26b9065a9f9f8afeea2f5e754e7b4443d234bedfa1752cd30bfecdf864878
size 255666
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:dbd2ec6c65fdf73eeb0b372f34b59969125d5ee6bc2f6c6fa477ca567d96ed81
size 255744

Some files were not shown because too many files have changed in this diff Show More