Compare commits

...

393 Commits

Author SHA1 Message Date
Jason Wen
7bf90d5372 Tools: Update setup command for macOS native setup 2024-12-10 21:01:31 -05:00
Maxime Desroches
41b5065499 ci: block Jenkins replay (#34196)
* test

* not replay

* up

* text

* text

* fix

* no

* commit

* clean
2024-12-10 11:04:32 -08:00
elkoled
334e06c04f fix docs.py path references (#34200) 2024-12-10 11:01:49 -08:00
Dean Lee
dcb3113c4b athenad: fix thread safety issues in upload handing (#34199)
* fix thread safety issues in upload handing

* remove cancelled_uploads

* remove None from current upload items & atomic updates
2024-12-10 01:18:43 -08:00
Shane Smiskol
015aadd48c Revert "athenad: fix thread safety issues in upload handing" (#34198)
Revert "athenad: fix thread safety issues in upload handing (#34084)"

This reverts commit 7c101a40c8.
2024-12-09 17:22:28 -08:00
YassineYousfi
57fc4f79d1 Postal Service Model (#34183)
0d68d465-9938-4327-a015-0cef58bc9f3a/400
2024-12-09 13:13:01 -08:00
Dean Lee
7ec6a47c1e athenad: optimize network state check in upload callback (#34185)
optimize network state check in upload callback
2024-12-09 12:14:45 -08:00
Maxime Desroches
6234fbfd40 ci: fix weekly GA run (#34194)
fix
2024-12-09 11:38:28 -08:00
Dean Lee
310a5b174c remove unused img_driver_face_static.png (#34193) 2024-12-09 10:54:53 -08:00
commaci-public
6e339f3315 [bot] Update Python packages (#34191)
Update Python packages

Co-authored-by: Vehicle Researcher <user@comma.ai>
2024-12-09 10:34:30 -08:00
Maxime Desroches
7558108221 delete devcontainer (#34181)
* remove

* Update tools/README.md

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2024-12-07 20:39:30 -08:00
Maxime Desroches
b94946eaab update ubuntu 20.04 comment (#34182)
24
2024-12-07 20:09:42 -08:00
Maxime Desroches
dfe283765f ci: push the openpilot-base image (#34180)
image
2024-12-07 19:12:56 -08:00
Adeeb Shihadeh
9eccd9ad1e op: also fix resetting 2024-12-07 18:47:55 -08:00
Adeeb Shihadeh
e23b61f0b6 op: fix branch switching after force pushes 2024-12-07 18:46:18 -08:00
Maxime Desroches
ae1e476431 ci: fix x86 build (#34179)
* more

* more
2024-12-07 17:18:02 -08:00
Maxime Desroches
bbf0e11f71 ci: remove aarch64 build (#34178)
remove
2024-12-07 17:10:27 -08:00
Adeeb Shihadeh
d3063e9a0a hardwared: allow empty temp fields 2024-12-07 15:15:49 -08:00
Adeeb Shihadeh
ed222d04c9 tici: reduce AT commands on startup 2024-12-07 15:10:16 -08:00
Adeeb Shihadeh
2e9540d2b1 system/hardware: refactor thermal config (#34177)
* system/hardware: refactor thermal config

* fix

* fixup

---------

Co-authored-by: Comma Device <device@comma.ai>
2024-12-07 15:03:30 -08:00
Shane Smiskol
be67d5a1d9 Toyota: fix future aEgo calculation (#34173)
* bump

* Update ref_commit
2024-12-07 04:59:35 -06:00
Maxime Desroches
facaee8b10 raylib: fix symbols redefinition (#34172)
colors
2024-12-07 01:35:50 -08:00
Harald Schäfer
7a4169379d Revert "PlayStation® model (#34133)" (#34170)
This reverts commit 5160bee543.
2024-12-06 23:56:53 -08:00
Dean Lee
7c101a40c8 athenad: fix thread safety issues in upload handing (#34084)
* fix thread safety issues in upload handing

* remove cancelled_uploads
2024-12-06 20:14:12 -08:00
Shane Smiskol
c48600efbd Toyota: error correct on future acceleration (#34169)
* bump opendbc

* Update ref_commit
2024-12-06 20:08:35 -08:00
Maxime Desroches
0902527e27 ci: fix retry in test_camerad (#34167)
* flaky was flaky

* delay
2024-12-06 19:29:32 -08:00
Maxime Desroches
c7889a16be ci: remove the old phone_only test marker (#34168)
* std

* ruff
2024-12-06 17:06:48 -08:00
Maxime Desroches
d7d9c40242 ci: fix more multi-labels (#34166)
* more

* try

* clean
2024-12-06 13:54:23 -08:00
Maxime Desroches
84fdbb0eb4 ci: fix multi-labels for runners (#34164)
* -

* ,

* try

* try

* fix

* try this

* fix

* cleanup
2024-12-06 13:33:13 -08:00
Adeeb Shihadeh
f3c4770f91 debug: migrate old logs 2024-12-06 10:53:02 -08:00
Maxime Desroches
3dc80057f2 ci: try namespace separate docker cache (#34157)
* expe

* fix

* Revert "fix"

This reverts commit e4592788e7d1d411bc665c961ea4b8e99906984c.

* run

* back

* also

* try without

* ||
2024-12-05 16:42:09 -08:00
Maxime Desroches
e9246df02e ci: faster unit tests (#34161)
* fast

* lint

* try

* clean

* this

* try even more

* more

* maybe

* what

* maybe?

* maybe

* try this

* fix

* fast?

* now cache?

* debug

* again...

* maybe

* NOW!

* revert, this is already enough (for now?)
2024-12-05 16:41:38 -08:00
commaci-public
070b1e68d1 [bot] Update Python packages (#34159)
* Update Python packages

* Update ref_commit

---------

Co-authored-by: Vehicle Researcher <user@comma.ai>
Co-authored-by: Shane Smiskol <shane@smiskol.com>
2024-12-05 15:30:43 -08:00
Dean Lee
e19ecbf75c CommaApi: use context manager for response handling (#34118)
use context manager for response handling
2024-12-05 15:28:11 -08:00
Maxime Desroches
fe24462949 ci: revert pocl (#34160)
* slow runner

* test this

* revert
2024-12-05 14:01:08 -08:00
Adeeb Shihadeh
8f73bcffe4 micd: fix fake lagging warnings (#34158)
* micd: fix fake lagging warnings

* fix it properly

* simple
2024-12-05 13:35:44 -08:00
Adeeb Shihadeh
6c02d5c3f7 agnos 11.3 (#34087) 2024-12-05 12:07:12 -08:00
Maxime Desroches
1f3c365f1a ci: make openpilot-base image smaller (#34154)
* big

* here

* why

* pocl

* remove this

* more debug

* see this

* more

* more

* diff

* cleanup

* cleanup

* check

* NO DC???

This reverts commit 137cde5fc98ec39497e85f335e2f636cf9a5e5ea.
2024-12-04 22:10:36 -08:00
Adeeb Shihadeh
34d62836fe hw: add fan intake and exhaust temps (#34156)
* hw: add fan intake and exhaust temps

* remove bat

---------

Co-authored-by: Comma Device <device@comma.ai>
2024-12-04 19:24:21 -08:00
commaci-public
c6e4241bad [bot] Update Python packages (#34140)
* Update Python packages

* pin

* fstring

* this too

---------

Co-authored-by: Vehicle Researcher <user@comma.ai>
Co-authored-by: Maxime Desroches <desroches.maxime@gmail.com>
2024-12-04 15:34:54 -08:00
DevTekVE
8f7bbe4ee3 macos: use /tmp instead of /dev/shm (#34097)
* 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...
2024-12-04 10:51:09 -08:00
Maxime Desroches
75bf756893 raylib: add touch support (#34151)
bump raylib
2024-12-03 21:54:41 -08:00
Maxime Desroches
a22d6cd0d3 raylib: disable build on ubuntu focal (#34150)
build
2024-12-03 19:58:00 -08:00
Lee Jong Mun
3d54c383ab manager: garbage collect old process (#34149) 2024-12-03 15:31:22 -08:00
Adeeb Shihadeh
1ec2c56b4e gc old DM init param 2024-12-03 14:59:28 -08:00
Adeeb Shihadeh
c4edfa8b25 camerad: fix running AR0231 in single road cam mode (#34148)
Co-authored-by: Comma Device <device@comma.ai>
2024-12-03 14:16:28 -08:00
Dean Lee
7aeabc37d0 cabana: add support to fetch preserved routes (#34146)
add support to fetch preserved routes
2024-12-03 13:00:22 -08:00
YassineYousfi
5160bee543 PlayStation® model (#34133)
* e2a90efd-8986-4c97-8f55-22725cdee8b9/400

* bea47b6f-c2f9-460f-9658-73f202756294/400

* 7e8efd49-f1a4-4355-912e-610633e0e7f9/390

* 7e8efd49-f1a4-4355-912e-610633e0e7f9/400

---------

Co-authored-by: Bruce Wayne <harald.the.engineer@gmail.com>
2024-12-02 23:44:21 -08:00
Adeeb Shihadeh
b33441213a tools/op: add switch command (#34112)
* tools/op: add switch command

* fix

* .

* usage

* fix

---------

Co-authored-by: Maxime Desroches <desroches.maxime@gmail.com>
2024-12-02 21:56:18 -08:00
Dean Lee
43807746ff athenad: fix memory leak by closing Response objects (#34101)
* fix memory leak by closing Response

* use with
2024-12-02 21:30:54 -08:00
Dean Lee
685dc5a80c selfdrive/debug: fix broken check_can_parser_performance.py (#34143)
fix broken check_can_parser_performance.py
2024-12-02 20:17:02 -08:00
Adeeb Shihadeh
1bc1d2e020 jenkins: only run pigeon and encoder tests on path diffs (#34142) 2024-12-02 16:01:14 -08:00
Adeeb Shihadeh
556060f793 camerad: full buffer size for IFE processing (#34141)
* camerad: full buffer size for IFE processing

* assert

* revert

---------

Co-authored-by: Comma Device <device@comma.ai>
2024-12-02 15:58:51 -08:00
Shane Smiskol
24dfa0e1bf bump opendbc (#34139)
* bump

* bump

* update docs

* Update ref_commit
2024-12-02 13:09:11 -08:00
Shane Smiskol
8f559d4f03 fix repo maintenance 2024-12-02 13:06:17 -08:00
Dean Lee
e02a6e09fe cabana: fix UI highlight for inactive items and crash in saveHeaderState() on closeEvent (#34135)
* Adjust the highlight color for inactive items to enhance visibility

* Resolve the crash occurring in messages_widget->saveHeaderState()
2024-12-02 09:55:44 -08:00
Dean Lee
049f6c1dd5 cabana: introduce OneShotHttpRequest to prevent concurrent HTTP requests (#34136)
add OneShotHttpRequest class for single-use HTTP requests
2024-12-02 09:55:30 -08:00
royjr
adc347d12b ui: fix prime spacing (#34127)
fix prime spacing
2024-11-29 07:25:42 -08:00
Maxime Desroches
ce948f7362 raylib on device (#34126)
* setup

* tp

* more

* device
2024-11-28 15:59:27 -08:00
Adeeb Shihadeh
4226ef5a66 Setup system/ui/ move (#34124) 2024-11-28 11:48:48 -08:00
Dean Lee
8e14e400ef cabana: enhance freq calculation and add zero division protection (#34121)
fix frequency calculation
2024-11-27 10:58:33 -08:00
Dean Lee
adb9560870 athenad: move last_scan outside the loop (#34099)
move last_scan outside the loop
2024-11-27 11:44:32 +01:00
Dean Lee
b737e8472f athenad: explicitly delete socket in getMessage (#34098)
explicitly delete socket in getMessage
2024-11-27 00:35:36 -08:00
Shane Smiskol
8f71d53eb0 test_models: display failed rx msg address 2024-11-26 16:54:05 -08:00
Adeeb Shihadeh
7b5478a58e fix replay build 2024-11-26 14:06:27 -08:00
Adeeb Shihadeh
00c964abfb tici: more modem config (#34110)
* tici: more modem config

* separate those

---------

Co-authored-by: Comma Device <device@comma.ai>
2024-11-26 13:33:17 -08:00
Kacper Rączy
eccdf8d880 locationd: timing spikes resiliance (#34080)
* Locationd scenario for timing spike

* Add test for consistent timing spike

* Resiliance to bad timing

* Test update

* Refactor test

* fix comment

* Decay based on frequency

* Fix

* Update comment

* Only for critical services

* Fix tests
2024-11-25 20:46:05 -08:00
Adeeb Shihadeh
29577a3346 bootlog: monotonic ts for journalctl 2024-11-25 15:41:21 -08:00
YassineYousfi
81252f549c Alabama model (#34108)
e22d5e0c-1441-4953-b878-8f0f36e527c6/400
2024-11-25 14:34:36 -08:00
Adeeb Shihadeh
8ebfc99b93 gc unicore gps 2024-11-25 09:43:05 -08:00
Adeeb Shihadeh
5542bd57a4 Revert "agnos 11.2 v2 (#34015)"
This reverts commit c11e9a3bdd.
2024-11-25 09:42:49 -08:00
Adeeb Shihadeh
c287232374 uploader: increase max qlog size (#34106) 2024-11-25 09:40:23 -08:00
Patrick Bassut
a923f25225 Using carControl/enabled on PJ template (#34100)
using carControl/enabled
2024-11-25 09:14:58 -08:00
Dean Lee
3c765a1f45 replay: eliminate qt dependency (#34102)
refactor to remove qt dependency and module Replay classes
2024-11-25 09:13:22 -08:00
Adeeb Shihadeh
a58853e70e ubloxd: update time validity check (#34103) 2024-11-24 10:50:34 -08:00
Dean Lee
957d39a5b6 athenad: close websocket before starting next loop iteration (#34085)
explicitly close websocket before starting next loop iteration
2024-11-23 20:35:42 -08:00
Maxime Desroches
78b6eaea7c ci: 1 minute global timeout for docs (#34095)
bring back
2024-11-23 19:35:04 -08:00
Shane Smiskol
794ee3c9b4 bump opendbc (#34088)
* bump

* build dbcs

* bump

* bump

* bump

* bump

* no cache

* Revert "no cache"

This reverts commit 98929bb47ff8354bcfb19511947528b72654e45d.

* clean

* debug

* bump

* fix that

* fix
2024-11-22 22:22:22 -08:00
Maxime Desroches
1bbace7dff ci: fix retry color (#34094)
* color

* fix

* fix
2024-11-22 20:42:57 -08:00
ZwX1616
83950c1b36 fix OS04 line lengths (#34093)
* was bs

* 69c-8

---------

Co-authored-by: Comma Device <device@comma.ai>
2024-11-22 20:26:41 -08:00
Adeeb Shihadeh
38318db4c6 pandad: lower log level for low level error 2024-11-22 19:40:34 -08:00
Maxime Desroches
1b921fa6f9 ci: fix timeout when runner takes a long time to pick up the job (#34091)
fix
2024-11-22 19:29:40 -08:00
Harald Schäfer
fee1f29ce9 Last Horizon Model (#34090)
* 516b3968-82ec-4d7c-89ff-57ded21b3966/400

* 074f0168-aa4a-456b-a82c-464a6fc4ecdf/400

* f3dede04-b52d-4ca1-83aa-9686bd9d49ae/400
2024-11-22 19:19:55 -08:00
Shane Smiskol
006482b3f4 open new long reports 2024-11-22 17:41:31 -08:00
Justin Newberry
7fc5040ed9 LogReader: fix issue when your dns resolves all requests (#34089)
* terrible :(

* keep this spacing
2024-11-22 16:01:53 -08:00
Dean Lee
0f4ed56d51 cabana: fix thumbnail font size and timeline sorting issues (#34086)
fix thumbnail font size and timeline sorting issues
2024-11-22 10:38:27 -08:00
Maxime Desroches
8939e3a30b pandad: fix return value in spi_transfer (#34082)
zero
2024-11-21 22:46:31 -08:00
Shane Smiskol
8d9a1fa436 Corolla TSS2: support new Toyota tune (#34081)
* bump

* bump docs

* bump

* revert

* Update ref_commit
2024-11-21 20:20:29 -08:00
Maxime Desroches
fc354ec8cf ci: retry flash in test_pandad (#34078)
retry
2024-11-21 13:02:38 -08:00
Maxime Desroches
00c10f6851 ci: adjust pandad cpu usage (#34077)
more
2024-11-21 11:32:06 -08:00
Adeeb Shihadeh
5131c19232 pandad: set CAN FD auto mode (#34076)
* pandad: set CAN FD auto mode

* bump
2024-11-21 11:15:43 -08:00
Shane Smiskol
b0699ccf20 Toyota: new long tune improvements (#34073)
bump
2024-11-20 19:44:15 -08:00
Maxime Desroches
df1789ccf5 bump panda (#34072)
maybe
2024-11-20 19:33:00 -08:00
Maxime Desroches
7496dcee58 test_qcomgpsd: let qcomgpsd delete the assistance (#34069)
* del

* class
2024-11-20 18:31:00 -08:00
Adeeb Shihadeh
e243663520 Revert "setup: no low voltage warning without INA"
This reverts commit 7ecedbc39f.
2024-11-20 16:14:30 -08:00
Adeeb Shihadeh
670cf27f8e tici: modem cleanups (#34071)
* tici: modem cleanups

* rm that

---------

Co-authored-by: Comma Device <device@comma.ai>
2024-11-20 16:01:48 -08:00
ZwX1616
d90d5a403f camerad: ev scaling (#34070)
ev scaling

Co-authored-by: Waddle Wednesday <>
2024-11-20 15:40:55 -08:00
Maxime Desroches
b206879e4d ci: more robust memory usage test in test_onroad (#34067)
metric
2024-11-19 21:07:22 -08:00
ZwX1616
c9a3a1a018 camerad: update os04 blc settings (#34065)
* not 64

* capped

---------

Co-authored-by: Comma Device <device@comma.ai>
2024-11-19 16:09:26 -08:00
Maxime Desroches
bf21e10d81 ci: move manager test_startup_time to test_onroad (#34062)
* get

* fix

* now

* try

* better sign

* better

* better

* clean

* space

* fix

* more

* msg
2024-11-19 14:27:15 -08:00
Maxime Desroches
293c3fc57f ci: Revert "setup: fix mac install (#34058)" (#34061)
Revert "setup: fix mac install (#34058)"

This reverts commit f8497d4af0.
2024-11-19 10:40:21 -08:00
Maxime Desroches
3ac9208364 ci: increase timeout on cache misses + switch some caches to github (#34056)
* cache

* test ns

* try this

* try

* try now?

* bp

* bp agian

* fix

* remove

* test

* try

* fix

* fix

* regen cache

* fix
2024-11-18 21:16:15 -08:00
Maxime Desroches
f8497d4af0 setup: fix mac install (#34058)
* try

* fix

* fix

* space
2024-11-18 20:45:55 -08:00
ZwX1616
d50732af94 camerad: adjust os04 SCG setting (#34055)
* 0x938 - 8

* ll

---------

Co-authored-by: Comma Device <device@comma.ai>
2024-11-18 15:23:50 -08:00
Shane Smiskol
01384affbb bump opendbc (#34054)
* bump

* bump refs
2024-11-18 15:19:44 -08:00
Maxime Desroches
c71c2ab651 ci: fix macos runner for forks (#34053)
fix
2024-11-18 15:04:03 -08:00
Maxime Desroches
3e7270a30e ci: run test_qcomgpsd only on changes (#34052)
* check

* change

* clean
2024-11-18 14:55:46 -08:00
Adeeb Shihadeh
47c90317bf bump panda 2024-11-18 14:50:45 -08:00
ZwX1616
7dfc45f15f camerad: fix os04 max IntegLines (#34051)
0x938 - 8

Co-authored-by: Comma Device <device@comma.ai>
2024-11-18 14:30:41 -08:00
commaci-public
4576f7f154 [bot] Update Python packages (#34043)
Update Python packages

Co-authored-by: Vehicle Researcher <user@comma.ai>
2024-11-18 10:38:37 -08:00
Bruce Wayne
612dbb32e1 Revert "Last Horizon Model (#34024)"
This reverts commit e123ac3d32.
2024-11-18 09:32:54 -08:00
Harald Schäfer
e123ac3d32 Last Horizon Model (#34024)
516b3968-82ec-4d7c-89ff-57ded21b3966/400
2024-11-18 09:31:13 -08:00
Adeeb Shihadeh
c11e9a3bdd agnos 11.2 v2 (#34015)
* agnos 11.2 v2

* new build

* new build
2024-11-17 16:21:45 -08:00
Adeeb Shihadeh
8c8ac3f28f tici: add STM_PWR_EN_N pin 2024-11-16 16:39:39 -08:00
Maxime Desroches
847a5ce1f3 ci: faster model_replay (#34036)
* cache draft

* fix

* fix

* fix

* better

* zst

* more

* try

* pool

* fix

* fix

* revert :C

* better

* cleanup

* no cache

* this too
2024-11-16 15:34:21 -08:00
Patrick Bassut
22d19f2fc4 cabana: don't check for socketcan when not available (#34039) 2024-11-16 10:29:26 -08:00
Shane Smiskol
863d86c10c Toyota: adaptive ACCEL_NET for new long tune (#34034)
* bump

* bump

* fix that

* should be a better way

* raise
2024-11-15 21:16:15 -08:00
Adeeb Shihadeh
55b94abfe4 bump panda 2024-11-15 19:42:46 -08:00
Maxime Desroches
354db5efd4 ci: remove unnecessary filereader_cache (#34033)
not needed
2024-11-15 16:36:08 -08:00
Shane Smiskol
83714de075 bump opendbc (#34030)
* bump

* update refs
2024-11-14 23:49:23 -08:00
Shane Smiskol
bcd0c67669 Revert "bump"
This reverts commit 308d26ae14.
2024-11-14 23:29:02 -08:00
Shane Smiskol
308d26ae14 bump 2024-11-14 23:28:47 -08:00
Shane Smiskol
360bb68547 proposed should be orange 2024-11-14 23:24:07 -08:00
Dean Lee
3a1c9e0f01 cabana: fix route load error handing (#34028)
fix error handing
2024-11-14 23:22:47 -08:00
Shane Smiskol
a4656bd939 Toyota: use filter for PCM compensation (#34029)
bump
2024-11-14 23:21:03 -08:00
Shane Smiskol
db32fbea20 bump opendbc (#34027)
* bump opendbc

* bump
2024-11-14 23:14:20 -08:00
Alexandre Nobuharu Sato
87bc80d351 Dev panel: disable long maneuver toggle for stock long (#34006)
* fix errors in developerPanel

* clean up

* clean up

* need to keep track of offroad sadly

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2024-11-14 13:38:41 -08:00
Maxime Desroches
233dc24929 ci: fix jenkins checkout (#34025)
fix
2024-11-14 11:35:14 -08:00
JaSpa99
dc73e6e2aa Make SimulatorBridge picklable (MacOS support) (#34023)
* remove unused

* make Params (un)serializable

* move initialization after spawn

_thread.lock objects can't be pickled
2024-11-14 10:25:50 -08:00
Maxime Desroches
50aac48fba ci: faster unit_test (#34019)
* multiple

* CACHE

* ...

* cache

* now fast

* maybe

* bp

* vv

* slow

* fast

* fix

* faster

* ruff

* info

* timeout

* info

* more

* clean

* faster

* test

* collection time

* is this real?

* fix

* back

* clean

* just to make sure

* faster!
2024-11-13 21:27:23 -08:00
Adeeb Shihadeh
26b928596d CI: always run submodule check (#34021)
* CI: always run submodule check

* ignore tinygrad

* skip
2024-11-13 19:43:06 -08:00
Adeeb Shihadeh
d9d57e5d6f Revert ISP image processing + tinygrad bump (#34020)
* Revert "Replace ThneedModel with TinygradModel (#33532)"

This reverts commit da952e9b64.

* Revert "camerad: move E + D cams image pipelines to the IFE (#33959)"

This reverts commit f2a1cce42b.
2024-11-13 19:27:11 -08:00
Maxime Desroches
3dc970960d ci: try safe_checkout if unsafe_checkout fails (#34018)
fallback
2024-11-13 14:40:42 -08:00
Maxime Desroches
e8a2f199e8 tools: fix replay build (#34017)
fix
2024-11-13 13:52:07 -08:00
Adeeb Shihadeh
3fffd6c466 jenkins: run model replay on tinygrad bumps (#34014)
* jenkins: run model replay on tinygrad bumps

* bump

* /

* fix

---------

Co-authored-by: Maxime Desroches <desroches.maxime@gmail.com>
2024-11-13 12:03:27 -08:00
Maxime Desroches
4948f910f0 ci: fix test_onroad (#34016)
fix
2024-11-13 12:02:17 -08:00
Adeeb Shihadeh
31cd290cbf bump panda 2024-11-13 10:11:18 -08:00
Dean Lee
96f6e186c4 test_ui: fix broken keyboard display in screenshots (#34013)
fix broken keyboard display in screenshots
2024-11-12 23:35:14 -08:00
Maxime Desroches
eda8a1feed ci: test_models timeout (#34011)
timeout
2024-11-12 20:48:46 -08:00
Maxime Desroches
7d5031a6d6 ci: reduce sleep in test_uploader (#34009)
less
2024-11-12 19:41:00 -08:00
Maxime Desroches
def2a7382c ci: don't create xvfb for unit_test (#34007)
no more
2024-11-12 16:42:03 -08:00
Shane Smiskol
5b9aa0b0f0 unit test job: remove duplicate test (#34005)
* already tested

try again

fix

* clean up
2024-11-12 16:17:10 -08:00
Shane Smiskol
4176c74969 ui report: add software (#34004)
* wow copilot got the coords right

* try again
2024-11-12 16:07:00 -08:00
Shane Smiskol
1ab2ec26e1 ListWidget: fix stretch (#34003)
fix stretch
2024-11-12 15:55:03 -08:00
Shane Smiskol
01a6dccc86 use a tuple 2024-11-12 14:34:43 -08:00
Dean Lee
f5dc1d08c9 replay: replace HttpRequest with libcurl for accessing comma API (#33851)
Replay: Replace HttpRequest with libcurl for accessing comma api
2024-11-12 14:34:12 -08:00
Dean Lee
d050e0c2ac ui/model: use height from LiveCalibration instead of hardcoded offset Z (#33802)
* add PATH_OFFSET_Z constant

* use height from liveCalibration
2024-11-12 14:33:25 -08:00
Maxime Desroches
4170534c02 ci: faster process_replay (#33989)
* try

* fix

* try

* try

* try

* monitor

* no

* how fast

* more

* timeout

* remove

* ruff

* try

* less

* cons

* less

* cons

* revert

* more and less

* more?

* more?

* cons

* cons

* cons

* cons

* cons
2024-11-12 14:26:21 -08:00
Adeeb Shihadeh
97c990dac6 docs: init glossary (#33995) 2024-11-11 16:21:50 -08:00
Maxime Desroches
13760968bb ci: set timeout based on runner (#33991)
* timeout

* 20
2024-11-11 14:28:15 -08:00
Adeeb Shihadeh
a683b7d99c sensord: increase time jump tolerance
diffs on the order of ~5ms are somewhat common and false positives
2024-11-11 14:21:50 -08:00
Maxime Desroches
f3e28275d9 bump tinygrad depth (#33990)
deeper
2024-11-11 13:48:35 -08:00
Mitchell Goff
da952e9b64 Replace ThneedModel with TinygradModel (#33532)
* squash

* bump tg

* bump tg

* debump tinygrad

* bump tinygrad

* bump tg

* Skip init iteration

* fixes

* cleanups

* skip first test sample

* typos

* linter unhappy

* update cpu usage

* OPENCL just zeros for now

* imports

* Try printing

* Runs again, but slower

* unused import

* Allow more buffer with tg and all on gpu

* bump tinygrad

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: Bruce Wayne <harald.the.engineer@gmail.com>
2024-11-11 13:32:21 -08:00
Kevin Robert Keegan
127c922aed ui: Fix Night Brightness (#33984) 2024-11-11 11:54:18 -08:00
commaci-public
f50ee8a67a [bot] Update Python packages (#33986)
Update Python packages

Co-authored-by: Vehicle Researcher <user@comma.ai>
2024-11-11 10:17:32 -08:00
Mauricio Alvarez Leon
5e4b423b5a ui: update spanish translations (#33982) 2024-11-10 19:52:02 -08:00
Lee Jong Mun
67b483f880 Multilang: kor translation update (#33983) 2024-11-10 19:51:25 -08:00
Shane Smiskol
3c22a1ee27 Revert "long report: close plots"
This reverts commit 482234ed35.
2024-11-10 19:17:04 -08:00
Shane Smiskol
482234ed35 long report: close plots 2024-11-10 19:15:11 -08:00
royjr
37d38960dc ui: update arabic translations (#33981)
Update main_ar.ts
2024-11-10 09:29:40 -08:00
royjr
e243acac3b longitudinal_maneuvers fix warning (#33980) 2024-11-10 09:29:27 -08:00
Maxime Desroches
5b0994c53c setup: fix uv (#33975)
* fix

* fix

* fix

* fix
2024-11-09 22:16:41 -08:00
YassineYousfi
47bd0f0166 Dragon Rider Model (#33958)
* c77e258c-8e59-46aa-a2ef-09398823e801/400

* 04a1d006-4d46-499a-a27e-dfe9651398a9/400
2024-11-09 17:28:20 -08:00
Shane Smiskol
1c1e7330f0 Toyota: more responsive start from stop (#33974)
* bump

* Update ref_commit
2024-11-08 21:13:59 -08:00
Shane Smiskol
3a2ca15164 bump opendbc (#33972)
bump
2024-11-08 20:30:41 -08:00
Maxime Desroches
4979182a2e ci: faster test_models (#33956)
* less

* timeout

* less

* merge

* debug

* debug

* try

* check now

* try this

* push

* fix

* CACHE

* test

* fix

* fix

* for now

* fix

* fix
2024-11-08 19:38:38 -08:00
Shane Smiskol
44c889fa41 longcontrol: prevent integral windup when feedforward rises gradually (#33970)
* try

* messy

* simplify that

* clip instead

* clean up

* clean up

* update refs

* this is better for latcontrol

* Revert "update refs"

This reverts commit 1d2508237f76121248060614b0c5e6ecdfdc4daf.

* ref commit
2024-11-08 18:15:36 -08:00
Adeeb Shihadeh
13d4b5f8bb Update RELEASES.md 2024-11-08 15:17:06 -08:00
Adeeb Shihadeh
7ecedbc39f setup: no low voltage warning without INA 2024-11-08 13:31:43 -08:00
Maxime Desroches
ce7317407f ci: faster test_encoder (#33968)
* try

* timeout

* fix
2024-11-08 11:49:04 -08:00
Maxime Desroches
a642973dc7 ci: try faster macos setup (#33966)
* test

* try

* try

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* cleanup
2024-11-07 22:31:23 -08:00
ZwX1616
a4848ceee9 Add driverStateV2 plots to model replay (#33967) 2024-11-07 21:49:15 -08:00
Maxime Desroches
700a5651bd ci: nicer output for test_onroad (#33961)
* viz

* viz

* fix

* show more

* fix

* failure

* cleanup
2024-11-07 21:45:51 -08:00
Shane Smiskol
3e88d680a5 Update maneuversd.py 2024-11-07 21:45:12 -08:00
ZwX1616
d899125b65 SensorInfo: set correct bayer_patterns (#33965)
clean up

Co-authored-by: Comma Device <device@comma.ai>
2024-11-07 19:56:10 -08:00
ZwX1616
48fcb4dc60 fix isp processing_time unit (#33964)
should be in seconds

Co-authored-by: Comma Device <device@comma.ai>
2024-11-07 19:01:31 -08:00
Maxime Desroches
e0acd86ca1 ci: faster unit_tests (#33962)
faster
2024-11-07 18:44:12 -08:00
ZwX1616
a342cef545 IFE: remove OS/AR redundant point due to typo (#33963) 2024-11-07 17:08:46 -08:00
Adeeb Shihadeh
b6a1530346 can't forget about os 2024-11-07 16:58:31 -08:00
Adeeb Shihadeh
2ac776cfda CI: disable retries on Actions (#33960)
* no retries

* red
2024-11-07 16:25:29 -08:00
Maxime Desroches
4f9794097b ci: faster unit_tests (#33953)
* effect

* test

* no

* yes

* try some caching

* try

* 1

* try more 1

* just for fun

* 50 maybe????

* all for nothing

* fix

* add back

* back

* timeout

* clean

* try

* no

* less
2024-11-07 15:29:07 -08:00
Adeeb Shihadeh
f2a1cce42b camerad: move E + D cams image pipelines to the IFE (#33959)
* camerad: move E + D cams image pipelines to the IFE

* arvig
2024-11-07 14:41:08 -08:00
Maxime Desroches
66beaceeec gitignore .zst logs (#33955)
ignore
2024-11-07 11:15:43 -08:00
Maxime Desroches
6a2ae346ab ci: relax test_onroad cpu usage bounds (#33951)
bounds
2024-11-06 20:30:38 -08:00
Maxime Desroches
c995d5b9ae ci: faster test_models (#33941)
* test

* try 4 runners

* try

* 100 for fun

* the fun is over

* try even less
2024-11-06 19:17:15 -08:00
Shane Smiskol
f13d1ae4d6 Toyota: clean up ACC_CONTROL sending (#33949)
* bump

* Update ref_commit
2024-11-06 17:50:52 -08:00
Shane Smiskol
1965b2fd6e joystick: add cancel logic (#33950)
match cancel logic
2024-11-06 17:46:05 -08:00
Shane Smiskol
aed8e5cbd5 bump opendbc (#33948) 2024-11-06 16:34:17 -08:00
Shane Smiskol
1e3f8bec46 Ford Q3: enable long by default (#33945)
* bump

* update docs

* release notes

ctrl

* op

* migrate for regen

* regen and update refs

* only ford
2024-11-06 16:21:44 -08:00
ZwX1616
c3ca9a26c8 os04c10: 12bit tune (#33947)
* much better

* also isp

---------

Co-authored-by: Comma Device <device@comma.ai>
2024-11-06 16:00:14 -08:00
commaci-public
3081dca9e5 [bot] Update Python packages (#33943)
Update Python packages

Co-authored-by: Vehicle Researcher <user@comma.ai>
2024-11-06 14:42:58 -08:00
Shane Smiskol
09b68eef3e fix lead distance bars w/ joystick mode (#33942) 2024-11-06 14:41:45 -08:00
YassineYousfi
3474eb3d96 fix raylib build (#33939) 2024-11-05 21:54:05 -08:00
Adeeb Shihadeh
8fc36c26f2 hardwared: configure modem even if SIM not present 2024-11-05 21:20:17 -08:00
Adeeb Shihadeh
6e8e51793e tici: disable cavli sim sleep 2024-11-05 17:37:07 -08:00
Maxime Desroches
4d08e114d9 installer: switch openpilot-internal to nightly-dev (#33938)
internal
2024-11-05 17:10:08 -08:00
Maxime Desroches
4b21e221dd test_camerad: reduce test time to allow retry (#33937)
allow all retries
2024-11-05 17:03:20 -08:00
Shane Smiskol
fd84970833 maneuversd: support interpolated breakpoints (#33936)
* breakpoints

* clean up

* fix

* simplify

* np fast

* might as well
2024-11-05 16:19:02 -08:00
Shane Smiskol
e92ff96de3 format mansueversd.py 2024-11-05 16:07:12 -08:00
Adeeb Shihadeh
954fa5e6da pandad: fall back to panda voltage and current measurements (#33935) 2024-11-05 15:51:45 -08:00
Adeeb Shihadeh
12fd9e441f only show storage missing for comma threes 2024-11-05 14:27:33 -08:00
James
83b60a7ba6 Remove duplicate "build_metadata" declaration (#33927) 2024-11-05 11:37:45 -08:00
Maxime Desroches
39dbee0329 ci: faster test_camerad (#33933)
* once

* timeout
2024-11-05 10:52:47 -08:00
Maxime Desroches
5a06d1df43 add nightly-dev to branch selector (#33932)
top
2024-11-04 20:26:08 -08:00
ZwX1616
e7d4139b1d IFE: fix ox (#33931)
* bp

* slightkly wrong

---------

Co-authored-by: Comma Device <device@comma.ai>
2024-11-04 17:03:52 -08:00
Dean Lee
474607ba06 cabana: refactor video widget for simplified layout and enhanced rendering (#33909)
simplify video widget
2024-11-04 10:01:14 -08:00
commaci-public
525482bf59 [bot] Update Python packages (#33928)
Update Python packages

Co-authored-by: Vehicle Researcher <user@comma.ai>
2024-11-04 09:43:12 -08:00
Adeeb Shihadeh
6a32430499 ui: skip raylib build on aarch64 (#33929) 2024-11-04 09:16:42 -08:00
Dean Lee
4f5ec14cf7 ui: refactor spinner using raylib (#33738)
* raylib spinner

* fix build issue on device

* keep qt spinner

* own SConscript
2024-11-04 09:07:07 -08:00
Maxime Desroches
32c5254415 ci: faster test_onroad (#33906)
* 30s

* ruff

* remove

* timeout

* global

* value

* get value

* better

* format

* cleaner
2024-11-02 21:19:05 -07:00
Maxime Desroches
747b963a29 nightly: avoid Jenkins cold reboot conflict (#33923)
conf
2024-11-02 20:15:57 -07:00
Alexandre Nobuharu Sato
d7fbf70237 docs: add user and pass to C3X serial console instructions (#33921)
* add user and pass to C3X serial console instructions

* better
2024-11-02 13:18:20 -07:00
Shane Smiskol
02e71a8467 Various CANParser optimizations (#33919)
bump opendbc to master
2024-11-01 22:15:13 -07:00
Shane Smiskol
08c8986dfa Ford long: smooth creep compensation (#33920)
bump
2024-11-01 22:08:29 -07:00
Maxime Desroches
421ee1cffb ci: retry lfs pull (#33918)
* retry

* pin

* name
2024-11-01 22:06:10 -07:00
Dean Lee
6fc14b5b93 selfdrive/debug: fix broken check_can_parser_performance.py (#33908)
* fix check_can_parser_performance.py

* no difference

* this too

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2024-11-01 16:35:39 -07:00
Shane Smiskol
4c0e2926e4 fix test_car_model.py segment format (#33915)
fix test_car_model.py
2024-11-01 16:30:01 -07:00
Shane Smiskol
2af9f68147 LogReader: more specific exceptions (#33914)
* more specific logreader exceptions

* huh

* fix
2024-11-01 15:59:46 -07:00
Shane Smiskol
61508e48a1 PlotJuggler: add actuatorsOutput to longitudinal layout (#33912)
* add actuators output

* clean up
2024-11-01 13:44:57 -07:00
Maxime Desroches
572e9a466c jenkins: parallelizes build of nightly and nightly-dev (#33911)
* split

* fix
2024-11-01 11:16:37 -07:00
Maxime Desroches
df523385ca ci: fix simulator test for github runner (#33910)
* try

* try

* test

* try

* fix

* back
2024-11-01 11:15:21 -07:00
Maxime Desroches
420927c8db jenkins: pass multiple args (#33907)
args
2024-10-31 20:23:16 -07:00
Adeeb Shihadeh
736b6a2f8a agnos 11.2 (#33904)
* agnos 11.2

* update kernel
2024-10-31 16:11:15 -07:00
ZwX1616
7899b9964c IFE: fix bls offset scaling (#33905)
14u

Co-authored-by: Comma Device <device@comma.ai>
2024-10-31 16:00:09 -07:00
Shane Smiskol
c979282cfa Ford: limit acceleration near PCM set speed (#33903)
bump
2024-10-31 14:05:03 -07:00
Maxime Desroches
4716629d70 add nightly-dev to tested_branches (#33901)
fix test
2024-10-31 11:50:58 -07:00
Maxime Desroches
366d6abeb1 fix build in master_ci (#33900)
fix
2024-10-31 10:46:34 -07:00
Maxime Desroches
3e1e9892a0 ci: increase submodules fetch timeout (#33899)
* fix

* increase
2024-10-30 20:21:49 -07:00
Maxime Desroches
183a058853 ci: use setup with retry for static analysis (#33898)
* docker

* setup

* now
2024-10-30 19:57:27 -07:00
ZwX1616
da20b46839 IFE: fix gamma delta (#33897)
update gtab

Co-authored-by: Comma Device <device@comma.ai>
2024-10-30 18:55:43 -07:00
ZwX1616
78b83959e6 IFE: update cst (#33896)
cl was probably wrong
2024-10-30 18:55:19 -07:00
Adeeb Shihadeh
25d2555e49 tizi: fix panda amp race condition (#33895)
* backoff

* bump panda

* cleanup

* fix mypy

---------

Co-authored-by: Comma Device <device@comma.ai>
2024-10-30 17:04:05 -07:00
Mitchell Goff
b470bef140 Fix low-speed allow_throttle behavior in long planner (#33894)
* Misc fixes

* don't check allow_throttle slowdown for e2e

* Removed unused variable

* believe this clip is still necessary

* Update process replay refs

---------

Co-authored-by: Bruce Wayne <harald.the.engineer@gmail.com>
2024-10-30 14:15:19 -07:00
Shane Smiskol
3907134282 Ford: enable radar (#33893)
* enable

* updaterefs

* updatedocs

* bump to master

* bump
2024-10-30 13:23:32 -07:00
Adeeb Shihadeh
5df9fcbde4 bump panda 2024-10-30 11:51:32 -07:00
Shane Smiskol
935e4b9c83 bump opendbc
docs
2024-10-30 01:22:41 -07:00
Maxime Desroches
219fd82b2c ci: fix ui_preview when testing the tests (#33891)
fix for loop
2024-10-29 19:49:23 -07:00
Maxime Desroches
fe53185f64 ci: faster ui preview (#33890)
* fast

* fast

* cleanup
2024-10-29 19:32:31 -07:00
Maxime Desroches
3f09d19c95 ci: x86 build on namespace runner (#33889)
ns
2024-10-29 17:08:57 -07:00
Maxime Desroches
db98566084 ci: faster sim test (#33888)
* sim

* no more
2024-10-29 16:59:48 -07:00
Maxime Desroches
bce376f120 ui_preview: auto expand diffs (#33887)
auto exp
2024-10-29 15:46:48 -07:00
Maxime Desroches
e6afe355d4 model_replay: save plots for each commits (#33886)
* fix

* better

* cleanup
2024-10-29 13:56:16 -07:00
Maxime Desroches
a054816885 nightly-dev (#33876)
* dev

* installer'

* remove

* debug
2024-10-29 13:26:34 -07:00
ZwX1616
22a1b40566 camerad: IFE BLC/linearization (#33884)
* simplify

* not all needed

* need to combine this

* there is none

* p0s

* cleanup

* lgtm

* lgtm2

* same

* 4

---------

Co-authored-by: Comma Device <device@comma.ai>
2024-10-28 18:54:05 -07:00
Maxime Desroches
fcbdd39aaf test_onroad: lower bound for soundd cpu usage (#33883)
lb
2024-10-28 17:25:48 -07:00
Adeeb Shihadeh
7fc7874804 test_pandad: adjust startup time 2024-10-28 15:22:11 -07:00
Adeeb Shihadeh
628e0daee0 tici: remove power save test, it's testing the wrong thing 2024-10-28 15:00:59 -07:00
Maxime Desroches
21bb0a2d7a jenkins: revert unsafe checkout (#33881)
revert
2024-10-28 12:57:36 -07:00
Alexandre Nobuharu Sato
d2794f3dc9 update pt-BR translations (#33879) 2024-10-28 10:39:49 -07:00
commaci-public
f5c26b4057 [bot] Update Python packages (#33880)
Update Python packages

Co-authored-by: Vehicle Researcher <user@comma.ai>
2024-10-28 10:12:43 -07:00
Shane Smiskol
94d10ebf6a Ford: higher curvature rate limits at low speed (#33846)
* use closer to eps limits

* bump

* we've seen ~0.009 at 7 m/s, so allow that

* bump

* bump

* update refs
2024-10-25 23:36:48 -07:00
commaci-public
9fcd159141 [bot] Update Python packages (#33877)
* Update Python packages

* just setting ki

---------

Co-authored-by: Vehicle Researcher <user@comma.ai>
Co-authored-by: Shane Smiskol <shane@smiskol.com>
2024-10-25 23:29:49 -07:00
Adeeb Shihadeh
1932aff0d9 sensord: cleanup logging (#33875)
Co-authored-by: Comma Device <device@comma.ai>
2024-10-25 17:41:23 -07:00
Alexandre Nobuharu Sato
72a88c9319 Add Developer Panel in Settings (#33828)
* hello world

* hello btn

* add ssh toggles

* split out developer panel code

* test this

* fix

* add ZMQ button

* add developer panel case to bot autogen screenshots

* give up bridge

* fix CI (generate screenshots)

* change from btn to toggles and interlock protection

* duplicated

---------

Co-authored-by: Comma Device <device@comma.ai>
2024-10-25 17:37:15 -07:00
Adeeb Shihadeh
1570aa7961 ci: tmp disable regen 2024-10-25 10:47:08 -07:00
Maxime Desroches
251a9f028f jenkins: unsafe checkout for test_onroad (#33872)
unsafe
2024-10-24 20:15:59 -07:00
Shane Smiskol
b943cbd421 Reapply "Remove steering wheel offset for planner slow down for curves" (#33848) (#33849)
* Reapply "Remove steering wheel offset for planner slow down for curves" (#33848)

This reverts commit 4f8b11257e.

* careless

* Update ref_commit
2024-10-24 19:24:11 -07:00
commaci-public
e42c203448 [bot] Update Python packages (#33870)
* Update Python packages

* Update ref_commit

---------

Co-authored-by: Vehicle Researcher <user@comma.ai>
Co-authored-by: Shane Smiskol <shane@smiskol.com>
2024-10-24 18:46:57 -07:00
Dean Lee
5f3625436c ui: show driver camera in popup on demand (#33459)
* show driver camera in a popup dialog

* zero margins

* merge master
2024-10-24 17:10:50 -07:00
Adeeb Shihadeh
85c1b2b620 selfdrived: log all not running (#33869) 2024-10-24 17:02:58 -07:00
Adeeb Shihadeh
835a27e993 statsd: don't use datetime in filename (#33868) 2024-10-24 16:15:10 -07:00
Adeeb Shihadeh
47aee33ad2 sensord: fix timestamp race condition (#33867)
Co-authored-by: Comma Device <device@comma.ai>
2024-10-24 14:00:13 -07:00
Dean Lee
2f7d09bb01 bridge: improve message sending loop (#33810)
improve sending loop
2024-10-24 13:41:14 -07:00
Dean Lee
24a32c3dec replay: remove Qt dependency from Segment and Timeline (#33847)
remove Segment, Timeline dependency on Qt
2024-10-24 13:41:01 -07:00
Adeeb Shihadeh
db98ba88ab bump panda 2024-10-24 13:35:58 -07:00
Shane Smiskol
07ad6e27d0 radard: remove deprecated function 2024-10-23 22:13:08 -07:00
Maxime Desroches
a8908b5c08 model_replay: skip report if no PR associated with the branch (#33866)
* no pr number

* better

* test

* cleanup
2024-10-23 21:22:03 -07:00
Adeeb Shihadeh
719c634668 Setup IFE vignetting correction (#33853)
* vignetting

* lil more

* cleanup

---------

Co-authored-by: Comma Device <device@comma.ai>
2024-10-23 19:52:06 -07:00
Adeeb Shihadeh
8557b0440e camerad: fixup IFE cropping (#33865)
* start fixing

* cleanup

---------

Co-authored-by: Comma Device <device@comma.ai>
2024-10-23 19:38:05 -07:00
Adeeb Shihadeh
0466d111d2 camerad: set EOF based on readout time (#33859)
* camerad: set EOF based on readout time

* set ar

* debug

* set processing time

* set ox

---------

Co-authored-by: Comma Device <device@comma.ai>
2024-10-23 19:08:21 -07:00
Shane Smiskol
0b20007242 longitudinal report: valid if capable of resuming (#33864)
.
2024-10-23 19:07:57 -07:00
Shane Smiskol
c473688b2b bump opendbc (#33862)
* bump

* update docs

* update refs
2024-10-23 14:09:39 -07:00
Shane Smiskol
0440c3a83b Deprecate some controls fields (#33857)
* deprecate a field

* some more

* bump
2024-10-23 13:49:10 -07:00
Kacper Rączy
0ff498cc83 longitudinal_planner: allow for zero actuator delay (#33855)
Allow zero actuator delay
2024-10-22 20:49:10 -07:00
Adeeb Shihadeh
cf420ed001 IFE register cleanup (#33854)
* remove first update

* no duplicates

* fix build

* lil more

* lil more

* lil more

* cleanup

---------

Co-authored-by: Comma Device <device@comma.ai>
2024-10-22 18:35:04 -07:00
Adeeb Shihadeh
fc5aed10d5 Enable IFE linearization (#33852)
* enable linearization

* fixup

* gate that

---------

Co-authored-by: Comma Device <device@comma.ai>
2024-10-22 15:14:39 -07:00
Adeeb Shihadeh
fc5f761fa8 camerad: setup IFE gamma correction (#33837)
* setup gamma

* ife happy

* config for sensor

* fill and clean up

* cleanup

---------

Co-authored-by: Comma Device <device@comma.ai>
Co-authored-by: ZwX1616 <zwx1616@gmail.com>
2024-10-22 14:41:51 -07:00
Shane Smiskol
4f8b11257e Revert "Remove steering wheel offset for planner slow down for curves" (#33848)
Revert "Remove steering wheel offset for planner slow down for curves (#33827)"

This reverts commit d26730ffd5.
2024-10-22 12:58:06 -07:00
Tim Wilson
d26730ffd5 Remove steering wheel offset for planner slow down for curves (#33827)
* long planner: use vehicle model w/ avg steer offset for limit accel in turns

* remove unused CP in limit_accel_in_turns

* revert use of vehicle model, keeping angle offset in limit accel in turns

* only the offset fix, check valid, and fix process replay

* update refs (valid two frames later)

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2024-10-22 12:50:06 -07:00
Adeeb Shihadeh
b87a52a9a0 all raw for now 2024-10-21 20:13:29 -07:00
Adeeb Shihadeh
f7f15d63dc CSID cropping for IFE (#33844)
* ife csid crop

* fix reg processing

---------

Co-authored-by: Comma Device <device@comma.ai>
2024-10-21 19:55:39 -07:00
commaci-public
c78fc60d9b [bot] Update Python packages (#33842)
Update Python packages

Co-authored-by: Vehicle Researcher <user@comma.ai>
2024-10-21 19:22:34 -07:00
Shane Smiskol
3396c59151 maneuversd: auto-resume if possible (#33841)
maneuversd auto-resume
2024-10-21 17:33:48 -07:00
ZwX1616
0d6baffcbf camerad: disable os HDR (#33838)
* revert hdr settings

* 12

* pv12

---------

Co-authored-by: Comma Device <device@comma.ai>
2024-10-21 16:14:26 -07:00
Kacper Rączy
67ced42a15 process_replay: longitudinalPlan migration (#33832)
* migration for longitudinalPlan aTarget

* Fix file

* Fix

* Car params optional, not critical

* Save should stop too
2024-10-21 15:13:08 -07:00
Adeeb Shihadeh
89d5761329 camerad: setup IFE black level and color correction (#33834)
* black level

* enable cc

* seems to work

* doesnt do anything

* sensorinfo

* this is fine

* cleanup

* disable

* cleanup os

* revert

---------

Co-authored-by: Comma Device <device@comma.ai>
Co-authored-by: ZwX1616 <zwx1616@gmail.com>
2024-10-21 14:23:44 -07:00
Alexandre Nobuharu Sato
24a8c7ee1a ssh_keys.h import not used by settings.cc (#33829) 2024-10-21 11:46:27 -07:00
Maxime Desroches
277f80dbad jenkins: fix files diff on orphan branches (#33835)
diverge
2024-10-21 10:58:19 -07:00
commaci-public
9daec14220 [bot] Update Python packages (#33833)
Update Python packages

Co-authored-by: Vehicle Researcher <user@comma.ai>
2024-10-21 10:05:52 -07:00
Maxime Desroches
3e5e2b52ea lint: catch NOMERGE comments (#33820)
* nomerge

* Update modeld.py
2024-10-20 13:27:08 -07:00
Dean Lee
371f60413a replay: refactor ConsoleUI to remove Qt dependency (#33826)
Refactor ConsoleUI to remove Qt dependency
2024-10-20 13:08:24 -07:00
Dean Lee
30853a2c41 replay: replace Qt data types with standard C++ data types (#33823)
replace Qt data types with c++ data types
2024-10-19 12:29:15 -07:00
Dean Lee
debd71ebec replay: replace QCommandLineParser with getopt for command-line argument parsing. (#33812)
* use getopt

* fix -h

* show help if no args are provided
2024-10-18 21:32:43 -07:00
Maxime Desroches
c9f7e39d37 jenkins: fix files diff (#33819)
* fix diff

* better

* print

* clean

* this is groovy
2024-10-18 19:12:43 -07:00
Maxime Desroches
0ec1c8707b bump panda to fix master-ci (#33817)
bump panda
2024-10-18 16:32:31 -07:00
Shane Smiskol
c719d06b56 bump opendbc (#33815)
bump
2024-10-18 15:34:50 -07:00
Maxime Desroches
c11d0a6518 setup: upper bound on python version (#33816)
ub
2024-10-18 14:24:51 -07:00
Adeeb Shihadeh
66804173c1 Revert "AGNOS 11 (#33775)"
This reverts commit 8bf34d0dfb.
2024-10-18 13:53:53 -07:00
Dean Lee
af73d6084d ui: revert the 'alive' check to compare with scene.started_frame (#33794)
Revert the 'alive' check to compare with scene.started_frame
2024-10-18 13:16:34 -07:00
Mauricio Alvarez Leon
4537a9d2ac ui-preview: increases delay between frames from 40 ms to 100ms (#33805)
increases delay between frames from 40 ms to 100ms
2024-10-18 10:46:11 -07:00
Dean Lee
6175106b19 ui: enhance DriverView with real-time driver state rendering (#33776)
enhance DriverView
2024-10-17 20:25:32 -07:00
YassineYousfi
34dde0bb36 MLSIM V4 (#33809)
bf0b9aac-ca49-446d-9274-81dcc7c28621/400
2024-10-17 13:14:09 -07:00
Adeeb Shihadeh
9ad2333546 athena: migrate old termux SSH port to new one 2024-10-16 10:59:58 -07:00
Adeeb Shihadeh
53f514cbd3 athena: update SSH port (#33804) 2024-10-16 09:57:57 -07:00
Shane Smiskol
b4252404ec round aTarget 2024-10-15 20:05:44 -07:00
Shane Smiskol
277691cf83 longitudinal reports: save as webp 2024-10-15 14:48:38 -07:00
Shane Smiskol
3a150e51e4 longitudinal report: add git data (#33799)
* add git data

* fix
2024-10-15 14:42:45 -07:00
Dean Lee
ebe0dee2ee card: remove unused CS_prev variable (#33796)
remove unused CS_prev variable
2024-10-15 14:03:11 -07:00
Shane Smiskol
af727d41bb long planner: allow throttle reflects usage (#33792)
* UI is now accurate

* update refs
2024-10-14 20:54:42 -07:00
Shane Smiskol
9674c7b5af longitudinal maneuvers: summary table (#33790)
* bob the builder

* table

* clean up
2024-10-14 16:50:30 -07:00
Dean Lee
3c5d8da469 ui: show tethering status in sidebar (#33786)
show tethering status on sidebar
2024-10-14 14:48:26 -07:00
Shane Smiskol
bf04c4799a ui: always check for longitudinal control (#33788)
should always check in case card publishes CP before we start camera paintGL
2024-10-14 14:35:38 -07:00
Shane Smiskol
fa4a3e3c63 Allow throttle ui: only if openpilot longitudinal (#33787)
check op long
2024-10-14 14:12:33 -07:00
Shane Smiskol
abdd3ad2e9 lower card CPU usage threshold
from removing capnp conversion!
2024-10-14 14:07:48 -07:00
Shane Smiskol
4d4df4822a maneuversd: start from stop repeats 2 times 2024-10-14 13:58:31 -07:00
Greg Hogan
363e020ce6 cabana: SG_ parse allow no space before colon (#33785) 2024-10-14 13:37:51 -07:00
Adeeb Shihadeh
c6c9a0da8f Revert "Add missing detail for OP Long is required (#33780)"
This reverts commit 3420b2a02d.
2024-10-14 13:33:50 -07:00
Dean Lee
eb0f637298 cabana: fix README example for streaming CAN messages from device (#33781)
fix README example for stream command
2024-10-14 13:30:41 -07:00
morrislee
3420b2a02d Add missing detail for OP Long is required (#33780) 2024-10-14 13:30:13 -07:00
commaci-public
f0ccb78afa [bot] Update Python packages (#33784)
Update Python packages

Co-authored-by: Vehicle Researcher <user@comma.ai>
2024-10-14 09:35:43 -07:00
James
3e9127be06 Cleanup process config type annotations (#33782) 2024-10-14 09:35:35 -07:00
Adeeb Shihadeh
dc094792b7 Revert "ci: faster metadrive test (#33755)"
This reverts commit d7c0906d0b.
2024-10-14 09:11:37 -07:00
Adeeb Shihadeh
8bf34d0dfb Reapply "AGNOS 11 (#33775)"
This reverts commit d96a042722.
2024-10-13 13:40:18 -07:00
fishnux
3dd127c5ad tools: fix setup for directories with spaces (#33769)
Now handles $DIR with spaces. Also fixes UV_BIN variable
2024-10-13 09:55:06 -07:00
Adeeb Shihadeh
d96a042722 Revert "AGNOS 11 (#33775)"
This reverts commit 37ba899000.
2024-10-13 09:53:47 -07:00
Adeeb Shihadeh
37ba899000 AGNOS 11 (#33775)
* agnos 11

* prod manifest
2024-10-13 09:10:00 -07:00
Adeeb Shihadeh
a66851aa91 jenkins: fix hanging on SSH (#33779) 2024-10-12 17:11:35 -07:00
Adeeb Shihadeh
7aa4ef5fd6 sentry: fix deprecation warning 2024-10-12 15:31:34 -07:00
Adeeb Shihadeh
8e8f61ad35 camerad: IFE debayer support (#33720)
* ife is up

* split out cdm, bps needs this too

* straight to vipc buffer

* start reducing the diff

* support both

* disable for now

* cleanup

---------

Co-authored-by: Comma Device <device@comma.ai>
2024-10-12 13:07:30 -07:00
Adeeb Shihadeh
6f40dec427 bump msgq (#33777) 2024-10-12 12:05:24 -07:00
Dean Lee
354e909ab1 ui: smooth transition of path colors on AllowThrottle state changes (#33766)
* smooth transition of path colors on AllowThrottle state changes

* Invert blend factor when the state changes mid-animation
2024-10-11 21:08:32 -07:00
Adeeb Shihadeh
747acaac71 camerad: prep to unify IFE + BPS processing (#33770)
* unify

* fixup

* start porting over ife branch

* setup new bufs

---------

Co-authored-by: Comma Device <device@comma.ai>
2024-10-11 20:49:30 -07:00
Adeeb Shihadeh
7150c145ae selfdrived: remove redundant sound card check (#33767)
rm
2024-10-11 09:30:53 -07:00
Shane Smiskol
21a8f9e9ba experimental_model typo 2024-10-10 21:07:03 -07:00
Maxime Desroches
f11e5492f8 ci: keep old comment on model replay report (#33759)
keep old
2024-10-09 15:29:41 -07:00
Maxime Desroches
d7c0906d0b ci: faster metadrive test (#33755)
* fast

* fix

* same ratio

* output

* check old

* error

* fail

* better

* log

* test faster runner

* work?

* test

* ratio

* forward

* try without wait

* test old distance

* fxi

* test old runner

* test this

* assert distance

* cleanup

* better

* get distance

* cleanup

* choose runner

* very slow

* wait

* put this back
2024-10-09 15:16:50 -07:00
Dean Lee
48abdf825b sensord: Handle EINTR for GPIO event reading (#33715)
handle eintr
2024-10-09 13:42:53 -07:00
YassineYousfi
682857f0cd MLSIM V3 (#33745)
* 09366265-2385-4c47-85a9-009aaabc283d/400

* 7a744f78-ac70-4070-b2b2-fd25b736667b/400

* ff6c6166-a9e0-40bc-8867-b0b35bcad8b8/380

* 241215ad-05e1-4153-8fc9-5108c6002123/400
2024-10-09 13:23:52 -07:00
Adeeb Shihadeh
50baf37ddd camerad: fix CAM_SYNC requests (#33757)
* camerad: fix CAM_SYNC requests

* cast

---------

Co-authored-by: Comma Device <device@comma.ai>
2024-10-09 11:56:46 -07:00
Maxime Desroches
596d8b13bb ci: model_replay improvements (#33753)
* diff

* tr

* cleanup

* at the end

* fix
2024-10-08 17:39:13 -07:00
Will
8a8d8c2272 rerun: fix rp_visualization TypeError (#33749)
* Fixed iteration over liveTracks in radar visualization by ensuring the data structure is iterable and made the background black

* Requested changes, moved conditional to function call

* Simplified conditional, renamed method
2024-10-08 14:50:55 -07:00
Maxime Desroches
d72b59832c ci: remove model_replay on pc (#33751)
remove
2024-10-08 14:24:46 -07:00
Adeeb Shihadeh
8cf1b79189 camerad: more ISP prep (#33752) 2024-10-08 14:07:13 -07:00
Jason Young
8b5df1e9ee tools: print VIN when getting UDS fingerprints from a route (#33750)
* tools: print VIN when getting UDS fingerprints

* set in case not there

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2024-10-08 13:41:02 -07:00
Dean Lee
196fb0a7ea cabana: Insert newly split charts directly after the original chart (#33748)
split charts under current chart
2024-10-08 11:20:43 -07:00
Dean Lee
19fdf90585 cabana: fix mouse wheel not scrolling charts when hovering over tips (#33747)
fix mouse wheel not scrolling charts when hovering over tips
2024-10-08 11:20:29 -07:00
Dean Lee
6547d9593c cabana: fix issue where video can’t be paused by click during alert (#33746)
fix pause issue
2024-10-08 11:20:14 -07:00
Maxime Desroches
22bc50fee4 jenkins: model replay only when modeld is in diff (#33743)
* only

* more
2024-10-07 22:02:09 -07:00
Maxime Desroches
2e83e37984 jenkins: model replay report in PR (#33723)
* first

* first

* first

* token

* edit previous comment

* clean

* plots

* linter

* cleaner

* comment

* save ref

* fix

* remove refs

* add tokens

* fix branch

* table

* fix

* real data

* title

* github

* fix

* github api

* better

* clean

* errors

* create bucket

* true

* fix
2024-10-07 21:40:00 -07:00
Adeeb Shihadeh
8bcf930a28 tools: fix compressed_vipc 2024-10-07 19:01:16 -07:00
Maxime Desroches
939d306ac3 jenkins: run pandad tests only when relevant paths change (#33733)
* only

* more
2024-10-07 16:22:43 -07:00
Shane Smiskol
85278520ed test models: allow public routes (#33740)
* source doesn't matter

* this too

* and
2024-10-07 13:44:38 -07:00
Adeeb Shihadeh
853febe21d visionipc: remove RGB support (#33739)
* visionipc: remove RGB support

* bump

* msgq master

* fix sim
2024-10-07 13:24:57 -07:00
Harald Schäfer
2040f04c45 MLSIM V2 (#33727)
* bb2f7438-51f1-41ce-b337-238eaf2fd14d/100

* bb2f7438-51f1-41ce-b337-238eaf2fd14d/110

* bb2f7438-51f1-41ce-b337-238eaf2fd14d/330

* c3aa47aa-a00e-4b42-a40b-526039378a3a/400

* bd637aab-4274-41c1-95ac-25fb8bf88547/400

* Update ref

* 5705291a-5f7b-4849-91e8-4b0ea87f44d3/400

* 9f345169-a30d-4fec-bf06-2a457bf0071f/400

* update refs

---------

Co-authored-by: Yassine <yassine.y10@gmail.com>
2024-10-07 09:40:27 -07:00
commaci-public
4501d633ea [bot] Update Python packages (#33736)
Update Python packages

Co-authored-by: Vehicle Researcher <user@comma.ai>
2024-10-07 09:25:40 -07:00
Maxime Desroches
eca88f5ea2 jenkins: run tests when certain files change (#33682)
* test

* change

* work?

* debug

* git

* temp

* save

* test

* test

* work?

* fix

* test

* cleanup

* fix

* final test

* fix

* clean

* null

* final

* test

* save

* test this

* final
2024-10-05 19:28:09 -07:00
Shane Smiskol
cf50d4ae19 AlertManager: reset duration when re-adding an event (#33478)
* fix alert duration when re-adding an alert before it's ended (personality)

* clean up

* messy test

* clean up test

* Revert "clean up test"

This reverts commit e7c0f80cb3d0061558920cf2baf37c6ea6935c81.

* better name

* debug

* Revert "debug"

This reverts commit da8d561445f0f0d142cec99c583dda798973544c.

* Reapply "clean up test"

This reverts commit a7dba540f78d1c32317e5f89e83de5aac1136c38.

* update refs
2024-10-04 16:57:55 -07:00
Shane Smiskol
91e4978984 OnroadEvent migration: ignore deprecated events (#33731)
ignore deprecate
2024-10-04 16:57:40 -07:00
Jason Young
ad5933cefe Toyota: 2021-23 RAV4 Prime (#33654)
* bump submodules

* bump opendbc

* from @pd0wm commaai/openpilot#31179

* bump panda

* we did need that flag rename

* bump opendbc

* bump opendbc

* bump submodules

* remove the SecOC key from CarParams

* don't log contents of SecOCKey Param

* read and set secoc_key from card

* bump opendbc

* better init flow

* bump opendbc

* saved SecOC key validation

* concise

* CarParams.SecurityConfig

* de-bump panda

* bump opendbc

* cleanup, pass only if required

* add startup event for missing SecOC key

* comment tweak

* bump opendbc

* add capnp entry for startupNoSecOcKey

* bump panda

* bump opendbc

* need priority over underlying LKA fault

* diff reduction: won't need the flag rename

* bump opendbc and panda

* bump submodules

* bump submodules

* bump panda

* bump submodules

* bump panda

* bump opendbc

* bump panda

* bump opendbc

* bump panda

* bump opendbc

* bump opendbc

* bump panda

* bump opendbc

* bump panda to master

* bump opendbc
2024-10-04 19:56:47 -04:00
Shane Smiskol
77f8275b19 bump opendbc
update refs
2024-10-03 23:44:04 -07:00
Shane Smiskol
66ec788005 Test all of selfdrive/ (#33575)
* test selfdrived!

* exit() is for interactive sessions

* fix

* comments

* more

* test all of selfdrive/

* ignore what we used to

* fix test_alerts

* fix test_alertmanager.py
2024-10-03 23:39:13 -07:00
Shane Smiskol
81ed1decc9 unused import 2024-10-03 22:50:09 -07:00
Shane Smiskol
7556233cca Reapply "move car.capnp to opendbc (#33722)" (#33728)
* Reapply "move car.capnp to opendbc" (#33725)

This reverts commit 9d52a5b485.

* why can't i repro?!

* Revert "why can't i repro?!"

This reverts commit 0435d218f790faf7b7aaed27d05ab9ee67b087e6.

* does this cause card to try and read it?

* better place

* wtf

* Reapply "why can't i repro?!"

This reverts commit d24fd5a0abf454f47d5591e3b39039fdc4d0251c.

* also here
2024-10-03 22:47:03 -07:00
Alexandre Nobuharu Sato
4a50526064 Typo on README.md of replay instructions (#33726) 2024-10-03 17:20:01 -07:00
Lee Jong Mun
68f4c8a986 ui: remove space (#33724) 2024-10-03 17:19:06 -07:00
Shane Smiskol
9d52a5b485 Revert "move car.capnp to opendbc" (#33725)
Revert "move car.capnp to opendbc (#33722)"

This reverts commit 8149f7cb11.
2024-10-03 16:57:45 -07:00
Shane Smiskol
8149f7cb11 move car.capnp to opendbc (#33722)
* move car.capnp to opendbc

* bump

* do card

* fix some more tests

* rm helpers

* format fp

* more

* whoops

* bump

* bump to master
2024-10-03 16:40:24 -07:00
Shane Smiskol
af774d894e Deprecate car onroadEvents (#33687)
* new OnroadEvent struct

* and migrate python

* more forgotten

* re-index new OnroadEvent struct

* fix!

* more missing

* migrate onroadEvents

migrate onroadEvents

* migrate dm events

* hacks to get proc replay to say succeeded

* Revert "hacks to get proc replay to say succeeded"

This reverts commit 0bb8803e5755d606ae9f09da5395d9f50678c7c7.

* update refs
2024-10-03 15:20:58 -07:00
Maxime Desroches
72e19ccfc6 jenkins: disable time to onroad (#33719)
comment
2024-10-03 14:25:48 -07:00
Kacper Rączy
b7a3887731 process_replay: fix llk migration (#33717)
* If field is empty put nans

* Move import out
2024-10-03 13:13:19 -07:00
Dean Lee
f7c4aad8bd cameread: remove outdated 'm' and 'atomic' libraries (#33714)
remove unused libs
2024-10-03 10:53:05 -07:00
Dean Lee
6baa541501 ui: refactor model updating and rendering into ModelRenderer class (#33702)
refactor model update

Co-authored-by: Maxime Desroches <desroches.maxime@gmail.com>
2024-10-03 10:46:05 -07:00
Shane Smiskol
aed1eaede5 Deprecate carState.events (#33693)
* add lkas bools

* switch these two over

* bump

* deprecate low speed lockout

* add lowSpeedAlert bool

bump

* GM vehicle speed is now signed!

* reimagine

* rm

* do event

* bump

* STASH

* comment

* bump

* no out!

* format

* move almost everything to selfdrived

* add back CC_prev for cruise initialization

* ok

* errors are passed to radarState as well as freq check

* deprecate!

* use selfdrived for test models events

* we only want noEntry from car events, not system, have to check pedalPressed

* no more events

* regen with buttonEvents set properly

* update refs
2024-10-02 21:32:56 -07:00
Dean Lee
3ca158ad3e camerad: remove Hardware::PC() check (#33713)
remove check for hardware::PC
2024-10-02 21:14:37 -07:00
Kacper Rączy
b2791a8e07 process_replay: in-place modification for message migration (#33695)
* Inplace modification of lr

* Replace the original function

* Add comment

* Change the return type

* Fix carParams retrieval

* Remove the newline

* Include carState migration

* Remove TODO

* Comment

* List instead of gen

* Fix deletion

* Delete camera state if not valid

* Update ref commit

* Remove sorting at the end

* Use migrate_all in ui report

* Allow more control in what to migrate

* Add type annotations

* Static analysis

* Improve type annot

* Fix linter issues

* Remove f-string

* Migrate carState too in test_ui

* Fix peripheralState migration

* Sort at the end

* Fix regen issue

* Fix comments
2024-10-02 20:47:16 -07:00
Shane Smiskol
6f0927011c CarState: add low speed alert field (#33712)
* clean up mazda steer speed alert

* bump
2024-10-02 15:10:33 -07:00
YassineYousfi
2b486b15c6 MLSIM trained model V1 (#33698)
* 87c86ea8-9766-43e9-b72f-185496800301/400

* update ref
2024-10-02 14:47:09 -07:00
Shane Smiskol
06f2ca1179 cars: generic interaction detection (#33710)
* works

* clean up

* bump

* clean up

* it used to consider an action hold down the button, so shouldn't only consider rising edge

* bump
2024-10-02 14:38:00 -07:00
Dean Lee
6aebec7b34 cleanup .gitignore (#33704) 2024-10-02 13:03:46 -07:00
Dean Lee
7fa8e3d8a6 sensord: fix redundant assignment (#33707)
fix redundant assignment
2024-10-02 10:10:26 -07:00
Adeeb Shihadeh
af609212f7 bump qcamera too 2024-10-02 10:10:11 -07:00
Adeeb Shihadeh
c87f953396 test_onroad: bump up hevc size 2024-10-01 23:21:33 -07:00
Shane Smiskol
98e1d840de CarState: add invalidLkasSetting (#33700)
* invalidLkasSetting

* clean up car specific a bit

* clean this up

* deprecate!

* bump

* this was just broken lol

* updaterefs
2024-10-01 23:06:57 -07:00
Shane Smiskol
c19c18cfdb Hyundai: always publish cruise and main buttons (#33701)
* bump

* update refs
2024-10-01 22:46:24 -07:00
Shane Smiskol
aea6790e3c ButtonEvent: rename altButton3 to mainCruise 2024-10-01 21:36:14 -07:00
YassineYousfi
48bd5b9f6b modeld: clip vego (#33699) 2024-10-01 21:33:46 -07:00
Shane Smiskol
9cbd34158f GM: signed wheel speeds (#33697)
* signed wheel speeds

* clean up

* bump to master

* bump to master again

* did a sanity check for negative vego

* bump
2024-10-01 21:17:24 -07:00
Adeeb Shihadeh
521c702a1e jenkins: set device time 2024-10-01 20:34:21 -07:00
Shane Smiskol
516aa59ee6 Deprecate lowSpeedLockout alert (#33696)
* is an accFault

* bump

* bump to master

* remove from car specific
2024-10-01 20:16:25 -07:00
Jason Young
17edc5f660 support for SecOC cars (#33689)
* bump opendbc

* support for SecOC cars

* missed this

* bump opendbc

* un-nest SecOC params

* gate saved key retrieval on IsReleaseBranch false

* bump opendbc

* bump opendbc

* bump opendbc to point of SecOC merge

* bump opendbc
2024-10-01 20:22:46 -04:00
Shane Smiskol
999c86e8a2 Remove VW steer time limit alert (#33692)
* rm

* remove argument

* and more
2024-10-01 17:17:09 -07:00
Jason Young
ba350aac4c merge Tesla without a replay route (#33691)
* bump opendbc

* no Tesla replay route for now

* bump opendbc to head
2024-10-01 19:48:19 -04:00
Adeeb Shihadeh
3b6f7c9a6c sgo shipped! 2024-10-01 13:19:26 -07:00
287 changed files with 8346 additions and 6319 deletions

View File

@@ -1,3 +0,0 @@
.Xauthority
.env
.host/

View File

@@ -1,18 +0,0 @@
FROM ghcr.io/commaai/openpilot-base:latest
RUN apt update && apt install -y vim net-tools usbutils htop ripgrep tmux wget mesa-utils xvfb libxtst6 libxv1 libglu1-mesa gdb bash-completion
RUN python3 -m ensurepip --upgrade
RUN pip3 install ipython jupyter jupyterlab
RUN cd /tmp && \
ARCH=$(arch | sed s/aarch64/arm64/ | sed s/x86_64/amd64/) && \
curl -L -o virtualgl.deb "https://github.com/VirtualGL/virtualgl/releases/download/3.1.1/virtualgl_3.1.1_$ARCH.deb" && \
dpkg -i virtualgl.deb
RUN usermod -aG video batman
USER batman
RUN cd $HOME && \
curl -O https://raw.githubusercontent.com/commaai/agnos-builder/master/userspace/home/.tmux.conf && \
curl -O https://raw.githubusercontent.com/commaai/agnos-builder/master/userspace/home/.vimrc

View File

@@ -1,38 +0,0 @@
#!/usr/bin/env bash
TARGET_USER=batman
source .devcontainer/.host/.env
# override display flag for mac hosts
if [[ $HOST_OS == darwin ]]; then
echo "Setting up DISPLAY override for macOS..."
cat <<EOF >> /home/$TARGET_USER/.bashrc
source .devcontainer/.host/.env
if [ -n "\$HOST_DISPLAY" ]; then
DISPLAY_NUM=\$(echo "\$HOST_DISPLAY" | awk -F: '{print \$NF}')
export DISPLAY=host.docker.internal:\$DISPLAY_NUM
fi
EOF
fi
# setup virtualgl for mac hosts
if [[ $HOST_OS == darwin ]]; then
echo "Setting up virtualgl for macOS..."
cat <<EOF >> /home/$TARGET_USER/.bashrc
if [ -n "\$HOST_DISPLAY" ]; then
export VGL_PORT=10000
export VGL_CLIENT=host.docker.internal
export VGL_COMPRESS=rgb
export VGL_DISPLAY=:99
export VGL_FPS=60
# prevent vglrun from running exec
alias exec=:; source vglrun :; unalias exec
fi
EOF
fi
# These lines are temporary, to remain backwards compatible with old devcontainers
# that were running as root and therefore had their caches written as root
sudo chown -R $TARGET_USER: /tmp/scons_cache
sudo chown -R $TARGET_USER: /tmp/comma_download_cache
sudo chown -R $TARGET_USER: /home/batman/.comma

View File

@@ -1,15 +0,0 @@
#!/usr/bin/env bash
source .devcontainer/.host/.env
# setup safe directories for submodules
SUBMODULE_DIRS=$(git config --file .gitmodules --get-regexp path | awk '{ print $2 }')
for DIR in $SUBMODULE_DIRS; do
git config --global --add safe.directory "$PWD/$DIR"
done
# virtual display for virtualgl
if [[ "$HOST_OS" == "darwin" ]] && [[ -n "$HOST_DISPLAY" ]]; then
echo "Starting virtual display at :99 ..."
tmux new-session -d -s fakedisplay Xvfb :99 -screen 0 1920x1080x24
fi

View File

@@ -1,53 +0,0 @@
{
"name": "openpilot devcontainer",
"build": {
"dockerfile": "Dockerfile"
},
"postCreateCommand": ".devcontainer/container_post_create.sh",
"postStartCommand": ".devcontainer/container_post_start.sh",
"initializeCommand": [".devcontainer/host_setup"],
"privileged": true,
"containerEnv": {
"DISPLAY": "${localEnv:DISPLAY}",
"PYTHONPATH": "${containerWorkspaceFolder}",
"TERM": "xterm-256color",
"force_color_prompt": "1"
},
"runArgs": [
"--volume=/dev:/dev",
"--volume=/tmp/.X11-unix:/tmp/.X11-unix",
"--volume=${localWorkspaceFolder}/.devcontainer/.host/.Xauthority:/home/batman/.Xauthority",
"--volume=${localEnv:HOME}/.comma:/home/batman/.comma",
"--volume=${localEnv:HOME}/.azure:/home/batman/.azure",
"--volume=/tmp/comma_download_cache:/tmp/comma_download_cache",
"--shm-size=1G",
"--add-host=host.docker.internal:host-gateway", // required to use host.docker.internal on linux
"--publish=0.0.0.0:8070-8079:8070-8079" // body ZMQ services
],
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": false,
"installOhMyZsh": false,
"upgradePackages": false,
"username": "batman"
},
"ghcr.io/devcontainers-contrib/features/gh-cli:1": {},
"ghcr.io/devcontainers/features/azure-cli:1": {}
},
"containerUser": "batman",
"remoteUser": "batman",
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"ms-vscode.cpptools",
"ms-toolsai.jupyter",
"guyskk.language-cython",
"lharri73.dbc"
]
}
},
"mounts": [
"type=volume,source=scons_cache,target=/tmp/scons_cache"
]
}

View File

@@ -1,47 +0,0 @@
#!/usr/bin/env bash
# pull base image
if [[ -z $USE_LOCAL_IMAGE ]]; then
echo "Updating openpilot_base image if needed..."
docker pull ghcr.io/commaai/openpilot-base:latest
fi
# setup .host dir
mkdir -p .devcontainer/.host
# setup links to Xauthority
XAUTHORITY_LINK=".devcontainer/.host/.Xauthority"
rm -f $XAUTHORITY_LINK
if [[ -z $XAUTHORITY ]]; then
echo "XAUTHORITY not set. Fallback to ~/.Xauthority ..."
if ! [[ -f $HOME/.Xauthority ]]; then
echo "~/.XAuthority file does not exist. GUI tools may not work properly."
touch $XAUTHORITY_LINK # dummy file to satisfy container volume mount
else
ln -sf $HOME/.Xauthority $XAUTHORITY_LINK
fi
else
ln -sf $XAUTHORITY $XAUTHORITY_LINK
fi
# setup host env file
HOST_INFO_FILE=".devcontainer/.host/.env"
SYSTEM=$(uname -s | tr '[:upper:]' '[:lower:]')
echo "HOST_OS=\"$SYSTEM\"" > $HOST_INFO_FILE
echo "HOST_DISPLAY=\"$DISPLAY\"" >> $HOST_INFO_FILE
# run virtualgl if macos
if [[ $SYSTEM == "darwin" ]]; then
echo
if [[ -f /opt/VirtualGL/bin/vglclient ]]; then
echo "Starting VirtualGL client at port 10000..."
VGL_LOG_FILE=".devcontainer/.host/.vgl/vglclient.log"
mkdir -p "$(dirname $VGL_LOG_FILE)"
/opt/VirtualGL/bin/vglclient -l "$VGL_LOG_FILE" -display "$DISPLAY" -port 10000 -detach
else
echo "VirtualGL not found. GUI tools may not work properly. Some GUI tools require OpenGL to work properly. To use them with XQuartz on mac, VirtualGL needs to be installed. To install it run:"
echo
echo " brew install --cask virtualgl"
echo
fi
fi

View File

@@ -1,10 +0,0 @@
:: pull base image
IF NOT DEFINED USE_LOCAL_IMAGE ^
echo "Updating openpilot_base image if needed..." && ^
docker pull ghcr.io/commaai/openpilot-base:latest
:: setup .host dir
mkdir .devcontainer\.host
:: setup host env file
echo "" > .devcontainer\.host\.env

View File

@@ -8,7 +8,7 @@ assignees: ''
**Checklist**
- [ ] added entry to CAR in selfdrive/car/*/values.py and ran `selfdrive/opcar/docs.py` to generate new docs
- [ ] added entry to CAR in selfdrive/car/*/values.py and ran `selfdrive/car/docs.py` to generate new docs
- [ ] test route added to [routes.py](https://github.com/commaai/openpilot/blob/master/selfdrive/car/tests/routes.py)
- [ ] route with openpilot:
- [ ] route with stock system:

View File

@@ -44,7 +44,7 @@ Explain how you tested this bug fix.
**Checklist**
- [ ] added entry to CAR in selfdrive/car/*/values.py and ran `selfdrive/opcar/docs.py` to generate new docs
- [ ] added entry to CAR in selfdrive/car/*/values.py and ran `selfdrive/car/docs.py` to generate new docs
- [ ] test route added to [routes.py](https://github.com/commaai/openpilot/blob/master/selfdrive/car/tests/routes.py)
- [ ] route with openpilot:
- [ ] route with stock system:

View File

@@ -14,17 +14,25 @@ inputs:
description: 'whether to save the cache'
default: 'false'
required: false
outputs:
cache-hit:
description: 'cache hit occurred'
value: ${{ (contains(runner.name, 'nsc') && steps.ns-cache.outputs.cache-hit) ||
(!contains(runner.name, 'nsc') && inputs.save != 'false' && steps.gha-cache.outputs.cache-hit) ||
(!contains(runner.name, 'nsc') && inputs.save == 'false' && steps.gha-cache-ro.outputs.cache-hit) }}
runs:
using: "composite"
steps:
- name: setup namespace cache
id: ns-cache
if: ${{ contains(runner.name, 'nsc') }}
uses: namespacelabs/nscloud-cache-action@v1
with:
path: ${{ inputs.path }}
- name: setup github cache
id: gha-cache
if: ${{ !contains(runner.name, 'nsc') && inputs.save != 'false' }}
uses: 'actions/cache@v4'
with:
@@ -33,6 +41,7 @@ runs:
restore-keys: ${{ inputs.restore-keys }}
- name: setup github cache
id: gha-cache-ro
if: ${{ !contains(runner.name, 'nsc') && inputs.save == 'false' }}
uses: 'actions/cache/restore@v4'
with:

View File

@@ -15,7 +15,3 @@ jobs:
uses: commaai/openpilot/.github/workflows/selfdrive_tests.yaml@master
with:
run_number: ${{ inputs.run_number }}
tools_tests:
uses: commaai/openpilot/.github/workflows/tools_tests.yaml@master
with:
run_number: ${{ inputs.run_number }}

View File

@@ -19,8 +19,9 @@ jobs:
docs:
name: build docs
runs-on: ubuntu-latest
timeout-minutes: 1
steps:
- uses: commaai/timeout@v1
- uses: actions/checkout@v4
with:
submodules: true

View File

@@ -1,7 +1,7 @@
name: release
on:
schedule:
- cron: '0 10 * * *'
- cron: '0 9 * * *'
workflow_dispatch:
jobs:

View File

@@ -28,7 +28,7 @@ jobs:
git add .
- name: update car docs
run: |
scons -j$(nproc) --minimal opendbc
scons -j$(nproc) --minimal opendbc_repo
PYTHONPATH=. python selfdrive/car/docs.py
git add docs/CARS.md
- name: Create Pull Request

View File

@@ -32,23 +32,28 @@ env:
jobs:
build_release:
name: build release
runs-on: ${{ ((github.repository == 'commaai/openpilot') &&
((github.event_name != 'pull_request') ||
(github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'namespace-profile-amd64-8x16' || 'ubuntu-latest' }}
runs-on:
- ${{ ((github.repository == 'commaai/openpilot') && ((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'namespace-profile-amd64-8x16' || 'ubuntu-24.04' }}
- ${{ ((github.repository == 'commaai/openpilot') && ((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'namespace-experiments:docker.builds.local-cache=separate' || 'ubuntu-24.04' }}
env:
STRIPPED_DIR: /tmp/releasepilot
steps:
- uses: actions/checkout@v4
with:
submodules: true
- run: git lfs pull
- name: Getting LFS files
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e
with:
timeout_minutes: 2
max_attempts: 3
command: git lfs pull
- name: Build devel
timeout-minutes: 1
run: TARGET_DIR=$STRIPPED_DIR release/build_devel.sh
- uses: ./.github/workflows/setup-with-retry
- name: Check submodules
if: github.ref == 'refs/heads/master' && github.repository == 'commaai/openpilot'
timeout-minutes: 1
if: github.repository == 'commaai/openpilot'
timeout-minutes: 3
run: release/check-submodules.sh
- name: Build openpilot and run checks
timeout-minutes: ${{ ((steps.restore-scons-cache.outputs.cache-hit == 'true') && 10 || 30) }} # allow more time when we missed the scons cache
@@ -56,7 +61,7 @@ jobs:
cd $STRIPPED_DIR
${{ env.RUN }} "python3 system/manager/build.py"
- name: Run tests
timeout-minutes: 3
timeout-minutes: 1
run: |
cd $STRIPPED_DIR
${{ env.RUN }} "release/check-dirty.sh && \
@@ -70,13 +75,9 @@ jobs:
${{ env.RUN }} "scripts/lint/lint.sh --skip check_added_large_files"
build:
strategy:
matrix:
arch: ${{ fromJson(
((github.repository == 'commaai/openpilot') &&
((github.event_name != 'pull_request') ||
(github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && '["x86_64", "aarch64"]' || '["x86_64"]' ) }}
runs-on: ${{ (matrix.arch == 'aarch64') && 'namespace-profile-arm64-2x8' || 'ubuntu-latest' }}
runs-on:
- ${{ ((github.repository == 'commaai/openpilot') && ((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'namespace-profile-amd64-8x16' || 'ubuntu-24.04' }}
- ${{ ((github.repository == 'commaai/openpilot') && ((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'namespace-experiments:docker.builds.local-cache=separate' || 'ubuntu-24.04' }}
steps:
- uses: actions/checkout@v4
with:
@@ -85,94 +86,72 @@ jobs:
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request' && github.repository == 'commaai/openpilot'
run: |
echo "PUSH_IMAGE=true" >> "$GITHUB_ENV"
echo "TARGET_ARCHITECTURE=${{ matrix.arch }}" >> "$GITHUB_ENV"
$DOCKER_LOGIN
- uses: ./.github/workflows/setup-with-retry
with:
docker_hub_pat: ${{ secrets.DOCKER_HUB_PAT }}
- uses: ./.github/workflows/compile-openpilot
timeout-minutes: ${{ ((steps.restore-scons-cache.outputs.cache-hit == 'true') && 15 || 30) }} # allow more time when we missed the scons cache
timeout-minutes: 30
build_mac:
name: build macOS
runs-on: macos-latest
runs-on: ${{ github.repository == 'commaai/openpilot' && 'namespace-profile-macos-8x14' || 'macos-latest' }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- run: git lfs pull
- name: Homebrew cache
uses: ./.github/workflows/auto-cache
with:
path: ~/Library/Caches/Homebrew
- name: Install dependencies
run: ./tools/mac_setup.sh
env:
# package install has DeprecationWarnings
PYTHONWARNINGS: default
- run: git lfs pull
- run: echo "CACHE_COMMIT_DATE=$(git log -1 --pretty='format:%cd' --date=format:'%Y-%m-%d-%H:%M')" >> $GITHUB_ENV
- name: Getting scons cache
uses: 'actions/cache@v4'
uses: ./.github/workflows/auto-cache
with:
path: /tmp/scons_cache
key: scons-${{ runner.arch }}-macos-${{ env.CACHE_COMMIT_DATE }}-${{ github.sha }}
restore-keys: |
scons-${{ runner.arch }}-macos-${{ env.CACHE_COMMIT_DATE }}
scons-${{ runner.arch }}-macos
- name: Building openpilot
run: . .venv/bin/activate && scons -j$(nproc)
docker_push_multiarch:
name: docker push multiarch tag
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request' && github.repository == 'commaai/openpilot'
needs: [build]
steps:
- uses: actions/checkout@v4
with:
submodules: false
- name: Setup docker
run: |
$DOCKER_LOGIN
- name: Merge x64 and arm64 tags
run: |
export PUSH_IMAGE=true
scripts/retry.sh selfdrive/test/docker_tag_multiarch.sh base x86_64 aarch64
static_analysis:
name: static analysis
runs-on: ${{ ((github.repository == 'commaai/openpilot') &&
((github.event_name != 'pull_request') ||
(github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'namespace-profile-amd64-8x16' || 'ubuntu-24.04' }}
runs-on:
- ${{ ((github.repository == 'commaai/openpilot') && ((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'namespace-profile-amd64-8x16' || 'ubuntu-24.04' }}
- ${{ ((github.repository == 'commaai/openpilot') && ((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'namespace-experiments:docker.builds.local-cache=separate' || 'ubuntu-24.04' }}
env:
PYTHONWARNINGS: default
steps:
- uses: actions/checkout@v4
- name: Setup
run: tools/op.sh setup
- name: Static analysis
timeout-minutes: 1
run: tools/op.sh lint
unit_tests:
name: unit tests
runs-on: ${{ ((github.repository == 'commaai/openpilot') &&
((github.event_name != 'pull_request') ||
(github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'namespace-profile-amd64-8x16' || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./.github/workflows/setup-with-retry
- name: Static analysis
timeout-minutes: 1
run: ${{ env.RUN }} "scripts/lint/lint.sh"
unit_tests:
name: unit tests
runs-on:
- ${{ ((github.repository == 'commaai/openpilot') && ((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'namespace-profile-amd64-8x16' || 'ubuntu-24.04' }}
- ${{ ((github.repository == 'commaai/openpilot') && ((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'namespace-experiments:docker.builds.local-cache=separate' || 'ubuntu-24.04' }}
steps:
- uses: actions/checkout@v4
with:
docker_hub_pat: ${{ secrets.DOCKER_HUB_PAT }}
submodules: true
- uses: ./.github/workflows/setup-with-retry
- name: Build openpilot
timeout-minutes: ${{ ((steps.restore-scons-cache.outputs.cache-hit == 'true') && 10 || 30) }} # allow more time when we missed the scons cache
run: ${{ env.RUN }} "scons -j$(nproc)"
- name: Run unit tests
timeout-minutes: 15
timeout-minutes: ${{ contains(runner.name, 'nsc') && 1 || 20 }}
run: |
${{ env.RUN }} "source selfdrive/test/setup_xvfb.sh && \
$PYTEST --timeout 60 -m 'not slow' && \
${{ env.RUN }} "$PYTEST --collect-only -m 'not slow' &> /dev/null && \
MAX_EXAMPLES=1 $PYTEST -m 'not slow' && \
./selfdrive/ui/tests/create_test_translations.sh && \
QT_QPA_PLATFORM=offscreen ./selfdrive/ui/tests/test_translations && \
pytest ./selfdrive/ui/tests/test_translations.py"
chmod -R 777 /tmp/comma_download_cache"
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v4
with:
@@ -182,27 +161,25 @@ jobs:
process_replay:
name: process replay
runs-on: ${{ ((github.repository == 'commaai/openpilot') &&
((github.event_name != 'pull_request') ||
(github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'namespace-profile-amd64-8x16' || 'ubuntu-latest' }}
runs-on:
- ${{ ((github.repository == 'commaai/openpilot') && ((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'namespace-profile-amd64-8x16' || 'ubuntu-24.04' }}
- ${{ ((github.repository == 'commaai/openpilot') && ((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'namespace-experiments:docker.builds.local-cache=separate' || 'ubuntu-24.04' }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./.github/workflows/setup-with-retry
with:
docker_hub_pat: ${{ secrets.DOCKER_HUB_PAT }}
- name: Cache test routes
id: dependency-cache
uses: actions/cache@v4
with:
path: .ci_cache/comma_download_cache
key: proc-replay-${{ hashFiles('.github/workflows/selfdrive_tests.yaml', 'selfdrive/test/process_replay/ref_commit', 'selfdrive/test/process_replay/test_regen.py') }}
key: proc-replay-${{ hashFiles('selfdrive/test/process_replay/ref_commit', 'selfdrive/test/process_replay/test_processes.py') }}
- name: Build openpilot
run: |
${{ env.RUN }} "scons -j$(nproc)"
- name: Run replay
timeout-minutes: 30
timeout-minutes: ${{ contains(runner.name, 'nsc') && (steps.dependency-cache.outputs.cache-hit == 'true') && 1 || 20 }}
run: |
${{ env.RUN }} "coverage run selfdrive/test/process_replay/test_processes.py -j$(nproc) && \
chmod -R 777 /tmp/comma_download_cache && \
@@ -222,14 +199,8 @@ jobs:
if: ${{ failure() && steps.print-diff.outcome == 'success' && github.repository == 'commaai/openpilot' && env.AZURE_TOKEN != '' }}
run: |
${{ env.RUN }} "unset PYTHONWARNINGS && AZURE_TOKEN='$AZURE_TOKEN' python3 selfdrive/test/process_replay/test_processes.py -j$(nproc) --upload-only"
# PYTHONWARNINGS triggers a SyntaxError in onnxruntime
- name: Run model replay with ONNX
timeout-minutes: 4
run: |
${{ env.RUN }} "unset PYTHONWARNINGS && \
ONNXCPU=1 NO_NAV=1 coverage run selfdrive/test/process_replay/model_replay.py && \
coverage combine && coverage xml"
- name: Run regen
if: false
timeout-minutes: 4
run: |
${{ env.RUN }} "ONNXCPU=1 $PYTEST selfdrive/test/process_replay/test_regen.py && \
@@ -243,33 +214,33 @@ jobs:
test_cars:
name: cars
runs-on: ${{ ((github.repository == 'commaai/openpilot') &&
((github.event_name != 'pull_request') ||
(github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'namespace-profile-amd64-8x16' || 'ubuntu-latest' }}
runs-on:
- ${{ ((github.repository == 'commaai/openpilot') && ((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'namespace-profile-amd64-8x16' || 'ubuntu-24.04' }}
- ${{ ((github.repository == 'commaai/openpilot') && ((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'namespace-experiments:docker.builds.local-cache=separate' || 'ubuntu-24.04' }}
strategy:
fail-fast: false
matrix:
job: [0, 1]
job: [0, 1, 2, 3]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./.github/workflows/setup-with-retry
- name: Cache test routes
id: dependency-cache
uses: ./.github/workflows/auto-cache
id: routes-cache
uses: actions/cache@v4
with:
path: .ci_cache/comma_download_cache
key: car_models-${{ hashFiles('selfdrive/car/tests/test_models.py', 'selfdrive/car/tests/routes.py') }}-${{ matrix.job }}
- name: Build openpilot
run: ${{ env.RUN }} "scons -j$(nproc)"
- name: Test car models
timeout-minutes: 20
timeout-minutes: ${{ contains(runner.name, 'nsc') && (steps.routes-cache.outputs.cache-hit == 'true') && 1 || 20 }}
run: |
${{ env.RUN }} "$PYTEST selfdrive/car/tests/test_models.py && \
${{ env.RUN }} "MAX_EXAMPLES=1 $PYTEST selfdrive/car/tests/test_models.py && \
chmod -R 777 /tmp/comma_download_cache"
env:
NUM_JOBS: 2
NUM_JOBS: 4
JOB_ID: ${{ matrix.job }}
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v4
@@ -333,24 +304,54 @@ jobs:
comment_id: ${{ steps.fc.outputs.comment-id }}
})
simulator_driving:
name: simulator driving
runs-on:
- ${{ ((github.repository == 'commaai/openpilot') && ((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'namespace-profile-amd64-8x16' || 'ubuntu-24.04' }}
- ${{ ((github.repository == 'commaai/openpilot') && ((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'namespace-experiments:docker.builds.local-cache=separate' || 'ubuntu-24.04' }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./.github/workflows/setup-with-retry
- name: Build openpilot
run: |
${{ env.RUN }} "scons -j$(nproc)"
- name: Driving test
timeout-minutes: 1
run: |
${{ env.RUN }} "source selfdrive/test/setup_xvfb.sh && \
source selfdrive/test/setup_vsound.sh && \
CI=1 pytest tools/sim/tests/test_metadrive_bridge.py"
create_ui_report:
# This job name needs to be the same as UI_JOB_NAME in ui_preview.yaml
name: Create UI Report
runs-on: ubuntu-latest
runs-on:
- ${{ ((github.repository == 'commaai/openpilot') && ((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'namespace-profile-amd64-8x16' || 'ubuntu-24.04' }}
- ${{ ((github.repository == 'commaai/openpilot') && ((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'namespace-experiments:docker.builds.local-cache=separate' || 'ubuntu-24.04' }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./.github/workflows/setup-with-retry
- name: caching frames
id: frames-cache
uses: actions/cache@v4
with:
path: .ci_cache/comma_download_cache
key: ui_screenshots_test_${{ hashFiles('selfdrive/ui/tests/test_ui/run.py') }}
- name: Build openpilot
run: ${{ env.RUN }} "scons -j$(nproc)"
- name: Create Test Report
timeout-minutes: ${{ ((steps.frames-cache.outputs.cache-hit == 'true') && 1 || 3) }}
run: >
${{ env.RUN }} "PYTHONWARNINGS=ignore &&
source selfdrive/test/setup_xvfb.sh &&
python3 selfdrive/ui/tests/test_ui/run.py"
CACHE_ROOT=/tmp/comma_download_cache python3 selfdrive/ui/tests/test_ui/run.py &&
chmod -R 777 /tmp/comma_download_cache"
- name: Upload Test Report
uses: actions/upload-artifact@v4
with:
name: report-${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && 'master' || github.event.number }}
name: report-${{ inputs.run_number || '1' }}-${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && 'master' || github.event.number }}
path: selfdrive/ui/tests/test_ui/report_1/screenshots

View File

@@ -17,7 +17,6 @@ runs:
uses: ./.github/workflows/setup
continue-on-error: true
with:
docker_hub_pat: ${{ inputs.docker_hub_pat }}
is_retried: true
- if: steps.setup1.outcome == 'failure'
shell: bash
@@ -27,7 +26,6 @@ runs:
uses: ./.github/workflows/setup
continue-on-error: true
with:
docker_hub_pat: ${{ inputs.docker_hub_pat }}
is_retried: true
- if: steps.setup2.outcome == 'failure'
shell: bash
@@ -36,5 +34,4 @@ runs:
if: steps.setup2.outcome == 'failure'
uses: ./.github/workflows/setup
with:
docker_hub_pat: ${{ inputs.docker_hub_pat }}
is_retried: true

View File

@@ -1,10 +1,6 @@
name: 'openpilot env setup'
inputs:
docker_hub_pat:
description: 'Auth token for Docker Hub, required for BuildJet jobs'
required: true
default: ''
is_retried:
description: 'A mock param that asserts that we use the setup-with-retry instead of this action directly'
required: false
@@ -20,23 +16,20 @@ runs:
echo "You should not run this action directly. Use setup-with-retry instead"
exit 1
- shell: bash
name: No retries!
run: |
if [ "${{ github.run_attempt }}" -gt 1 ]; then
echo -e "\033[0;31m##################################################"
echo -e "\033[0;31m Retries not allowed! Fix the flaky test! "
echo -e "\033[0;31m##################################################\033[0m"
exit 1
fi
# do this after checkout to ensure our custom LFS config is used to pull from GitLab
- shell: bash
run: git lfs pull
# on BuildJet runners, must be logged into DockerHub to avoid rate limiting
# https://buildjet.com/for-github-actions/docs/guides/docker
- shell: bash
if: ${{ contains(runner.name, 'buildjet') && inputs.docker_hub_pat == '' }}
run: |
echo "Need to set the Docker Hub PAT secret as an input to this action"
exit 1
- name: Login to Docker Hub
if: contains(runner.name, 'buildjet')
shell: bash
run: |
docker login -u adeebshihadeh -p ${{ inputs.docker_hub_pat }}
# build cache
- id: date
shell: bash

View File

@@ -1,72 +0,0 @@
name: tools
on:
push:
branches:
- master
pull_request:
workflow_call:
inputs:
run_number:
default: '1'
required: true
type: string
concurrency:
group: tools-tests-ci-run-${{ inputs.run_number }}-${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && github.run_id || github.head_ref || github.ref }}-${{ github.workflow }}-${{ github.event_name }}
cancel-in-progress: true
env:
BASE_IMAGE: openpilot-base
DOCKER_LOGIN: docker login ghcr.io -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }}
BUILD: selfdrive/test/docker_build.sh base
RUN: docker run --shm-size 2G -v $GITHUB_WORKSPACE:/tmp/openpilot -w /tmp/openpilot -e FILEREADER_CACHE=1 -e PYTHONPATH=/tmp/openpilot -e NUM_JOBS -e JOB_ID -e GITHUB_ACTION -e GITHUB_REF -e GITHUB_HEAD_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_RUN_ID -v $GITHUB_WORKSPACE/.ci_cache/scons_cache:/tmp/scons_cache -v $GITHUB_WORKSPACE/.ci_cache/comma_download_cache:/tmp/comma_download_cache -v $GITHUB_WORKSPACE/.ci_cache/openpilot_cache:/tmp/openpilot_cache $BASE_IMAGE /bin/bash -c
jobs:
simulator_driving:
name: simulator driving
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./.github/workflows/setup-with-retry
- name: Build openpilot
run: |
${{ env.RUN }} "scons -j$(nproc)"
- name: Run bridge test
run: |
${{ env.RUN }} "source selfdrive/test/setup_xvfb.sh && \
source selfdrive/test/setup_vsound.sh && \
CI=1 pytest tools/sim/tests/test_metadrive_bridge.py"
devcontainer:
name: devcontainer
runs-on: ubuntu-latest
if: false # we can re-enable once this is faster
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./.github/workflows/setup-with-retry
- name: Use local image for testing devcontainer with latest base image
run: |
echo "USE_LOCAL_IMAGE=true" >> "$GITHUB_ENV"
- name: Setup Dev Container CLI
run: npm install -g @devcontainers/cli
- name: Build dev container image
run: ./scripts/retry.sh devcontainer build --workspace-folder .
- name: Run dev container
run: |
mkdir -p /tmp/devcontainer_scons_cache/
cp -r $GITHUB_WORKSPACE/.ci_cache/scons_cache/. /tmp/devcontainer_scons_cache/
devcontainer up --workspace-folder .
- name: Test environment
run: |
devcontainer exec --workspace-folder . scons -j$(nproc) cereal/ common/
devcontainer exec --workspace-folder . pip3 install pip-install-test
devcontainer exec --workspace-folder . touch /home/batman/.comma/auth.json
devcontainer exec --workspace-folder . sudo touch /root/test.txt

View File

@@ -52,7 +52,7 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
run_id: ${{ steps.get_run_id.outputs.run_id }}
search_artifacts: true
name: report-${{ env.REPORT_NAME }}
name: report-1-${{ env.REPORT_NAME }}
path: ${{ github.workspace }}/pr_ui
- name: Getting master ui
@@ -84,26 +84,24 @@ jobs:
run: >-
sudo apt-get install -y imagemagick
scenes="homescreen settings_device settings_toggles offroad_alert update_available prime onroad onroad_disengaged onroad_override onroad_sidebar onroad_wide onroad_wide_sidebar onroad_alert_small onroad_alert_mid onroad_alert_full driver_camera body keyboard"
scenes="homescreen settings_device settings_software settings_toggles settings_developer offroad_alert update_available prime onroad onroad_disengaged onroad_override onroad_sidebar onroad_wide onroad_wide_sidebar onroad_alert_small onroad_alert_mid onroad_alert_full driver_camera body keyboard"
A=($scenes)
DIFF=""
open=false
TABLE="<summary>All Screenshots</summary>"
TABLE="<details><summary>All Screenshots</summary>"
TABLE="${TABLE}<table>"
for ((i=0; i<${#A[*]}; i=i+1));
do
if ! compare -fuzz 2% -highlight-color DeepSkyBlue1 -lowlight-color Black -compose Src ${{ github.workspace }}/master_ui/${A[$i]}.png ${{ github.workspace }}/pr_ui/${A[$i]}.png ${{ github.workspace }}/pr_ui/${A[$i]}_diff.png; then
open=true
convert ${{ github.workspace }}/pr_ui/${A[$i]}_diff.png -transparent black mask.png
composite mask.png ${{ github.workspace }}/master_ui/${A[$i]}.png composite_diff.png
convert -delay 20 ${{ github.workspace }}/master_ui/${A[$i]}.png composite_diff.png -loop 0 ${{ github.workspace }}/pr_ui/${A[$i]}_diff.gif
convert -delay 100 ${{ github.workspace }}/master_ui/${A[$i]}.png composite_diff.png -loop 0 ${{ github.workspace }}/pr_ui/${A[$i]}_diff.gif
mv ${{ github.workspace }}/master_ui/${A[$i]}.png ${{ github.workspace }}/pr_ui/${A[$i]}_master_ref.png
DIFF="${DIFF}<details>"
DIFF="${DIFF}<details open>"
DIFF="${DIFF}<summary>${A[$i]} : \$\${\\color{red}\\text{DIFFERENT}}\$\$</summary>"
DIFF="${DIFF}<table>"
@@ -133,14 +131,7 @@ jobs:
fi
done
TABLE="${TABLE}</table>"
TABLE="${TABLE}</details>"
if $open; then
TABLE="<details open>${TABLE}"
else
TABLE="<details>${TABLE}"
fi
TABLE="${TABLE}</table></details>"
echo "DIFF=$DIFF$TABLE" >> "$GITHUB_OUTPUT"

4
.gitignore vendored
View File

@@ -55,9 +55,6 @@ selfdrive/test/longitudinal_maneuvers/out
selfdrive/car/tests/cars_dump
system/camerad/camerad
system/camerad/test/ae_gray_test
selfdrive/modeld/_modeld
selfdrive/modeld/_dmonitoringmodeld
/src/
notebooks
hyperthneed
@@ -79,6 +76,7 @@ selfdrive/modeld/models/*.thneed
selfdrive/modeld/models/*.pkl
*.bz2
*.zst
build/

View File

@@ -68,17 +68,14 @@ RUN usermod -aG sudo $USER
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
USER $USER
COPY --chown=$USER pyproject.toml uv.lock /tmp/
COPY --chown=$USER tools/install_python_dependencies.sh /tmp/tools/
COPY --chown=$USER pyproject.toml uv.lock /home/$USER
COPY --chown=$USER tools/install_python_dependencies.sh /home/$USER/tools/
ENV VIRTUAL_ENV=/home/$USER/.venv
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
RUN cd /tmp && \
RUN cd /home/$USER && \
tools/install_python_dependencies.sh && \
mkdir -p $VIRTUAL_ENV && \
cp -r /tmp/.venv/* $VIRTUAL_ENV && \
rm -rf /tmp/* && \
rm -rf /home/$USER/.cache
rm -rf tools/ pyproject.toml uv.lock .cache
USER root
RUN sudo git config --global --add safe.directory /tmp/openpilot

142
Jenkinsfile vendored
View File

@@ -12,10 +12,12 @@ def retryWithDelay(int maxRetries, int delay, Closure body) {
def device(String ip, String step_label, String cmd) {
withCredentials([file(credentialsId: 'id_rsa', variable: 'key_file')]) {
def ssh_cmd = """
ssh -tt -o ConnectTimeout=5 -o ServerAliveInterval=5 -o ServerAliveCountMax=2 -o BatchMode=yes -o StrictHostKeyChecking=no -i ${key_file} 'comma@${ip}' /usr/bin/bash <<'END'
ssh -o ConnectTimeout=5 -o ServerAliveInterval=5 -o ServerAliveCountMax=2 -o BatchMode=yes -o StrictHostKeyChecking=no -i ${key_file} 'comma@${ip}' exec /usr/bin/bash <<'END'
set -e
export TERM=xterm-256color
shopt -s huponexit # kill all child processes when the shell exits
export CI=1
@@ -25,6 +27,8 @@ export TEST_DIR=${env.TEST_DIR}
export SOURCE_DIR=${env.SOURCE_DIR}
export GIT_BRANCH=${env.GIT_BRANCH}
export GIT_COMMIT=${env.GIT_COMMIT}
export CI_ARTIFACTS_TOKEN=${env.CI_ARTIFACTS_TOKEN}
export GITHUB_COMMENTS_TOKEN=${env.GITHUB_COMMENTS_TOKEN}
export AZURE_TOKEN='${env.AZURE_TOKEN}'
# only use 1 thread for tici tests since most require HIL
export PYTEST_ADDOPTS="-n 0"
@@ -62,9 +66,7 @@ fi
ln -snf ${env.TEST_DIR} /data/pythonpath
cd ${env.TEST_DIR} || true
${cmd}
exit 0
time ${cmd}
END"""
sh script: ssh_cmd, label: step_label
@@ -77,17 +79,38 @@ def deviceStage(String stageName, String deviceType, List extra_env, def steps)
return
}
if (isReplay()) {
error("REPLAYING TESTS IS NOT ALLOWED. FIX THEM INSTEAD.")
}
def extra = extra_env.collect { "export ${it}" }.join('\n');
def branch = env.BRANCH_NAME ?: 'master';
def gitDiff = sh returnStdout: true, script: 'curl -s -H "Authorization: Bearer ${GITHUB_COMMENTS_TOKEN}" https://api.github.com/repos/commaai/openpilot/compare/master...${GIT_BRANCH} | jq .files[].filename || echo "/"', label: 'Getting changes'
lock(resource: "", label: deviceType, inversePrecedence: true, variable: 'device_ip', quantity: 1, resourceSelectStrategy: 'random') {
docker.image('ghcr.io/commaai/alpine-ssh').inside('--user=root') {
timeout(time: 35, unit: 'MINUTES') {
retry (3) {
def date = sh(script: 'date', returnStdout: true).trim();
device(device_ip, "set time", "date -s '" + date + "'")
device(device_ip, "git checkout", extra + "\n" + readFile("selfdrive/test/setup_device_ci.sh"))
}
steps.each { item ->
device(device_ip, item[0], item[1])
def name = item[0]
def cmd = item[1]
def args = item[2]
def diffPaths = args.diffPaths ?: []
def cmdTimeout = args.timeout ?: 9999
if (branch != "master" && diffPaths && !hasPathChanged(gitDiff, diffPaths)) {
println "Skipping ${name}: no changes in ${diffPaths}."
return
} else {
timeout(time: cmdTimeout, unit: 'SECONDS') {
device(device_ip, name, cmd)
}
}
}
}
}
@@ -95,14 +118,43 @@ def deviceStage(String stageName, String deviceType, List extra_env, def steps)
}
}
def hasPathChanged(String gitDiff, List<String> paths) {
for (path in paths) {
if (gitDiff.contains(path)) {
return true
}
}
return false
}
def isReplay() {
def replayClass = "org.jenkinsci.plugins.workflow.cps.replay.ReplayCause"
return currentBuild.rawBuild.getCauses().any{ cause -> cause.toString().contains(replayClass) }
}
def setupCredentials() {
withCredentials([
string(credentialsId: 'azure_token', variable: 'AZURE_TOKEN'),
]) {
env.AZURE_TOKEN = "${AZURE_TOKEN}"
}
withCredentials([
string(credentialsId: 'ci_artifacts_pat', variable: 'CI_ARTIFACTS_TOKEN'),
]) {
env.CI_ARTIFACTS_TOKEN = "${CI_ARTIFACTS_TOKEN}"
}
withCredentials([
string(credentialsId: 'post_comments_github_pat', variable: 'GITHUB_COMMENTS_TOKEN'),
]) {
env.GITHUB_COMMENTS_TOKEN = "${GITHUB_COMMENTS_TOKEN}"
}
}
def step(String name, String cmd, Map args = [:]) {
return [name, cmd, args]
}
node {
env.CI = "1"
@@ -127,82 +179,90 @@ node {
try {
if (env.BRANCH_NAME == 'devel-staging') {
deviceStage("build release3-staging", "tici-needs-can", [], [
["build release3-staging", "RELEASE_BRANCH=release3-staging $SOURCE_DIR/release/build_release.sh"],
step("build release3-staging", "RELEASE_BRANCH=release3-staging $SOURCE_DIR/release/build_release.sh"),
])
}
if (env.BRANCH_NAME == 'master-ci') {
deviceStage("build nightly", "tici-needs-can", [], [
["build nightly", "RELEASE_BRANCH=nightly $SOURCE_DIR/release/build_release.sh"],
])
parallel (
'nightly': {
deviceStage("build nightly", "tici-needs-can", [], [
step("build nightly", "RELEASE_BRANCH=nightly $SOURCE_DIR/release/build_release.sh"),
])
},
'nightly-dev': {
deviceStage("build nightly-dev", "tici-needs-can", [], [
step("build nightly-dev", "PANDA_DEBUG_BUILD=1 RELEASE_BRANCH=nightly-dev $SOURCE_DIR/release/build_release.sh"),
])
},
)
}
if (!env.BRANCH_NAME.matches(excludeRegex)) {
parallel (
// tici tests
'onroad tests': {
deviceStage("onroad", "tici-needs-can", [], [
deviceStage("onroad", "tici-needs-can", ["UNSAFE=1"], [
// TODO: ideally, this test runs in master-ci, but it takes 5+m to build it
//["build master-ci", "cd $SOURCE_DIR/release && TARGET_DIR=$TEST_DIR $SOURCE_DIR/scripts/retry.sh ./build_devel.sh"],
["build openpilot", "cd system/manager && ./build.py"],
["check dirty", "release/check-dirty.sh"],
["onroad tests", "pytest selfdrive/test/test_onroad.py -s"],
["time to onroad", "pytest selfdrive/test/test_time_to_onroad.py"],
step("build openpilot", "cd system/manager && ./build.py"),
step("check dirty", "release/check-dirty.sh"),
step("onroad tests", "pytest selfdrive/test/test_onroad.py -s", [timeout: 60]),
//["time to onroad", "pytest selfdrive/test/test_time_to_onroad.py"],
])
},
'HW + Unit Tests': {
deviceStage("tici-hardware", "tici-common", ["UNSAFE=1"], [
["build", "cd system/manager && ./build.py"],
["test pandad", "pytest selfdrive/pandad/tests/test_pandad.py"],
["test power draw", "pytest -s system/hardware/tici/tests/test_power_draw.py"],
["test encoder", "LD_LIBRARY_PATH=/usr/local/lib pytest system/loggerd/tests/test_encoder.py"],
["test pigeond", "pytest system/ubloxd/tests/test_pigeond.py"],
["test manager", "pytest system/manager/test/test_manager.py"],
step("build", "cd system/manager && ./build.py"),
step("test pandad", "pytest selfdrive/pandad/tests/test_pandad.py", [diffPaths: ["panda", "selfdrive/pandad/"]]),
step("test power draw", "pytest -s system/hardware/tici/tests/test_power_draw.py"),
step("test encoder", "LD_LIBRARY_PATH=/usr/local/lib pytest system/loggerd/tests/test_encoder.py", [diffPaths: ["system/loggerd/"]]),
step("test pigeond", "pytest system/ubloxd/tests/test_pigeond.py", [diffPaths: ["system/ubloxd/"]]),
step("test manager", "pytest system/manager/test/test_manager.py"),
])
},
'loopback': {
deviceStage("loopback", "tici-loopback", ["UNSAFE=1"], [
["build openpilot", "cd system/manager && ./build.py"],
["test pandad loopback", "pytest selfdrive/pandad/tests/test_pandad_loopback.py"],
step("build openpilot", "cd system/manager && ./build.py"),
step("test pandad loopback", "pytest selfdrive/pandad/tests/test_pandad_loopback.py"),
])
},
'camerad': {
deviceStage("AR0231", "tici-ar0231", ["UNSAFE=1"], [
["build", "cd system/manager && ./build.py"],
["test camerad", "pytest system/camerad/test/test_camerad.py"],
["test exposure", "pytest system/camerad/test/test_exposure.py"],
step("build", "cd system/manager && ./build.py"),
step("test camerad", "pytest system/camerad/test/test_camerad.py", [timeout: 60]),
step("test exposure", "pytest system/camerad/test/test_exposure.py"),
])
deviceStage("OX03C10", "tici-ox03c10", ["UNSAFE=1"], [
["build", "cd system/manager && ./build.py"],
["test camerad", "pytest system/camerad/test/test_camerad.py"],
["test exposure", "pytest system/camerad/test/test_exposure.py"],
step("build", "cd system/manager && ./build.py"),
step("test camerad", "pytest system/camerad/test/test_camerad.py", [timeout: 60]),
step("test exposure", "pytest system/camerad/test/test_exposure.py"),
])
},
'sensord': {
deviceStage("LSM + MMC", "tici-lsmc", ["UNSAFE=1"], [
["build", "cd system/manager && ./build.py"],
["test sensord", "pytest system/sensord/tests/test_sensord.py"],
step("build", "cd system/manager && ./build.py"),
step("test sensord", "pytest system/sensord/tests/test_sensord.py"),
])
deviceStage("BMX + LSM", "tici-bmx-lsm", ["UNSAFE=1"], [
["build", "cd system/manager && ./build.py"],
["test sensord", "pytest system/sensord/tests/test_sensord.py"],
step("build", "cd system/manager && ./build.py"),
step("test sensord", "pytest system/sensord/tests/test_sensord.py"),
])
},
'replay': {
deviceStage("model-replay", "tici-replay", ["UNSAFE=1"], [
["build", "cd system/manager && ./build.py"],
["model replay", "selfdrive/test/process_replay/model_replay.py"],
step("build", "cd system/manager && ./build.py", [diffPaths: ["selfdrive/modeld/", "tinygrad_repo", "selfdrive/test/process_replay/model_replay.py"]]),
step("model replay", "selfdrive/test/process_replay/model_replay.py", [diffPaths: ["selfdrive/modeld/", "tinygrad_repo", "selfdrive/test/process_replay/model_replay.py"]]),
])
},
'tizi': {
deviceStage("tizi", "tizi", ["UNSAFE=1"], [
["build openpilot", "cd system/manager && ./build.py"],
["test pandad loopback", "SINGLE_PANDA=1 pytest selfdrive/pandad/tests/test_pandad_loopback.py"],
["test pandad spi", "pytest selfdrive/pandad/tests/test_pandad_spi.py"],
["test pandad", "pytest selfdrive/pandad/tests/test_pandad.py"],
["test amp", "pytest system/hardware/tici/tests/test_amplifier.py"],
["test hw", "pytest system/hardware/tici/tests/test_hardware.py"],
["test qcomgpsd", "pytest system/qcomgpsd/tests/test_qcomgpsd.py"],
step("build openpilot", "cd system/manager && ./build.py"),
step("test pandad loopback", "SINGLE_PANDA=1 pytest selfdrive/pandad/tests/test_pandad_loopback.py"),
step("test pandad spi", "pytest selfdrive/pandad/tests/test_pandad_spi.py"),
step("test pandad", "pytest selfdrive/pandad/tests/test_pandad.py", [diffPaths: ["panda", "selfdrive/pandad/"]]),
step("test amp", "pytest system/hardware/tici/tests/test_amplifier.py"),
step("test qcomgpsd", "pytest system/qcomgpsd/tests/test_qcomgpsd.py", [diffPaths: ["system/qcomgpsd/"]]),
])
},

View File

@@ -1,7 +1,15 @@
Version 0.9.8 (2024-XX-XX)
========================
* New Tomb Raider driving model
* New driving model
* Trained in brand new ML simulator
* Model now gates applying positive accel in Chill mode
* New driving monitoring model
* Reduced false positives related to passengers
* Image processing pipeline moved to the ISP
* More GPU time for driving models
* Power draw reduced 0.5W, which means your device runs cooler
* Added toggle to enable driver monitoring even when openpilot is not engaged
* Enable openpilot longitudinal control for Ford Q3 vehicles
* New Toyota TSS2 longitudinal tune
Version 0.9.7 (2024-06-13)

View File

@@ -349,7 +349,7 @@ Export('common', 'gpucommon')
env_swaglog = env.Clone()
env_swaglog['CXXFLAGS'].append('-DSWAGLOG="\\"common/swaglog.h\\""')
SConscript(['msgq_repo/SConscript'], exports={'env': env_swaglog})
SConscript(['opendbc/can/SConscript'], exports={'env': env_swaglog})
SConscript(['opendbc_repo/SConscript'], exports={'env': env_swaglog})
SConscript(['cereal/SConscript'])
@@ -366,6 +366,7 @@ SConscript(['rednose/SConscript'])
# Build system services
SConscript([
'system/ui/SConscript',
'system/proclogd/SConscript',
'system/ubloxd/SConscript',
'system/loggerd/SConscript',

View File

@@ -1,718 +0,0 @@
using Cxx = import "./include/c++.capnp";
$Cxx.namespace("cereal");
@0x8e2af1e708af8b8d;
# ******* events causing controls state machine transition *******
# FIXME: OnroadEvent shouldn't be in car.capnp, but can't immediately
# move due to being referenced by structs in this file
struct OnroadEvent @0x9b1657f34caf3ad3 {
name @0 :EventName;
# event types
enable @1 :Bool;
noEntry @2 :Bool;
warning @3 :Bool; # alerts presented only when enabled or soft disabling
userDisable @4 :Bool;
softDisable @5 :Bool;
immediateDisable @6 :Bool;
preEnable @7 :Bool;
permanent @8 :Bool; # alerts presented regardless of openpilot state
overrideLateral @10 :Bool;
overrideLongitudinal @9 :Bool;
enum EventName @0xbaa8c5d505f727de {
canError @0;
steerUnavailable @1;
wrongGear @4;
doorOpen @5;
seatbeltNotLatched @6;
espDisabled @7;
wrongCarMode @8;
steerTempUnavailable @9;
reverseGear @10;
buttonCancel @11;
buttonEnable @12;
pedalPressed @13; # exits active state
preEnableStandstill @73; # added during pre-enable state with brake
gasPressedOverride @108; # added when user is pressing gas with no disengage on gas
steerOverride @114;
cruiseDisabled @14;
speedTooLow @17;
outOfSpace @18;
overheat @19;
calibrationIncomplete @20;
calibrationInvalid @21;
calibrationRecalibrating @117;
controlsMismatch @22;
pcmEnable @23;
pcmDisable @24;
radarFault @26;
brakeHold @28;
parkBrake @29;
manualRestart @30;
lowSpeedLockout @31;
joystickDebug @34;
longitudinalManeuver @124;
steerTempUnavailableSilent @35;
resumeRequired @36;
preDriverDistracted @37;
promptDriverDistracted @38;
driverDistracted @39;
preDriverUnresponsive @43;
promptDriverUnresponsive @44;
driverUnresponsive @45;
belowSteerSpeed @46;
lowBattery @48;
accFaulted @51;
sensorDataInvalid @52;
commIssue @53;
commIssueAvgFreq @109;
tooDistracted @54;
posenetInvalid @55;
soundsUnavailable @56;
preLaneChangeLeft @57;
preLaneChangeRight @58;
laneChange @59;
lowMemory @63;
stockAeb @64;
ldw @65;
carUnrecognized @66;
invalidLkasSetting @69;
speedTooHigh @70;
laneChangeBlocked @71;
relayMalfunction @72;
stockFcw @74;
startup @75;
startupNoCar @76;
startupNoControl @77;
startupMaster @78;
fcw @79;
steerSaturated @80;
belowEngageSpeed @84;
noGps @85;
wrongCruiseMode @87;
modeldLagging @89;
deviceFalling @90;
fanMalfunction @91;
cameraMalfunction @92;
cameraFrameRate @110;
processNotRunning @95;
dashcamMode @96;
selfdriveInitializing @98;
usbError @99;
cruiseMismatch @106;
lkasDisabled @107;
canBusMissing @111;
selfdrivedLagging @112;
resumeBlocked @113;
steerTimeLimit @115;
vehicleSensorsInvalid @116;
locationdTemporaryError @103;
locationdPermanentError @118;
paramsdTemporaryError @50;
paramsdPermanentError @119;
actuatorsApiUnavailable @120;
espActive @121;
personalityChanged @122;
aeb @123;
radarCanErrorDEPRECATED @15;
communityFeatureDisallowedDEPRECATED @62;
radarCommIssueDEPRECATED @67;
driverMonitorLowAccDEPRECATED @68;
gasUnavailableDEPRECATED @3;
dataNeededDEPRECATED @16;
modelCommIssueDEPRECATED @27;
ipasOverrideDEPRECATED @33;
geofenceDEPRECATED @40;
driverMonitorOnDEPRECATED @41;
driverMonitorOffDEPRECATED @42;
calibrationProgressDEPRECATED @47;
invalidGiraffeHondaDEPRECATED @49;
invalidGiraffeToyotaDEPRECATED @60;
internetConnectivityNeededDEPRECATED @61;
whitePandaUnsupportedDEPRECATED @81;
commIssueWarningDEPRECATED @83;
focusRecoverActiveDEPRECATED @86;
neosUpdateRequiredDEPRECATED @88;
modelLagWarningDEPRECATED @93;
startupOneplusDEPRECATED @82;
startupFuzzyFingerprintDEPRECATED @97;
noTargetDEPRECATED @25;
brakeUnavailableDEPRECATED @2;
plannerErrorDEPRECATED @32;
gpsMalfunctionDEPRECATED @94;
roadCameraErrorDEPRECATED @100;
driverCameraErrorDEPRECATED @101;
wideRoadCameraErrorDEPRECATED @102;
highCpuUsageDEPRECATED @105;
startupNoFwDEPRECATED @104;
}
}
# ******* main car state @ 100hz *******
# all speeds in m/s
struct CarState {
events @13 :List(OnroadEvent);
# CAN health
canValid @26 :Bool; # invalid counter/checksums
canTimeout @40 :Bool; # CAN bus dropped out
canErrorCounter @48 :UInt32;
# car speed
vEgo @1 :Float32; # best estimate of speed
aEgo @16 :Float32; # best estimate of aCAN cceleration
vEgoRaw @17 :Float32; # unfiltered speed from wheel speed sensors
vEgoCluster @44 :Float32; # best estimate of speed shown on car's instrument cluster, used for UI
vCruise @53 :Float32; # actual set speed
vCruiseCluster @54 :Float32; # set speed to display in the UI
yawRate @22 :Float32; # best estimate of yaw rate
standstill @18 :Bool;
wheelSpeeds @2 :WheelSpeeds;
# gas pedal, 0.0-1.0
gas @3 :Float32; # this is user pedal only
gasPressed @4 :Bool; # this is user pedal only
engineRpm @46 :Float32;
# brake pedal, 0.0-1.0
brake @5 :Float32; # this is user pedal only
brakePressed @6 :Bool; # this is user pedal only
regenBraking @45 :Bool; # this is user pedal only
parkingBrake @39 :Bool;
brakeHoldActive @38 :Bool;
# steering wheel
steeringAngleDeg @7 :Float32;
steeringAngleOffsetDeg @37 :Float32; # Offset betweens sensors in case there multiple
steeringRateDeg @15 :Float32;
steeringTorque @8 :Float32; # TODO: standardize units
steeringTorqueEps @27 :Float32; # TODO: standardize units
steeringPressed @9 :Bool; # if the user is using the steering wheel
steerFaultTemporary @35 :Bool; # temporary EPS fault
steerFaultPermanent @36 :Bool; # permanent EPS fault
stockAeb @30 :Bool;
stockFcw @31 :Bool;
espDisabled @32 :Bool;
accFaulted @42 :Bool;
carFaultedNonCritical @47 :Bool; # some ECU is faulted, but car remains controllable
espActive @51 :Bool;
vehicleSensorsInvalid @52 :Bool; # invalid steering angle readings, etc.
# cruise state
cruiseState @10 :CruiseState;
# gear
gearShifter @14 :GearShifter;
# button presses
buttonEvents @11 :List(ButtonEvent);
leftBlinker @20 :Bool;
rightBlinker @21 :Bool;
genericToggle @23 :Bool;
# lock info
doorOpen @24 :Bool;
seatbeltUnlatched @25 :Bool;
# clutch (manual transmission only)
clutchPressed @28 :Bool;
# blindspot sensors
leftBlindspot @33 :Bool; # Is there something blocking the left lane change
rightBlindspot @34 :Bool; # Is there something blocking the right lane change
fuelGauge @41 :Float32; # battery or fuel tank level from 0.0 to 1.0
charging @43 :Bool;
# process meta
cumLagMs @50 :Float32;
struct WheelSpeeds {
# optional wheel speeds
fl @0 :Float32;
fr @1 :Float32;
rl @2 :Float32;
rr @3 :Float32;
}
struct CruiseState {
enabled @0 :Bool;
speed @1 :Float32;
speedCluster @6 :Float32; # Set speed as shown on instrument cluster
available @2 :Bool;
speedOffset @3 :Float32;
standstill @4 :Bool;
nonAdaptive @5 :Bool;
}
enum GearShifter {
unknown @0;
park @1;
drive @2;
neutral @3;
reverse @4;
sport @5;
low @6;
brake @7;
eco @8;
manumatic @9;
}
# send on change
struct ButtonEvent {
pressed @0 :Bool;
type @1 :Type;
enum Type {
unknown @0;
leftBlinker @1;
rightBlinker @2;
accelCruise @3;
decelCruise @4;
cancel @5;
altButton1 @6;
altButton2 @7;
altButton3 @8;
setCruise @9;
resumeCruise @10;
gapAdjustCruise @11;
}
}
# deprecated
errorsDEPRECATED @0 :List(OnroadEvent.EventName);
brakeLightsDEPRECATED @19 :Bool;
steeringRateLimitedDEPRECATED @29 :Bool;
canMonoTimesDEPRECATED @12: List(UInt64);
canRcvTimeoutDEPRECATED @49 :Bool;
}
# ******* radar state @ 20hz *******
struct RadarData @0x888ad6581cf0aacb {
errors @0 :List(Error);
points @1 :List(RadarPoint);
enum Error {
canError @0;
fault @1;
wrongConfig @2;
}
# similar to LiveTracks
# is one timestamp valid for all? I think so
struct RadarPoint {
trackId @0 :UInt64; # no trackId reuse
# these 3 are the minimum required
dRel @1 :Float32; # m from the front bumper of the car
yRel @2 :Float32; # m
vRel @3 :Float32; # m/s
# these are optional and valid if they are not NaN
aRel @4 :Float32; # m/s^2
yvRel @5 :Float32; # m/s
# some radars flag measurements VS estimates
measured @6 :Bool;
}
# deprecated
canMonoTimesDEPRECATED @2 :List(UInt64);
}
# ******* car controls @ 100hz *******
struct CarControl {
# must be true for any actuator commands to work
enabled @0 :Bool;
latActive @11: Bool;
longActive @12: Bool;
# Final actuator commands
actuators @6 :Actuators;
# Blinker controls
leftBlinker @15: Bool;
rightBlinker @16: Bool;
orientationNED @13 :List(Float32);
angularVelocity @14 :List(Float32);
cruiseControl @4 :CruiseControl;
hudControl @5 :HUDControl;
struct Actuators {
# lateral commands, mutually exclusive
steer @2: Float32; # [0.0, 1.0]
steeringAngleDeg @3: Float32;
curvature @7: Float32;
# longitudinal commands
accel @4: Float32; # m/s^2
longControlState @5: LongControlState;
# these are only for logging the actual values sent to the car over CAN
gas @0: Float32; # [0.0, 1.0]
brake @1: Float32; # [0.0, 1.0]
steerOutputCan @8: Float32; # value sent over can to the car
speed @6: Float32; # m/s
enum LongControlState @0xe40f3a917d908282{
off @0;
pid @1;
stopping @2;
starting @3;
}
}
struct CruiseControl {
cancel @0: Bool;
resume @1: Bool;
override @4: Bool;
speedOverrideDEPRECATED @2: Float32;
accelOverrideDEPRECATED @3: Float32;
}
struct HUDControl {
speedVisible @0: Bool;
setSpeed @1: Float32;
lanesVisible @2: Bool;
leadVisible @3: Bool;
visualAlert @4: VisualAlert;
audibleAlert @5: AudibleAlert;
rightLaneVisible @6: Bool;
leftLaneVisible @7: Bool;
rightLaneDepart @8: Bool;
leftLaneDepart @9: Bool;
leadDistanceBars @10: Int8; # 1-3: 1 is closest, 3 is farthest. some ports may utilize 2-4 bars instead
enum VisualAlert {
# these are the choices from the Honda
# map as good as you can for your car
none @0;
fcw @1;
steerRequired @2;
brakePressed @3;
wrongGear @4;
seatbeltUnbuckled @5;
speedTooHigh @6;
ldw @7;
}
enum AudibleAlert {
none @0;
engage @1;
disengage @2;
refuse @3;
warningSoft @4;
warningImmediate @5;
prompt @6;
promptRepeat @7;
promptDistracted @8;
}
}
gasDEPRECATED @1 :Float32;
brakeDEPRECATED @2 :Float32;
steeringTorqueDEPRECATED @3 :Float32;
activeDEPRECATED @7 :Bool;
rollDEPRECATED @8 :Float32;
pitchDEPRECATED @9 :Float32;
actuatorsOutputDEPRECATED @10 :Actuators;
}
struct CarOutput {
# Any car specific rate limits or quirks applied by
# the CarController are reflected in actuatorsOutput
# and matches what is sent to the car
actuatorsOutput @0 :CarControl.Actuators;
}
# ****** car param ******
struct CarParams {
carName @0 :Text;
carFingerprint @1 :Text;
fuzzyFingerprint @55 :Bool;
notCar @66 :Bool; # flag for non-car robotics platforms
pcmCruise @3 :Bool; # is openpilot's state tied to the PCM's cruise state?
enableDsu @5 :Bool; # driving support unit
enableBsm @56 :Bool; # blind spot monitoring
flags @64 :UInt32; # flags for car specific quirks
experimentalLongitudinalAvailable @71 :Bool;
minEnableSpeed @7 :Float32;
minSteerSpeed @8 :Float32;
safetyConfigs @62 :List(SafetyConfig);
alternativeExperience @65 :Int16; # panda flag for features like no disengage on gas
# Car docs fields
maxLateralAccel @68 :Float32;
autoResumeSng @69 :Bool; # describes whether car can resume from a stop automatically
# things about the car in the manual
mass @17 :Float32; # [kg] curb weight: all fluids no cargo
wheelbase @18 :Float32; # [m] distance from rear axle to front axle
centerToFront @19 :Float32; # [m] distance from center of mass to front axle
steerRatio @20 :Float32; # [] ratio of steering wheel angle to front wheel angle
steerRatioRear @21 :Float32; # [] ratio of steering wheel angle to rear wheel angle (usually 0)
# things we can derive
rotationalInertia @22 :Float32; # [kg*m2] body rotational inertia
tireStiffnessFactor @72 :Float32; # scaling factor used in calculating tireStiffness[Front,Rear]
tireStiffnessFront @23 :Float32; # [N/rad] front tire coeff of stiff
tireStiffnessRear @24 :Float32; # [N/rad] rear tire coeff of stiff
longitudinalTuning @25 :LongitudinalPIDTuning;
lateralParams @48 :LateralParams;
lateralTuning :union {
pid @26 :LateralPIDTuning;
indiDEPRECATED @27 :LateralINDITuning;
lqrDEPRECATED @40 :LateralLQRTuning;
torque @67 :LateralTorqueTuning;
}
steerLimitAlert @28 :Bool;
steerLimitTimer @47 :Float32; # time before steerLimitAlert is issued
vEgoStopping @29 :Float32; # Speed at which the car goes into stopping state
vEgoStarting @59 :Float32; # Speed at which the car goes into starting state
stoppingControl @31 :Bool; # Does the car allow full control even at lows speeds when stopping
steerControlType @34 :SteerControlType;
radarUnavailable @35 :Bool; # True when radar objects aren't visible on CAN or aren't parsed out
stopAccel @60 :Float32; # Required acceleration to keep vehicle stationary
stoppingDecelRate @52 :Float32; # m/s^2/s while trying to stop
startAccel @32 :Float32; # Required acceleration to get car moving
startingState @70 :Bool; # Does this car make use of special starting state
steerActuatorDelay @36 :Float32; # Steering wheel actuator delay in seconds
longitudinalActuatorDelay @58 :Float32; # Gas/Brake actuator delay in seconds
openpilotLongitudinalControl @37 :Bool; # is openpilot doing the longitudinal control?
carVin @38 :Text; # VIN number queried during fingerprinting
dashcamOnly @41: Bool;
passive @73: Bool; # is openpilot in control?
transmissionType @43 :TransmissionType;
carFw @44 :List(CarFw);
radarTimeStep @45: Float32 = 0.05; # time delta between radar updates, 20Hz is very standard
radarDelay @74 :Float32;
fingerprintSource @49: FingerprintSource;
networkLocation @50 :NetworkLocation; # Where Panda/C2 is integrated into the car's CAN network
wheelSpeedFactor @63 :Float32; # Multiplier on wheels speeds to computer actual speeds
struct SafetyConfig {
safetyModel @0 :SafetyModel;
safetyParam @3 :UInt16;
safetyParamDEPRECATED @1 :Int16;
safetyParam2DEPRECATED @2 :UInt32;
}
struct LateralParams {
torqueBP @0 :List(Int32);
torqueV @1 :List(Int32);
}
struct LateralPIDTuning {
kpBP @0 :List(Float32);
kpV @1 :List(Float32);
kiBP @2 :List(Float32);
kiV @3 :List(Float32);
kf @4 :Float32;
}
struct LateralTorqueTuning {
useSteeringAngle @0 :Bool;
kp @1 :Float32;
ki @2 :Float32;
friction @3 :Float32;
kf @4 :Float32;
steeringAngleDeadzoneDeg @5 :Float32;
latAccelFactor @6 :Float32;
latAccelOffset @7 :Float32;
}
struct LongitudinalPIDTuning {
kpBP @0 :List(Float32);
kpV @1 :List(Float32);
kiBP @2 :List(Float32);
kiV @3 :List(Float32);
kf @6 :Float32;
deadzoneBPDEPRECATED @4 :List(Float32);
deadzoneVDEPRECATED @5 :List(Float32);
}
struct LateralINDITuning {
outerLoopGainBP @4 :List(Float32);
outerLoopGainV @5 :List(Float32);
innerLoopGainBP @6 :List(Float32);
innerLoopGainV @7 :List(Float32);
timeConstantBP @8 :List(Float32);
timeConstantV @9 :List(Float32);
actuatorEffectivenessBP @10 :List(Float32);
actuatorEffectivenessV @11 :List(Float32);
outerLoopGainDEPRECATED @0 :Float32;
innerLoopGainDEPRECATED @1 :Float32;
timeConstantDEPRECATED @2 :Float32;
actuatorEffectivenessDEPRECATED @3 :Float32;
}
struct LateralLQRTuning {
scale @0 :Float32;
ki @1 :Float32;
dcGain @2 :Float32;
# State space system
a @3 :List(Float32);
b @4 :List(Float32);
c @5 :List(Float32);
k @6 :List(Float32); # LQR gain
l @7 :List(Float32); # Kalman gain
}
enum SafetyModel {
silent @0;
hondaNidec @1;
toyota @2;
elm327 @3;
gm @4;
hondaBoschGiraffe @5;
ford @6;
cadillac @7;
hyundai @8;
chrysler @9;
tesla @10;
subaru @11;
gmPassive @12;
mazda @13;
nissan @14;
volkswagen @15;
toyotaIpas @16;
allOutput @17;
gmAscm @18;
noOutput @19; # like silent but without silent CAN TXs
hondaBosch @20;
volkswagenPq @21;
subaruPreglobal @22; # pre-Global platform
hyundaiLegacy @23;
hyundaiCommunity @24;
volkswagenMlb @25;
hongqi @26;
body @27;
hyundaiCanfd @28;
volkswagenMqbEvo @29;
chryslerCusw @30;
psa @31;
fcaGiorgio @32;
}
enum SteerControlType {
torque @0;
angle @1;
curvatureDEPRECATED @2;
}
enum TransmissionType {
unknown @0;
automatic @1; # Traditional auto, including DSG
manual @2; # True "stick shift" only
direct @3; # Electric vehicle or other direct drive
cvt @4;
}
struct CarFw {
ecu @0 :Ecu;
fwVersion @1 :Data;
address @2 :UInt32;
subAddress @3 :UInt8;
responseAddress @4 :UInt32;
request @5 :List(Data);
brand @6 :Text;
bus @7 :UInt8;
logging @8 :Bool;
obdMultiplexing @9 :Bool;
}
enum Ecu {
eps @0;
abs @1;
fwdRadar @2;
fwdCamera @3;
engine @4;
unknown @5;
transmission @8; # Transmission Control Module
hybrid @18; # hybrid control unit, e.g. Chrysler's HCP, Honda's IMA Control Unit, Toyota's hybrid control computer
srs @9; # airbag
gateway @10; # can gateway
hud @11; # heads up display
combinationMeter @12; # instrument cluster
electricBrakeBooster @15;
shiftByWire @16;
adas @19;
cornerRadar @21;
hvac @20;
parkingAdas @7; # parking assist system ECU, e.g. Toyota's IPAS, Hyundai's RSPA, etc.
epb @22; # electronic parking brake
telematics @23;
body @24; # body control module
# Toyota only
dsu @6;
# Honda only
vsa @13; # Vehicle Stability Assist
programmedFuelInjection @14;
debug @17;
}
enum FingerprintSource {
can @0;
fw @1;
fixed @2;
}
enum NetworkLocation {
fwdCamera @0; # Standard/default integration at LKAS camera
gateway @1; # Integration at vehicle's CAN gateway
}
enableGasInterceptorDEPRECATED @2 :Bool;
enableCameraDEPRECATED @4 :Bool;
enableApgsDEPRECATED @6 :Bool;
steerRateCostDEPRECATED @33 :Float32;
isPandaBlackDEPRECATED @39 :Bool;
hasStockCameraDEPRECATED @57 :Bool;
safetyParamDEPRECATED @10 :Int16;
safetyModelDEPRECATED @9 :SafetyModel;
safetyModelPassiveDEPRECATED @42 :SafetyModel = silent;
minSpeedCanDEPRECATED @51 :Float32;
communityFeatureDEPRECATED @46: Bool;
startingAccelRateDEPRECATED @53 :Float32;
steerMaxBPDEPRECATED @11 :List(Float32);
steerMaxVDEPRECATED @12 :List(Float32);
gasMaxBPDEPRECATED @13 :List(Float32);
gasMaxVDEPRECATED @14 :List(Float32);
brakeMaxBPDEPRECATED @15 :List(Float32);
brakeMaxVDEPRECATED @16 :List(Float32);
directAccelControlDEPRECATED @30 :Bool;
maxSteeringAngleDegDEPRECATED @54 :Float32;
longitudinalActuatorDelayLowerBoundDEPRECATED @61 :Float32;
}

1
cereal/car.capnp Symbolic link
View File

@@ -0,0 +1 @@
../opendbc_repo/opendbc/car/car.capnp

View File

@@ -17,6 +17,119 @@ struct Map(Key, Value) {
}
}
struct OnroadEvent @0xc4fa6047f024e718 {
name @0 :EventName;
# event types
enable @1 :Bool;
noEntry @2 :Bool;
warning @3 :Bool; # alerts presented only when enabled or soft disabling
userDisable @4 :Bool;
softDisable @5 :Bool;
immediateDisable @6 :Bool;
preEnable @7 :Bool;
permanent @8 :Bool; # alerts presented regardless of openpilot state
overrideLateral @10 :Bool;
overrideLongitudinal @9 :Bool;
enum EventName @0x91f1992a1f77fb03 {
canError @0;
steerUnavailable @1;
wrongGear @2;
doorOpen @3;
seatbeltNotLatched @4;
espDisabled @5;
wrongCarMode @6;
steerTempUnavailable @7;
reverseGear @8;
buttonCancel @9;
buttonEnable @10;
pedalPressed @11; # exits active state
preEnableStandstill @12; # added during pre-enable state with brake
gasPressedOverride @13; # added when user is pressing gas with no disengage on gas
steerOverride @14;
cruiseDisabled @15;
speedTooLow @16;
outOfSpace @17;
overheat @18;
calibrationIncomplete @19;
calibrationInvalid @20;
calibrationRecalibrating @21;
controlsMismatch @22;
pcmEnable @23;
pcmDisable @24;
radarFault @25;
brakeHold @26;
parkBrake @27;
manualRestart @28;
joystickDebug @29;
longitudinalManeuver @30;
steerTempUnavailableSilent @31;
resumeRequired @32;
preDriverDistracted @33;
promptDriverDistracted @34;
driverDistracted @35;
preDriverUnresponsive @36;
promptDriverUnresponsive @37;
driverUnresponsive @38;
belowSteerSpeed @39;
lowBattery @40;
accFaulted @41;
sensorDataInvalid @42;
commIssue @43;
commIssueAvgFreq @44;
tooDistracted @45;
posenetInvalid @46;
preLaneChangeLeft @48;
preLaneChangeRight @49;
laneChange @50;
lowMemory @51;
stockAeb @52;
ldw @53;
carUnrecognized @54;
invalidLkasSetting @55;
speedTooHigh @56;
laneChangeBlocked @57;
relayMalfunction @58;
stockFcw @59;
startup @60;
startupNoCar @61;
startupNoControl @62;
startupNoSecOcKey @63;
startupMaster @64;
fcw @65;
steerSaturated @66;
belowEngageSpeed @67;
noGps @68;
wrongCruiseMode @69;
modeldLagging @70;
deviceFalling @71;
fanMalfunction @72;
cameraMalfunction @73;
cameraFrameRate @74;
processNotRunning @75;
dashcamMode @76;
selfdriveInitializing @77;
usbError @78;
cruiseMismatch @79;
canBusMissing @80;
selfdrivedLagging @81;
resumeBlocked @82;
steerTimeLimit @83;
vehicleSensorsInvalid @84;
locationdTemporaryError @85;
locationdPermanentError @86;
paramsdTemporaryError @87;
paramsdPermanentError @88;
actuatorsApiUnavailable @89;
espActive @90;
personalityChanged @91;
aeb @92;
soundsUnavailableDEPRECATED @47;
}
}
enum LongitudinalPersonality {
aggressive @0;
standard @1;
@@ -373,6 +486,9 @@ struct DeviceState @0xa4d8b5af2aa492eb {
nvmeTempC @35 :List(Float32);
modemTempC @36 :List(Float32);
pmicTempC @39 :List(Float32);
intakeTempC @46 :Float32;
exhaustTempC @47 :Float32;
caseTempC @48 :Float32;
maxTempC @44 :Float32; # max of other temps, used to control fan
thermalZones @38 :List(ThermalZone);
thermalStatus @14 :ThermalStatus;
@@ -731,7 +847,6 @@ struct ControlsState @0x97ff69c53601abf1 {
lateralPlanMonoTime @50 :UInt64;
longControlState @30 :Car.CarControl.Actuators.LongControlState;
vTargetLead @3 :Float32;
upAccelCmd @4 :Float32;
uiAccelCmd @5 :Float32;
ufAccelCmd @33 :Float32;
@@ -740,7 +855,6 @@ struct ControlsState @0x97ff69c53601abf1 {
forceDecel @51 :Bool;
lateralControlState :union {
indiState @52 :LateralINDIState;
pidState @53 :LateralPIDState;
angleState @58 :LateralAngleState;
debugState @59 :LateralDebugState;
@@ -748,6 +862,7 @@ struct ControlsState @0x97ff69c53601abf1 {
curvatureStateDEPRECATED @65 :LateralCurvatureState;
lqrStateDEPRECATED @55 :LateralLQRState;
indiStateDEPRECATED @52 :LateralINDIState;
}
struct LateralINDIState {
@@ -881,6 +996,7 @@ struct ControlsState @0x97ff69c53601abf1 {
startMonoTimeDEPRECATED @48 :UInt64;
cumLagMsDEPRECATED @15 :Float32;
aTargetDEPRECATED @35 :Float32;
vTargetLeadDEPRECATED @3 :Float32;
}
struct DrivingModelData {
@@ -1157,7 +1273,7 @@ struct LongitudinalPlan @0xe00b5b3eba12876c {
radarValidDEPRECATED @28 :Bool;
radarCanErrorDEPRECATED @30 :Bool;
commIssueDEPRECATED @31 :Bool;
eventsDEPRECATED @13 :List(Car.OnroadEvent);
eventsDEPRECATED @13 :List(Car.OnroadEventDEPRECATED);
gpsTrajectoryDEPRECATED @12 :GpsTrajectory;
gpsPlannerActiveDEPRECATED @19 :Bool;
personalityDEPRECATED @36 :LongitudinalPersonality;
@@ -2072,7 +2188,7 @@ struct DriverStateDEPRECATED @0xb83c6cc593ed0a00 {
}
struct DriverMonitoringState @0xb83cda094a1da284 {
events @0 :List(Car.OnroadEvent);
events @18 :List(OnroadEvent);
faceDetected @1 :Bool;
isDistracted @2 :Bool;
distractedType @17 :UInt32;
@@ -2091,6 +2207,7 @@ struct DriverMonitoringState @0xb83cda094a1da284 {
isPreviewDEPRECATED @15 :Bool;
rhdCheckedDEPRECATED @5 :Bool;
eventsDEPRECATED @0 :List(Car.OnroadEventDEPRECATED);
}
struct Boot {
@@ -2369,7 +2486,7 @@ struct Event {
liveTorqueParameters @94 :LiveTorqueParametersData;
cameraOdometry @63 :CameraOdometry;
thumbnail @66: Thumbnail;
onroadEvents @68: List(Car.OnroadEvent);
onroadEvents @134: List(OnroadEvent);
carParams @69: Car.CarParams;
driverMonitoringState @71: DriverMonitoringState;
livePose @129 :LivePose;
@@ -2484,5 +2601,6 @@ struct Event {
uiPlanDEPRECATED @106 :UiPlan;
liveLocationKalmanDEPRECATED @72 :LiveLocationKalman;
liveTracksDEPRECATED @16 :List(LiveTracksDEPRECATED);
onroadEventsDEPRECATED @68: List(Car.OnroadEventDEPRECATED);
}
}

View File

@@ -48,11 +48,12 @@ void MsgqToZmq::run(const std::vector<std::string> &endpoints, const std::string
for (auto sub_sock : msgq_poller->poll(100)) {
// Process messages for each socket
ZMQPubSocket *pub_sock = sub2pub.at(sub_sock);
for (int i = 0; i < MAX_MESSAGES_PER_SOCKET; ++i) {
auto msg = std::unique_ptr<Message>(sub_sock->receive(true));
if (!msg) break;
while (sub2pub[sub_sock]->sendMessage(msg.get()) == -1) {
while (pub_sock->sendMessage(msg.get()) == -1) {
if (errno != EINTR) break;
}
}

View File

@@ -168,18 +168,18 @@ class TestMessaging:
# this test doesn't work with ZMQ since multiprocessing interrupts it
if "ZMQ" not in os.environ:
# wait 15 socket timeouts and make sure it's still retrying
# wait 5 socket timeouts and make sure it's still retrying
p = multiprocessing.Process(target=messaging.recv_one_retry, args=(sub_sock,))
p.start()
time.sleep(sock_timeout*15)
time.sleep(sock_timeout*5)
assert p.is_alive()
p.terminate()
# wait 15 socket timeouts before sending
# wait 5 socket timeouts before sending
msg = random_carstate()
delayed_send(sock_timeout*15, pub_sock, msg.to_bytes())
delayed_send(sock_timeout*5, pub_sock, msg.to_bytes())
start_time = time.monotonic()
recvd = messaging.recv_one_retry(sub_sock)
assert (time.monotonic() - start_time) >= sock_timeout*15
assert (time.monotonic() - start_time) >= sock_timeout*5
assert isinstance(recvd, capnp._DynamicStructReader)
assert_carstate(msg.carState, recvd.carState)

View File

@@ -63,14 +63,13 @@ class TestSubMaster:
def test_update_timeout(self):
sock = random_sock()
sm = messaging.SubMaster([sock,])
for _ in range(5):
timeout = random.randrange(1000, 5000)
start_time = time.monotonic()
sm.update(timeout)
t = time.monotonic() - start_time
assert t >= timeout/1000.
assert t < 5
assert not any(sm.updated.values())
timeout = random.randrange(1000, 3000)
start_time = time.monotonic()
sm.update(timeout)
t = time.monotonic() - start_time
assert t >= timeout/1000.
assert t < 3
assert not any(sm.updated.values())
def test_avg_frequency_checks(self):
for poll in (True, False):

View File

@@ -17,5 +17,5 @@ class TestServices:
def test_generated_header(self):
with tempfile.NamedTemporaryFile(suffix=".h") as f:
ret = os.system(f"python3 {services.__file__} > {f.name} && clang++ {f.name}")
ret = os.system(f"python3 {services.__file__} > {f.name} && clang++ {f.name} -std=c++11")
assert ret == 0, "generated services header is not valid C"

View File

@@ -112,7 +112,6 @@ std::unordered_map<std::string, uint32_t> keys = {
{"DisablePowerDown", PERSISTENT},
{"DisableUpdates", PERSISTENT},
{"DisengageOnAccelerator", PERSISTENT},
{"DmModelInitialized", CLEAR_ON_ONROAD_TRANSITION},
{"DongleId", PERSISTENT},
{"DoReboot", CLEAR_ON_MANAGER_START},
{"DoShutdown", CLEAR_ON_MANAGER_START},
@@ -182,6 +181,7 @@ std::unordered_map<std::string, uint32_t> keys = {
{"PrimeType", PERSISTENT},
{"RecordFront", PERSISTENT},
{"RecordFrontLock", PERSISTENT}, // for the internal fleet
{"SecOCKey", PERSISTENT | DONT_LOG},
{"RouteCount", PERSISTENT},
{"SnoozeUpdate", CLEAR_ON_MANAGER_START | CLEAR_ON_OFFROAD_TRANSITION},
{"SshEnabled", PERSISTENT},

View File

@@ -36,11 +36,16 @@ class UnknownKeyName(Exception):
cdef class Params:
cdef c_Params* p
cdef str d
def __cinit__(self, d=""):
cdef string path = <string>d.encode()
with nogil:
self.p = new c_Params(path)
self.d = d
def __reduce__(self):
return (type(self), (self.d,))
def __dealloc__(self):
del self.p

View File

@@ -59,15 +59,13 @@ class PIDController:
if override:
self.i -= self.i_unwind_rate * float(np.sign(self.i))
else:
i = self.i + error * self.k_i * self.i_rate
control = self.p + i + self.d + self.f
if not freeze_integrator:
self.i = self.i + error * self.k_i * self.i_rate
# Update when changing i will move the control away from the limits
# or when i will move towards the sign of the error
if ((error >= 0 and (control <= self.pos_limit or i < 0.0)) or
(error <= 0 and (control >= self.neg_limit or i > 0.0))) and \
not freeze_integrator:
self.i = i
# Clip i to prevent exceeding control limits
control_no_i = self.p + self.d + self.f
control_no_i = clip(control_no_i, self.neg_limit, self.pos_limit)
self.i = clip(self.i, self.neg_limit - control_no_i, self.pos_limit - control_no_i)
control = self.p + self.i + self.d + self.f

View File

@@ -13,7 +13,7 @@ public:
if (prefix.empty()) {
prefix = util::random_string(15);
}
msgq_path = "/dev/shm/" + prefix;
msgq_path = Path::shm_path() + "/" + prefix;
bool ret = util::create_directories(msgq_path, 0777);
assert(ret);
setenv("OPENPILOT_PREFIX", prefix.c_str(), 1);

View File

@@ -11,7 +11,7 @@ from openpilot.system.hardware.hw import DEFAULT_DOWNLOAD_CACHE_ROOT
class OpenpilotPrefix:
def __init__(self, prefix: str = None, clean_dirs_on_exit: bool = True, shared_download_cache: bool = False):
self.prefix = prefix if prefix else str(uuid.uuid4().hex[0:15])
self.msgq_path = os.path.join('/dev/shm', self.prefix)
self.msgq_path = os.path.join(Paths.shm_path(), self.prefix)
self.clean_dirs_on_exit = clean_dirs_on_exit
self.shared_download_cache = shared_download_cache

View File

@@ -48,13 +48,13 @@ class Ratekeeper:
def __init__(self, rate: float, print_delay_threshold: float | None = 0.0) -> None:
"""Rate in Hz for ratekeeping. print_delay_threshold must be nonnegative."""
self._interval = 1. / rate
self._next_frame_time = time.monotonic() + self._interval
self._print_delay_threshold = print_delay_threshold
self._frame = 0
self._remaining = 0.0
self._process_name = getproctitle()
self._dts = deque([self._interval], maxlen=100)
self._last_monitor_time = time.monotonic()
self._last_monitor_time = -1.
self._next_frame_time = -1.
@property
def frame(self) -> int:
@@ -79,6 +79,10 @@ class Ratekeeper:
# Monitors the cumulative lag, but does not enforce a rate
def monitor_time(self) -> bool:
if self._last_monitor_time < 0:
self._next_frame_time = time.monotonic() + self._interval
self._last_monitor_time = time.monotonic()
prev = self._last_monitor_time
self._last_monitor_time = time.monotonic()
self._dts.append(self._last_monitor_time - prev)

View File

@@ -2,8 +2,9 @@
#include "common/watchdog.h"
#include "common/util.h"
#include "system/hardware/hw.h"
const std::string watchdog_fn_prefix = "/dev/shm/wd_"; // + <pid>
const std::string watchdog_fn_prefix = Path::shm_path() + "/wd_"; // + <pid>
bool watchdog_kick(uint64_t ts) {
static std::string fn = watchdog_fn_prefix + std::to_string(getpid());

View File

@@ -8,6 +8,19 @@ from openpilot.common.prefix import OpenpilotPrefix
from openpilot.system.manager import manager
from openpilot.system.hardware import TICI, HARDWARE
# TODO: pytest-cpp doesn't support FAIL, and we need to create test translations in sessionstart
# pending https://github.com/pytest-dev/pytest-cpp/pull/147
collect_ignore = [
"selfdrive/ui/tests/test_translations",
"selfdrive/test/process_replay/test_processes.py",
"selfdrive/test/process_replay/test_regen.py",
"selfdrive/test/test_time_to_onroad.py",
]
collect_ignore_glob = [
"selfdrive/debug/*.py",
"selfdrive/modeld/*.py",
]
def pytest_sessionstart(session):
# TODO: fix tests and enable test order randomization

View File

@@ -30,21 +30,21 @@ A supported vehicle is one that just works when you install a comma device. All
|comma|body|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|None||
|CUPRA|Ateca 2018-23|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[<sup>1,12</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 USB-C coupler<br>- 1 VW J533 connector<br>- 1 comma 3X<br>- 1 harness box<br>- 1 long OBD-C cable<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=CUPRA&model=Ateca 2018-23">Buy Here</a></sub></details>||
|Dodge|Durango 2020-21|Adaptive Cruise Control (ACC)|Stock|0 mph|39 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 FCA connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Dodge&model=Durango 2020-21">Buy Here</a></sub></details>||
|Ford|Bronco Sport 2021-23|Co-Pilot360 Assist+|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 RJ45 cable (7 ft)<br>- 1 angled mount (8 degrees)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Ford&model=Bronco Sport 2021-23">Buy Here</a></sub></details>||
|Ford|Escape 2020-22|Co-Pilot360 Assist+|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Ford&model=Escape 2020-22">Buy Here</a></sub></details>||
|Ford|Escape Hybrid 2020-22|Co-Pilot360 Assist+|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Ford&model=Escape Hybrid 2020-22">Buy Here</a></sub></details>||
|Ford|Escape Plug-in Hybrid 2020-22|Co-Pilot360 Assist+|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Ford&model=Escape Plug-in Hybrid 2020-22">Buy Here</a></sub></details>||
|Ford|Explorer 2020-23|Co-Pilot360 Assist+|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Ford&model=Explorer 2020-23">Buy Here</a></sub></details>||
|Ford|Explorer Hybrid 2020-23|Co-Pilot360 Assist+|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Ford&model=Explorer Hybrid 2020-23">Buy Here</a></sub></details>||
|Ford|Focus 2018[<sup>3</sup>](#footnotes)|Adaptive Cruise Control with Lane Centering|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Ford&model=Focus 2018">Buy Here</a></sub></details>||
|Ford|Focus Hybrid 2018[<sup>3</sup>](#footnotes)|Adaptive Cruise Control with Lane Centering|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Ford&model=Focus Hybrid 2018">Buy Here</a></sub></details>||
|Ford|Kuga 2020-22|Adaptive Cruise Control with Lane Centering|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Ford&model=Kuga 2020-22">Buy Here</a></sub></details>||
|Ford|Kuga Hybrid 2020-22|Adaptive Cruise Control with Lane Centering|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Ford&model=Kuga Hybrid 2020-22">Buy Here</a></sub></details>||
|Ford|Kuga Plug-in Hybrid 2020-22|Adaptive Cruise Control with Lane Centering|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Ford&model=Kuga Plug-in Hybrid 2020-22">Buy Here</a></sub></details>||
|Ford|Maverick 2022|LARIAT Luxury|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 RJ45 cable (7 ft)<br>- 1 angled mount (8 degrees)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Ford&model=Maverick 2022">Buy Here</a></sub></details>||
|Ford|Maverick 2023-24|Co-Pilot360 Assist|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 RJ45 cable (7 ft)<br>- 1 angled mount (8 degrees)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Ford&model=Maverick 2023-24">Buy Here</a></sub></details>||
|Ford|Maverick Hybrid 2022|LARIAT Luxury|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 RJ45 cable (7 ft)<br>- 1 angled mount (8 degrees)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Ford&model=Maverick Hybrid 2022">Buy Here</a></sub></details>||
|Ford|Maverick Hybrid 2023-24|Co-Pilot360 Assist|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 RJ45 cable (7 ft)<br>- 1 angled mount (8 degrees)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Ford&model=Maverick Hybrid 2023-24">Buy Here</a></sub></details>||
|Ford|Bronco Sport 2021-24|Co-Pilot360 Assist+|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 RJ45 cable (7 ft)<br>- 1 angled mount (8 degrees)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Ford&model=Bronco Sport 2021-24">Buy Here</a></sub></details>||
|Ford|Escape 2020-22|Co-Pilot360 Assist+|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Ford&model=Escape 2020-22">Buy Here</a></sub></details>||
|Ford|Escape Hybrid 2020-22|Co-Pilot360 Assist+|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Ford&model=Escape Hybrid 2020-22">Buy Here</a></sub></details>||
|Ford|Escape Plug-in Hybrid 2020-22|Co-Pilot360 Assist+|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Ford&model=Escape Plug-in Hybrid 2020-22">Buy Here</a></sub></details>||
|Ford|Explorer 2020-24|Co-Pilot360 Assist+|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Ford&model=Explorer 2020-24">Buy Here</a></sub></details>||
|Ford|Explorer Hybrid 2020-24|Co-Pilot360 Assist+|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Ford&model=Explorer Hybrid 2020-24">Buy Here</a></sub></details>||
|Ford|Focus 2018[<sup>3</sup>](#footnotes)|Adaptive Cruise Control with Lane Centering|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Ford&model=Focus 2018">Buy Here</a></sub></details>||
|Ford|Focus Hybrid 2018[<sup>3</sup>](#footnotes)|Adaptive Cruise Control with Lane Centering|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Ford&model=Focus Hybrid 2018">Buy Here</a></sub></details>||
|Ford|Kuga 2020-22|Adaptive Cruise Control with Lane Centering|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Ford&model=Kuga 2020-22">Buy Here</a></sub></details>||
|Ford|Kuga Hybrid 2020-22|Adaptive Cruise Control with Lane Centering|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Ford&model=Kuga Hybrid 2020-22">Buy Here</a></sub></details>||
|Ford|Kuga Plug-in Hybrid 2020-22|Adaptive Cruise Control with Lane Centering|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Ford&model=Kuga Plug-in Hybrid 2020-22">Buy Here</a></sub></details>||
|Ford|Maverick 2022|LARIAT Luxury|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 RJ45 cable (7 ft)<br>- 1 angled mount (8 degrees)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Ford&model=Maverick 2022">Buy Here</a></sub></details>||
|Ford|Maverick 2023-24|Co-Pilot360 Assist|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 RJ45 cable (7 ft)<br>- 1 angled mount (8 degrees)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Ford&model=Maverick 2023-24">Buy Here</a></sub></details>||
|Ford|Maverick Hybrid 2022|LARIAT Luxury|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 RJ45 cable (7 ft)<br>- 1 angled mount (8 degrees)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Ford&model=Maverick Hybrid 2022">Buy Here</a></sub></details>||
|Ford|Maverick Hybrid 2023-24|Co-Pilot360 Assist|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 RJ45 cable (7 ft)<br>- 1 angled mount (8 degrees)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Ford&model=Maverick Hybrid 2023-24">Buy Here</a></sub></details>||
|Genesis|G70 2018|All|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai F connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Genesis&model=G70 2018">Buy Here</a></sub></details>||
|Genesis|G70 2019-21|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai F connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Genesis&model=G70 2019-21">Buy Here</a></sub></details>||
|Genesis|G70 2022-23|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai L connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Genesis&model=G70 2022-23">Buy Here</a></sub></details>||
@@ -68,7 +68,7 @@ A supported vehicle is one that just works when you install a comma device. All
|Honda|Civic Hatchback 2022-24|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Honda Bosch B connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Honda&model=Civic Hatchback 2022-24">Buy Here</a></sub></details>|<a href="https://youtu.be/ytiOT5lcp6Q" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>|
|Honda|CR-V 2015-16|Touring Trim|openpilot|26 mph|12 mph|[![star](assets/icon-star-empty.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 Honda Nidec connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Honda&model=CR-V 2015-16">Buy Here</a></sub></details>||
|Honda|CR-V 2017-22|Honda Sensing|openpilot available[<sup>1</sup>](#footnotes)|0 mph|12 mph|[![star](assets/icon-star-empty.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Honda Bosch A connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Honda&model=CR-V 2017-22">Buy Here</a></sub></details>||
|Honda|CR-V Hybrid 2017-21|Honda Sensing|openpilot available[<sup>1</sup>](#footnotes)|0 mph|12 mph|[![star](assets/icon-star-empty.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Honda Bosch A connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Honda&model=CR-V Hybrid 2017-21">Buy Here</a></sub></details>||
|Honda|CR-V Hybrid 2017-22|Honda Sensing|openpilot available[<sup>1</sup>](#footnotes)|0 mph|12 mph|[![star](assets/icon-star-empty.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Honda Bosch A connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Honda&model=CR-V Hybrid 2017-22">Buy Here</a></sub></details>||
|Honda|e 2020|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|3 mph|[![star](assets/icon-star-empty.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Honda Bosch A connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Honda&model=e 2020">Buy Here</a></sub></details>||
|Honda|Fit 2018-20|Honda Sensing|openpilot|26 mph|12 mph|[![star](assets/icon-star-empty.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 Honda Nidec connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Honda&model=Fit 2018-20">Buy Here</a></sub></details>||
|Honda|Freed 2020|Honda Sensing|openpilot|26 mph|12 mph|[![star](assets/icon-star-empty.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 Honda Nidec connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Honda&model=Freed 2020">Buy Here</a></sub></details>||
@@ -167,7 +167,7 @@ A supported vehicle is one that just works when you install a comma device. All
|Lexus|ES 2017-18|All|openpilot available[<sup>2</sup>](#footnotes)|19 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 RJ45 cable (7 ft)<br>- 1 Toyota A connector<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Lexus&model=ES 2017-18">Buy Here</a></sub></details>||
|Lexus|ES 2019-24|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 RJ45 cable (7 ft)<br>- 1 Toyota A connector<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Lexus&model=ES 2019-24">Buy Here</a></sub></details>||
|Lexus|ES Hybrid 2017-18|All|openpilot available[<sup>2</sup>](#footnotes)|19 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 RJ45 cable (7 ft)<br>- 1 Toyota A connector<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Lexus&model=ES Hybrid 2017-18">Buy Here</a></sub></details>||
|Lexus|ES Hybrid 2019-24|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 RJ45 cable (7 ft)<br>- 1 Toyota A connector<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Lexus&model=ES Hybrid 2019-24">Buy Here</a></sub></details>|<a href="https://youtu.be/BZ29osRVJeg?t=12" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>|
|Lexus|ES Hybrid 2019-25|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 RJ45 cable (7 ft)<br>- 1 Toyota A connector<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Lexus&model=ES Hybrid 2019-25">Buy Here</a></sub></details>|<a href="https://youtu.be/BZ29osRVJeg?t=12" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>|
|Lexus|GS F 2016|All|Stock|19 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 RJ45 cable (7 ft)<br>- 1 Toyota A connector<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Lexus&model=GS F 2016">Buy Here</a></sub></details>||
|Lexus|IS 2017-19|All|Stock|19 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 RJ45 cable (7 ft)<br>- 1 Toyota A connector<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Lexus&model=IS 2017-19">Buy Here</a></sub></details>||
|Lexus|IS 2022-23|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 RJ45 cable (7 ft)<br>- 1 Toyota A connector<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Lexus&model=IS 2022-23">Buy Here</a></sub></details>||
@@ -184,11 +184,11 @@ A supported vehicle is one that just works when you install a comma device. All
|Lexus|RX Hybrid 2017-19|All|openpilot available[<sup>2</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 RJ45 cable (7 ft)<br>- 1 Toyota A connector<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Lexus&model=RX Hybrid 2017-19">Buy Here</a></sub></details>||
|Lexus|RX Hybrid 2020-22|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 RJ45 cable (7 ft)<br>- 1 Toyota A connector<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Lexus&model=RX Hybrid 2020-22">Buy Here</a></sub></details>||
|Lexus|UX Hybrid 2019-23|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 RJ45 cable (7 ft)<br>- 1 Toyota A connector<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Lexus&model=UX Hybrid 2019-23">Buy Here</a></sub></details>||
|Lincoln|Aviator 2020-23|Co-Pilot360 Plus|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Lincoln&model=Aviator 2020-23">Buy Here</a></sub></details>||
|Lincoln|Aviator Plug-in Hybrid 2020-23|Co-Pilot360 Plus|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Lincoln&model=Aviator Plug-in Hybrid 2020-23">Buy Here</a></sub></details>||
|Lincoln|Aviator 2020-24|Co-Pilot360 Plus|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Lincoln&model=Aviator 2020-24">Buy Here</a></sub></details>||
|Lincoln|Aviator Plug-in Hybrid 2020-24|Co-Pilot360 Plus|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Ford Q3 connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Lincoln&model=Aviator Plug-in Hybrid 2020-24">Buy Here</a></sub></details>||
|MAN|eTGE 2020-24|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[<sup>1,12</sup>](#footnotes)|0 mph|31 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 USB-C coupler<br>- 1 VW J533 connector<br>- 1 angled mount (8 degrees)<br>- 1 comma 3X<br>- 1 harness box<br>- 1 long OBD-C cable<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=MAN&model=eTGE 2020-24">Buy Here</a></sub></details>|<a href="https://youtu.be/4100gLeabmo" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>|
|MAN|TGE 2017-24|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[<sup>1,12</sup>](#footnotes)|0 mph|31 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 USB-C coupler<br>- 1 VW J533 connector<br>- 1 angled mount (8 degrees)<br>- 1 comma 3X<br>- 1 harness box<br>- 1 long OBD-C cable<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=MAN&model=TGE 2017-24">Buy Here</a></sub></details>|<a href="https://youtu.be/4100gLeabmo" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>|
|Mazda|CX-5 2022-24|All|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Mazda connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Mazda&model=CX-5 2022-24">Buy Here</a></sub></details>||
|Mazda|CX-5 2022-25|All|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Mazda connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Mazda&model=CX-5 2022-25">Buy Here</a></sub></details>||
|Mazda|CX-9 2021-23|All|Stock|0 mph|28 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Mazda connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Mazda&model=CX-9 2021-23">Buy Here</a></sub></details>|<a href="https://youtu.be/dA3duO4a0O4" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>|
|Nissan|Altima 2019-20|ProPILOT Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 Nissan B connector<br>- 1 RJ45 cable (7 ft)<br>- 1 USB-C coupler<br>- 1 comma 3X<br>- 1 harness box<br>- 1 long OBD-C cable<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Nissan&model=Altima 2019-20">Buy Here</a></sub></details>||
|Nissan|Leaf 2018-23|ProPILOT Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 Nissan A connector<br>- 1 RJ45 cable (7 ft)<br>- 1 USB-C coupler<br>- 1 comma 3X<br>- 1 harness box<br>- 1 long OBD-C cable<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Nissan&model=Leaf 2018-23">Buy Here</a></sub></details>|<a href="https://youtu.be/vaMbtAh_0cY" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>|

View File

@@ -1,8 +1,9 @@
# openpilot glossary
* **route**:
* **onroad**: openpilot's system state while ignition is on
* **offroad**: openpilot's system state while ignition is off
* **route**: a route is a recording of an onroad session
* **segment**: routes are split into one minute chunks called segments.
* **panda**: this is . See the repo.
* **onroad**:
* **offroad**:
* **comma 3X**:
* **comma connect**: the web viewer for all your routes; check it out at [connect.comma.ai](https://connect.comma.ai).
* **panda**: this is the secondary processor on the device that implements the functional safety and directly talks to the car over CAN. See the [panda repo](https://github.com/commaai/panda).
* **comma 3X**: the latest hardware by comma.ai for running openpilot. more info at [comma.ai/shop](https://comma.ai/shop).

View File

@@ -11,6 +11,9 @@ On the comma three, the serial console is exposed through a UART-to-USB chip, an
On the comma 3X, the serial console is accessible through the [panda](https://github.com/commaai/panda) using the `panda/tests/som_debug.sh` script.
* Username: `comma`
* Password: `comma`
## SSH
In order to SSH into your device, you'll need a GitHub account with SSH keys. See this [GitHub article](https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh) for getting your account setup with SSH keys.

View File

@@ -7,7 +7,7 @@ export OPENBLAS_NUM_THREADS=1
export VECLIB_MAXIMUM_THREADS=1
if [ -z "$AGNOS_VERSION" ]; then
export AGNOS_VERSION="10.1"
export AGNOS_VERSION="11.3"
fi
export STAGING_ROOT="/data/safe_staging"

View File

@@ -18,10 +18,12 @@ nav:
- How-to:
- Turn the speed blue: how-to/turn-the-speed-blue.md
- Connect to a comma 3/3X: how-to/connect-to-comma.md
# - Make your first pull request: how-to/make-first-pr.md
#- Replay a drive: how-to/replay-a-drive.md
- Concepts:
- Logs: concepts/logs.md
- Safety: concepts/safety.md
- Glossary: concepts/glossary.md
- Car Porting:
- What is a car port?: car-porting/what-is-a-car-port.md
- Porting a car brand: car-porting/brand-port.md

2
panda

Submodule panda updated: 08c95bf47b...c7cc2deaf0

View File

@@ -1,6 +1,6 @@
[project]
name = "openpilot"
requires-python = ">= 3.11"
requires-python = ">= 3.11, <= 3.12"
license = {text = "MIT License"}
version = "0.1.0"
description = "an open source driver assistance system"
@@ -31,6 +31,9 @@ dependencies = [
# body / webrtcd
"aiohttp",
"aiortc",
# aiortc does not put an upper bound on pyopenssl and is now incompatible
# with the latest release
"pyopenssl < 24.3.0",
"pyaudio",
# panda
@@ -98,7 +101,6 @@ dev = [
"azure-identity",
"azure-storage-blob",
"dictdiffer",
"flaky",
"lru-dict",
"matplotlib",
"parameterized >=0.8, <0.9",
@@ -148,14 +150,7 @@ markers = [
]
testpaths = [
"common",
"selfdrive/pandad",
"selfdrive/car",
"selfdrive/opcar",
"selfdrive/controls",
"selfdrive/locationd",
"selfdrive/monitoring",
"selfdrive/test/longitudinal_maneuvers",
"selfdrive/test/process_replay/test_fuzzy.py",
"selfdrive",
"system/updated",
"system/athena",
"system/camerad",
@@ -246,6 +241,7 @@ exclude = [
"cereal",
"panda",
"opendbc",
"opendbc_repo",
"rednose_repo",
"tinygrad_repo",
"teleoprtc",

View File

@@ -50,8 +50,13 @@ git commit -a -m "openpilot v$VERSION release"
export PYTHONPATH="$BUILD_DIR"
scons -j$(nproc) --minimal
# release panda fw
CERT=/data/pandaextra/certs/release RELEASE=1 scons -j$(nproc) panda/
if [ -z "$PANDA_DEBUG_BUILD" ]; then
# release panda fw
CERT=/data/pandaextra/certs/release RELEASE=1 scons -j$(nproc) panda/
else
# build with ALLOW_DEBUG=1 to enable features like experimental longitudinal
scons -j$(nproc) panda/
fi
# Ensure no submodules in release
if test "$(git submodule--helper list | wc -l)" -gt "0"; then

View File

@@ -1,7 +1,12 @@
#!/usr/bin/env bash
while read hash submodule ref; do
git -C $submodule fetch --depth 4000 origin master
if [ "$submodule" = "tinygrad_repo" ]; then
echo "Skipping $submodule"
continue
fi
git -C $submodule fetch --depth 100 origin master
git -C $submodule branch -r --contains $hash | grep "origin/master"
if [ "$?" -eq 0 ]; then
echo "$submodule ok"

View File

@@ -32,7 +32,6 @@ blacklist = [
".git/",
".github/",
".devcontainer/",
"Darwin/",
".vscode",

View File

@@ -37,7 +37,7 @@ for f in sorted(pyf):
lns = len(src.split("\n"))
tree = ast.parse(src)
Analyzer().visit(tree)
print("%5d %s %s" % (lns, f, xbit))
print(f"{lns:5d} {f} {xbit}")
if 'test' in f:
testlns += lns
elif f.startswith(('tools/', 'scripts/', 'selfdrive/debug')):
@@ -47,8 +47,8 @@ for f in sorted(pyf):
else:
tlns += lns
print("%d lines of openpilot python" % tlns)
print("%d lines of car ports" % carlns)
print("%d lines of tools/scripts/debug" % scriptlns)
print("%d lines of tests" % testlns)
print(f"{tlns} lines of openpilot python")
print(f"{carlns} lines of car ports")
print(f"{scriptlns} lines of tools/scripts/debug")
print(f"{testlns} lines of tests")
#print(sorted(list(imps)))

View File

@@ -0,0 +1,10 @@
#!/usr/bin/env bash
FAIL=0
if grep -n '\(#\|//\)\([[:space:]]*\)NOMERGE' $@; then
echo -e "NOMERGE comments found! Remove them before merging\n"
FAIL=1
fi
exit $FAIL

View File

@@ -0,0 +1,10 @@
#!/usr/bin/env bash
FAIL=0
if grep -n '#include "third_party/raylib/include/raylib\.h"' $@ | grep -v '^system/ui/raylib/raylib\.h'; then
echo -e "Bad raylib include found! Use '#include \"system/ui/raylib/raylib.h\"' instead\n"
FAIL=1
fi
exit $FAIL

View File

@@ -52,6 +52,8 @@ function run_tests() {
run "check_added_large_files" python3 -m pre_commit_hooks.check_added_large_files --enforce-all $ALL_FILES --maxkb=120
run "check_shebang_scripts_are_executable" python3 -m pre_commit_hooks.check_shebang_scripts_are_executable $ALL_FILES
run "check_shebang_format" $DIR/check_shebang_format.sh $ALL_FILES
run "check_nomerge_comments" $DIR/check_nomerge_comments.sh $ALL_FILES
run "check_raylib_includes" $DIR/check_raylib_includes.sh $ALL_FILES
if [[ -z "$FAST" ]]; then
run "mypy" mypy $PYTHON_FILES

View File

@@ -16,9 +16,9 @@ def waste(core):
j = 0
while 1:
if (i % 100) == 0:
setproctitle("%3d: %8d" % (core, i))
setproctitle(f"{core:3d}: {i:8d}")
lt = time.monotonic()
print("%3d: %8d %f %.2f" % (core, i, lt-st, j))
print(f"{core:3d}: {i:8d} {lt-st:f} {j:.2f}")
st = lt
i += 1
j = np.sum(np.matmul(m1, m2))

View File

@@ -1,15 +1,17 @@
from cereal import car
from collections import deque
from cereal import car, log
import cereal.messaging as messaging
from opendbc.car import DT_CTRL, structs
from opendbc.car.interfaces import MAX_CTRL_SPEED, CarStateBase, CarControllerBase
from opendbc.car.interfaces import MAX_CTRL_SPEED
from opendbc.car.volkswagen.values import CarControllerParams as VWCarControllerParams
from opendbc.car.hyundai.interface import ENABLE_BUTTONS as HYUNDAI_ENABLE_BUTTONS
from opendbc.car.hyundai.carstate import PREV_BUTTON_SAMPLES as HYUNDAI_PREV_BUTTON_SAMPLES
from openpilot.selfdrive.selfdrived.events import Events
ButtonType = structs.CarState.ButtonEvent.Type
GearShifter = structs.CarState.GearShifter
EventName = car.OnroadEvent.EventName
EventName = log.OnroadEvent.EventName
NetworkLocation = structs.CarParams.NetworkLocation
@@ -37,132 +39,121 @@ class CarSpecificEvents:
self.no_steer_warning = False
self.silent_steer_warning = True
def update(self, CS: CarStateBase, CS_prev: car.CarState, CC: CarControllerBase, CC_prev: car.CarControl):
self.cruise_buttons: deque = deque([], maxlen=HYUNDAI_PREV_BUTTON_SAMPLES)
def update(self, CS: car.CarState, CS_prev: car.CarState, CC: car.CarControl):
if self.CP.carName in ('body', 'mock'):
events = Events()
elif self.CP.carName == 'subaru':
events = self.create_common_events(CS.out, CS_prev)
elif self.CP.carName in ('subaru', 'mazda'):
events = self.create_common_events(CS, CS_prev)
elif self.CP.carName == 'ford':
events = self.create_common_events(CS.out, CS_prev, extra_gears=[GearShifter.manumatic])
events = self.create_common_events(CS, CS_prev, extra_gears=[GearShifter.manumatic])
elif self.CP.carName == 'nissan':
events = self.create_common_events(CS.out, CS_prev, extra_gears=[GearShifter.brake])
if CS.lkas_enabled: # type: ignore[attr-defined]
events.add(EventName.invalidLkasSetting)
elif self.CP.carName == 'mazda':
events = self.create_common_events(CS.out, CS_prev)
if CS.lkas_disabled: # type: ignore[attr-defined]
events.add(EventName.lkasDisabled)
elif CS.low_speed_alert: # type: ignore[attr-defined]
events.add(EventName.belowSteerSpeed)
events = self.create_common_events(CS, CS_prev, extra_gears=[GearShifter.brake])
elif self.CP.carName == 'chrysler':
events = self.create_common_events(CS.out, CS_prev, extra_gears=[GearShifter.low])
events = self.create_common_events(CS, CS_prev, extra_gears=[GearShifter.low])
# Low speed steer alert hysteresis logic
if self.CP.minSteerSpeed > 0. and CS.out.vEgo < (self.CP.minSteerSpeed + 0.5):
if self.CP.minSteerSpeed > 0. and CS.vEgo < (self.CP.minSteerSpeed + 0.5):
self.low_speed_alert = True
elif CS.out.vEgo > (self.CP.minSteerSpeed + 1.):
elif CS.vEgo > (self.CP.minSteerSpeed + 1.):
self.low_speed_alert = False
if self.low_speed_alert:
events.add(EventName.belowSteerSpeed)
elif self.CP.carName == 'honda':
events = self.create_common_events(CS.out, CS_prev, pcm_enable=False)
events = self.create_common_events(CS, CS_prev, pcm_enable=False)
if self.CP.pcmCruise and CS.out.vEgo < self.CP.minEnableSpeed:
if self.CP.pcmCruise and CS.vEgo < self.CP.minEnableSpeed:
events.add(EventName.belowEngageSpeed)
if self.CP.pcmCruise:
# we engage when pcm is active (rising edge)
if CS.out.cruiseState.enabled and not CS_prev.cruiseState.enabled:
if CS.cruiseState.enabled and not CS_prev.cruiseState.enabled:
events.add(EventName.pcmEnable)
elif not CS.out.cruiseState.enabled and (CC_prev.actuators.accel >= 0. or not self.CP.openpilotLongitudinalControl):
elif not CS.cruiseState.enabled and (CC.actuators.accel >= 0. or not self.CP.openpilotLongitudinalControl):
# it can happen that car cruise disables while comma system is enabled: need to
# keep braking if needed or if the speed is very low
if CS.out.vEgo < self.CP.minEnableSpeed + 2.:
if CS.vEgo < self.CP.minEnableSpeed + 2.:
# non loud alert if cruise disables below 25mph as expected (+ a little margin)
events.add(EventName.speedTooLow)
else:
events.add(EventName.cruiseDisabled)
if self.CP.minEnableSpeed > 0 and CS.out.vEgo < 0.001:
if self.CP.minEnableSpeed > 0 and CS.vEgo < 0.001:
events.add(EventName.manualRestart)
elif self.CP.carName == 'toyota':
events = self.create_common_events(CS.out, CS_prev)
events = self.create_common_events(CS, CS_prev)
if self.CP.openpilotLongitudinalControl:
if CS.out.cruiseState.standstill and not CS.out.brakePressed:
if CS.cruiseState.standstill and not CS.brakePressed:
events.add(EventName.resumeRequired)
if CS.low_speed_lockout: # type: ignore[attr-defined]
events.add(EventName.lowSpeedLockout)
if CS.out.vEgo < self.CP.minEnableSpeed:
if CS.vEgo < self.CP.minEnableSpeed:
events.add(EventName.belowEngageSpeed)
if CC_prev.actuators.accel > 0.3:
if CC.actuators.accel > 0.3:
# some margin on the actuator to not false trigger cancellation while stopping
events.add(EventName.speedTooLow)
if CS.out.vEgo < 0.001:
if CS.vEgo < 0.001:
# while in standstill, send a user alert
events.add(EventName.manualRestart)
elif self.CP.carName == 'gm':
# The ECM allows enabling on falling edge of set, but only rising edge of resume
events = self.create_common_events(CS.out, CS_prev, extra_gears=[GearShifter.sport, GearShifter.low,
GearShifter.eco, GearShifter.manumatic],
events = self.create_common_events(CS, CS_prev, extra_gears=[GearShifter.sport, GearShifter.low,
GearShifter.eco, GearShifter.manumatic],
pcm_enable=self.CP.pcmCruise, enable_buttons=(ButtonType.decelCruise,))
if not self.CP.pcmCruise:
if any(b.type == ButtonType.accelCruise and b.pressed for b in CS.out.buttonEvents):
if any(b.type == ButtonType.accelCruise and b.pressed for b in CS.buttonEvents):
events.add(EventName.buttonEnable)
# Enabling at a standstill with brake is allowed
# TODO: verify 17 Volt can enable for the first time at a stop and allow for all GMs
below_min_enable_speed = CS.out.vEgo < self.CP.minEnableSpeed or CS.moving_backward # type: ignore[attr-defined]
if below_min_enable_speed and not (CS.out.standstill and CS.out.brake >= 20 and
self.CP.networkLocation == NetworkLocation.fwdCamera):
if CS.vEgo < self.CP.minEnableSpeed and not (CS.standstill and CS.brake >= 20 and
self.CP.networkLocation == NetworkLocation.fwdCamera):
events.add(EventName.belowEngageSpeed)
if CS.out.cruiseState.standstill:
if CS.cruiseState.standstill:
events.add(EventName.resumeRequired)
if CS.out.vEgo < self.CP.minSteerSpeed:
if CS.vEgo < self.CP.minSteerSpeed:
events.add(EventName.belowSteerSpeed)
elif self.CP.carName == 'volkswagen':
events = self.create_common_events(CS.out, CS_prev, extra_gears=[GearShifter.eco, GearShifter.sport, GearShifter.manumatic],
events = self.create_common_events(CS, CS_prev, extra_gears=[GearShifter.eco, GearShifter.sport, GearShifter.manumatic],
pcm_enable=not self.CP.openpilotLongitudinalControl,
enable_buttons=(ButtonType.setCruise, ButtonType.resumeCruise))
# Low speed steer alert hysteresis logic
if (self.CP.minSteerSpeed - 1e-3) > VWCarControllerParams.DEFAULT_MIN_STEER_SPEED and CS.out.vEgo < (self.CP.minSteerSpeed + 1.):
if (self.CP.minSteerSpeed - 1e-3) > VWCarControllerParams.DEFAULT_MIN_STEER_SPEED and CS.vEgo < (self.CP.minSteerSpeed + 1.):
self.low_speed_alert = True
elif CS.out.vEgo > (self.CP.minSteerSpeed + 2.):
elif CS.vEgo > (self.CP.minSteerSpeed + 2.):
self.low_speed_alert = False
if self.low_speed_alert:
events.add(EventName.belowSteerSpeed)
if self.CP.openpilotLongitudinalControl:
if CS.out.vEgo < self.CP.minEnableSpeed + 0.5:
if CS.vEgo < self.CP.minEnableSpeed + 0.5:
events.add(EventName.belowEngageSpeed)
if CC_prev.enabled and CS.out.vEgo < self.CP.minEnableSpeed:
if CC.enabled and CS.vEgo < self.CP.minEnableSpeed:
events.add(EventName.speedTooLow)
if CC.eps_timer_soft_disable_alert: # type: ignore[attr-defined]
events.add(EventName.steerTimeLimit)
# TODO: this needs to be implemented generically in carState struct
# if CC.eps_timer_soft_disable_alert: # type: ignore[attr-defined]
# events.add(EventName.steerTimeLimit)
elif self.CP.carName == 'hyundai':
# On some newer model years, the CANCEL button acts as a pause/resume button based on the PCM state
# To avoid re-engaging when openpilot cancels, check user engagement intention via buttons
# Main button also can trigger an engagement on these cars
allow_enable = any(btn in HYUNDAI_ENABLE_BUTTONS for btn in CS.cruise_buttons) or any(CS.main_buttons) # type: ignore[attr-defined]
events = self.create_common_events(CS.out, CS_prev, pcm_enable=self.CP.pcmCruise, allow_enable=allow_enable)
self.cruise_buttons.append(any(ev.type in HYUNDAI_ENABLE_BUTTONS for ev in CS.buttonEvents))
events = self.create_common_events(CS, CS_prev, pcm_enable=self.CP.pcmCruise, allow_enable=any(self.cruise_buttons))
# low speed steer alert hysteresis logic (only for cars with steer cut off above 10 m/s)
if CS.out.vEgo < (self.CP.minSteerSpeed + 2.) and self.CP.minSteerSpeed > 10.:
if CS.vEgo < (self.CP.minSteerSpeed + 2.) and self.CP.minSteerSpeed > 10.:
self.low_speed_alert = True
if CS.out.vEgo > (self.CP.minSteerSpeed + 4.):
if CS.vEgo > (self.CP.minSteerSpeed + 4.):
self.low_speed_alert = False
if self.low_speed_alert:
events.add(EventName.belowSteerSpeed)
@@ -213,6 +204,10 @@ class CarSpecificEvents:
events.add(EventName.gasPressedOverride)
if CS.vehicleSensorsInvalid:
events.add(EventName.vehicleSensorsInvalid)
if CS.invalidLkasSetting:
events.add(EventName.invalidLkasSetting)
if CS.lowSpeedAlert:
events.add(EventName.belowSteerSpeed)
# Handle button presses
for b in CS.buttonEvents:

View File

@@ -5,7 +5,7 @@ import threading
import cereal.messaging as messaging
from cereal import car
from cereal import car, log
from panda import ALTERNATIVE_EXPERIENCE
@@ -20,13 +20,11 @@ from opendbc.car.car_helpers import get_car, get_radar_interface
from opendbc.car.interfaces import CarInterfaceBase, RadarInterfaceBase
from openpilot.selfdrive.pandad import can_capnp_to_list, can_list_to_can_capnp
from openpilot.selfdrive.car.cruise import VCruiseHelper
from openpilot.selfdrive.car.car_specific import CarSpecificEvents, MockCarState
from openpilot.selfdrive.car.helpers import convert_carControl, convert_to_capnp
from openpilot.selfdrive.selfdrived.events import Events, ET
from openpilot.selfdrive.car.car_specific import MockCarState
REPLAY = "REPLAY" in os.environ
EventName = car.OnroadEvent.EventName
EventName = log.OnroadEvent.EventName
# forward
carlog.addHandler(ForwardingHandler(cloudlog))
@@ -64,8 +62,7 @@ def can_comm_callbacks(logcan: messaging.SubSocket, sendcan: messaging.PubSocket
class Car:
CI: CarInterfaceBase
RI: RadarInterfaceBase
CP: structs.CarParams
CP_capnp: car.CarParams
CP: car.CarParams
def __init__(self, CI=None, RI=None) -> None:
self.can_sock = messaging.sub_sock('can', timeout=20)
@@ -75,7 +72,6 @@ class Car:
self.can_rcv_cum_timeout_counter = 0
self.CC_prev = car.CarControl.new_message()
self.CS_prev = car.CarState.new_message()
self.initialized_prev = False
self.last_actuators_output = structs.CarControl.Actuators()
@@ -99,7 +95,7 @@ class Car:
cached_params_raw = self.params.get("CarParamsCache")
if cached_params_raw is not None:
with car.CarParams.from_bytes(cached_params_raw) as _cached_params:
cached_params = structs.CarParams(carName=_cached_params.carName, carFw=_cached_params.carFw, carVin=_cached_params.carVin)
cached_params = _cached_params
self.CI = get_car(*self.can_callbacks, obd_callback(self.params), experimental_long_allowed, num_pandas, cached_params)
self.RI = get_radar_interface(self.CI.CP)
@@ -112,9 +108,9 @@ class Car:
self.RI = RI
# set alternative experiences from parameters
self.disengage_on_accelerator = self.params.get_bool("DisengageOnAccelerator")
disengage_on_accelerator = self.params.get_bool("DisengageOnAccelerator")
self.CP.alternativeExperience = 0
if not self.disengage_on_accelerator:
if not disengage_on_accelerator:
self.CP.alternativeExperience |= ALTERNATIVE_EXPERIENCE.DISABLE_DISENGAGE_ON_GAS
openpilot_enabled_toggle = self.params.get_bool("OpenpilotEnabledToggle")
@@ -127,22 +123,29 @@ class Car:
safety_config.safetyModel = structs.CarParams.SafetyModel.noOutput
self.CP.safetyConfigs = [safety_config]
if self.CP.secOcRequired and not self.params.get_bool("IsReleaseBranch"):
secoc_key = self.params.get("SecOCKey", encoding='utf8')
if secoc_key is not None:
saved_secoc_key = bytes.fromhex(secoc_key.strip())
if len(saved_secoc_key) == 16:
self.CP.secOcKeyAvailable = True
self.CI.CS.secoc_key = saved_secoc_key
if controller_available:
self.CI.CC.secoc_key = saved_secoc_key
else:
cloudlog.warning("Saved SecOC key is invalid")
# Write previous route's CarParams
prev_cp = self.params.get("CarParamsPersistent")
if prev_cp is not None:
self.params.put("CarParamsPrevRoute", prev_cp)
# Write CarParams for controls and radard
# convert to pycapnp representation for caching and logging
self.CP_capnp = convert_to_capnp(self.CP)
cp_bytes = self.CP_capnp.to_bytes()
cp_bytes = self.CP.to_bytes()
self.params.put("CarParams", cp_bytes)
self.params.put_nonblocking("CarParamsCache", cp_bytes)
self.params.put_nonblocking("CarParamsPersistent", cp_bytes)
self.events = Events()
self.car_events = CarSpecificEvents(self.CP)
self.mock_carstate = MockCarState()
self.v_cruise_helper = VCruiseHelper(self.CP)
@@ -152,19 +155,19 @@ class Car:
# card is driven by can recv, expected at 100Hz
self.rk = Ratekeeper(100, print_delay_threshold=None)
def state_update(self) -> tuple[car.CarState, structs.RadarData | None]:
def state_update(self) -> tuple[car.CarState, structs.RadarDataT | None]:
"""carState update loop, driven by can"""
can_strs = messaging.drain_sock_raw(self.can_sock, wait_for_one=True)
can_list = can_capnp_to_list(can_strs)
# Update carState from CAN
CS = convert_to_capnp(self.CI.update(can_list))
CS = self.CI.update(can_list)
if self.CP.carName == 'mock':
CS = self.mock_carstate.update(CS)
# Update radar tracks from CAN
RD: structs.RadarData | None = self.RI.update(can_list)
RD: structs.RadarDataT | None = self.RI.update(can_list)
self.sm.update(0)
@@ -184,44 +187,20 @@ class Car:
return CS, RD
def update_events(self, CS: car.CarState, RD: structs.RadarData | None):
self.events.clear()
CS.events = self.car_events.update(self.CI.CS, self.CS_prev, self.CI.CC, self.CC_prev).to_msg()
self.events.add_from_msg(CS.events)
if self.CP.notCar:
# wait for everything to init first
if self.sm.frame > int(5. / DT_CTRL) and self.initialized_prev:
# body always wants to enable
self.events.add(EventName.pcmEnable)
# Disable on rising edge of accelerator or brake. Also disable on brake when speed > 0
if (CS.gasPressed and not self.CS_prev.gasPressed and self.disengage_on_accelerator) or \
(CS.brakePressed and (not self.CS_prev.brakePressed or not CS.standstill)) or \
(CS.regenBraking and (not self.CS_prev.regenBraking or not CS.standstill)):
self.events.add(EventName.pedalPressed)
if RD is not None and len(RD.errors):
self.events.add(EventName.radarFault)
CS.events = self.events.to_msg()
def state_publish(self, CS: car.CarState, RD: structs.RadarData | None):
def state_publish(self, CS: car.CarState, RD: structs.RadarDataT | None):
"""carState and carParams publish loop"""
# carParams - logged every 50 seconds (> 1 per segment)
if self.sm.frame % int(50. / DT_CTRL) == 0:
cp_send = messaging.new_message('carParams')
cp_send.valid = True
cp_send.carParams = self.CP_capnp
cp_send.carParams = self.CP
self.pm.send('carParams', cp_send)
# publish new carOutput
co_send = messaging.new_message('carOutput')
co_send.valid = self.sm.all_checks(['carControl'])
co_send.carOutput.actuatorsOutput = convert_to_capnp(self.last_actuators_output)
co_send.carOutput.actuatorsOutput = self.last_actuators_output
self.pm.send('carOutput', co_send)
# kick off controlsd step while we actuate the latest carControl packet
@@ -235,7 +214,7 @@ class Car:
if RD is not None:
tracks_msg = messaging.new_message('liveTracks')
tracks_msg.valid = len(RD.errors) == 0
tracks_msg.liveTracks = convert_to_capnp(RD)
tracks_msg.liveTracks = RD
self.pm.send('liveTracks', tracks_msg)
def controls_update(self, CS: car.CarState, CC: car.CarControl):
@@ -251,7 +230,7 @@ class Car:
if self.sm.all_alive(['carControl']):
# send car controls over can
now_nanos = self.can_log_mono_time if REPLAY else int(time.monotonic() * 1e9)
self.last_actuators_output, can_sends = self.CI.apply(convert_carControl(CC), now_nanos)
self.last_actuators_output, can_sends = self.CI.apply(CC, now_nanos)
self.pm.send('sendcan', can_list_to_can_capnp(can_sends, msgtype='sendcan', valid=CS.canValid))
self.CC_prev = CC
@@ -259,9 +238,7 @@ class Car:
def step(self):
CS, RD = self.state_update()
self.update_events(CS, RD)
if not self.sm['carControl'].enabled and self.events.contains(ET.ENABLE):
if self.sm['carControl'].enabled and not self.CC_prev.enabled:
self.v_cruise_helper.initialize_v_cruise(CS, self.experimental_mode)
self.state_publish(CS, RD)
@@ -272,7 +249,6 @@ class Car:
self.controls_update(CS, self.sm['carControl'])
self.initialized_prev = initialized
self.CS_prev = CS.as_reader()
def params_thread(self, evt):
while not evt.is_set():

View File

@@ -1,74 +0,0 @@
import capnp
from typing import Any
from cereal import car
from opendbc.car import structs
_FIELDS = '__dataclass_fields__' # copy of dataclasses._FIELDS
def is_dataclass(obj):
"""Similar to dataclasses.is_dataclass without instance type check checking"""
return hasattr(obj, _FIELDS)
def _asdictref_inner(obj) -> dict[str, Any] | Any:
if is_dataclass(obj):
ret = {}
for field in getattr(obj, _FIELDS): # similar to dataclasses.fields()
ret[field] = _asdictref_inner(getattr(obj, field))
return ret
elif isinstance(obj, (tuple, list)):
return type(obj)(_asdictref_inner(v) for v in obj)
else:
return obj
def asdictref(obj) -> dict[str, Any]:
"""
Similar to dataclasses.asdict without recursive type checking and copy.deepcopy
Note that the resulting dict will contain references to the original struct as a result
"""
if not is_dataclass(obj):
raise TypeError("asdictref() should be called on dataclass instances")
return _asdictref_inner(obj)
def convert_to_capnp(struct: structs.CarParams | structs.CarState | structs.CarControl.Actuators | structs.RadarData) -> capnp.lib.capnp._DynamicStructBuilder:
struct_dict = asdictref(struct)
if isinstance(struct, structs.CarParams):
del struct_dict['lateralTuning']
struct_capnp = car.CarParams.new_message(**struct_dict)
# this is the only union, special handling
which = struct.lateralTuning.which()
struct_capnp.lateralTuning.init(which)
lateralTuning_dict = asdictref(getattr(struct.lateralTuning, which))
setattr(struct_capnp.lateralTuning, which, lateralTuning_dict)
elif isinstance(struct, structs.CarState):
struct_capnp = car.CarState.new_message(**struct_dict)
elif isinstance(struct, structs.CarControl.Actuators):
struct_capnp = car.CarControl.Actuators.new_message(**struct_dict)
elif isinstance(struct, structs.RadarData):
struct_capnp = car.RadarData.new_message(**struct_dict)
else:
raise ValueError(f"Unsupported struct type: {type(struct)}")
return struct_capnp
def convert_carControl(struct: capnp.lib.capnp._DynamicStructReader) -> structs.CarControl:
# TODO: recursively handle any car struct as needed
def remove_deprecated(s: dict) -> dict:
return {k: v for k, v in s.items() if not k.endswith('DEPRECATED')}
struct_dict = struct.to_dict()
struct_dataclass = structs.CarControl(**remove_deprecated({k: v for k, v in struct_dict.items() if not isinstance(k, dict)}))
struct_dataclass.actuators = structs.CarControl.Actuators(**remove_deprecated(struct_dict.get('actuators', {})))
struct_dataclass.cruiseControl = structs.CarControl.CruiseControl(**remove_deprecated(struct_dict.get('cruiseControl', {})))
struct_dataclass.hudControl = structs.CarControl.HUDControl(**remove_deprecated(struct_dict.get('hudControl', {})))
return struct_dataclass

View File

@@ -12,7 +12,6 @@ from opendbc.car.tests.test_car_interfaces import get_fuzzy_car_interface_args
from opendbc.car.fingerprints import all_known_cars
from opendbc.car.fw_versions import FW_VERSIONS, FW_QUERY_CONFIGS
from opendbc.car.mock.values import CAR as MOCK
from openpilot.selfdrive.car.card import convert_carControl, convert_to_capnp
from openpilot.selfdrive.controls.lib.latcontrol_angle import LatControlAngle
from openpilot.selfdrive.controls.lib.latcontrol_pid import LatControlPID
from openpilot.selfdrive.controls.lib.latcontrol_torque import LatControlTorque
@@ -41,6 +40,7 @@ class TestCarInterfaces:
car_params = CarInterface.get_params(car_name, args['fingerprints'], args['car_fw'],
experimental_long=args['experimental_long'], docs=False)
car_params = car_params.as_reader()
car_interface = CarInterface(car_params, CarController, CarState)
assert car_params
assert car_interface
@@ -72,7 +72,7 @@ class TestCarInterfaces:
# Run car interface
now_nanos = 0
CC = car.CarControl.new_message(**cc_msg)
CC = convert_carControl(CC.as_reader())
CC = CC.as_reader()
for _ in range(10):
car_interface.update([])
car_interface.apply(CC, now_nanos)
@@ -80,7 +80,7 @@ class TestCarInterfaces:
CC = car.CarControl.new_message(**cc_msg)
CC.enabled = True
CC = convert_carControl(CC.as_reader())
CC = CC.as_reader()
for _ in range(10):
car_interface.update([])
car_interface.apply(CC, now_nanos)
@@ -89,11 +89,10 @@ class TestCarInterfaces:
# Test controller initialization
# TODO: wait until card refactor is merged to run controller a few times,
# hypothesis also slows down significantly with just one more message draw
car_params_capnp = convert_to_capnp(car_params).as_reader()
LongControl(car_params_capnp)
LongControl(car_params)
if car_params.steerControlType == CarParams.SteerControlType.angle:
LatControlAngle(car_params_capnp, car_interface)
LatControlAngle(car_params, car_interface)
elif car_params.lateralTuning.which() == 'pid':
LatControlPID(car_params_capnp, car_interface)
LatControlPID(car_params, car_interface)
elif car_params.lateralTuning.which() == 'torque':
LatControlTorque(car_params_capnp, car_interface)
LatControlTorque(car_params, car_interface)

View File

@@ -17,7 +17,7 @@ class TestCarDocs:
with open(CARS_MD_OUT) as f:
current_cars_md = f.read()
assert generated_cars_md == current_cars_md, "Run selfdrive/opcar/docs.py to update the compatibility documentation"
assert generated_cars_md == current_cars_md, "Run selfdrive/car/docs.py to update the compatibility documentation"
def test_docs_diff(self):
dump_path = os.path.join(BASEDIR, "selfdrive", "car", "tests", "cars_dump")

View File

@@ -1,6 +1,4 @@
import capnp
import copy
import dataclasses
import os
import pytest
import random
@@ -20,16 +18,18 @@ from opendbc.car.car_helpers import FRAME_FINGERPRINT, interfaces
from opendbc.car.honda.values import CAR as HONDA, HondaFlags
from opendbc.car.values import Platform
from opendbc.car.tests.routes import non_tested_cars, routes, CarTestRoute
from openpilot.selfdrive.car.card import Car, convert_to_capnp
from openpilot.selfdrive.selfdrived.events import ET
from openpilot.selfdrive.selfdrived.selfdrived import SelfdriveD
from openpilot.selfdrive.pandad import can_capnp_to_list
from openpilot.selfdrive.test.helpers import read_segment_list
from openpilot.system.hardware.hw import DEFAULT_DOWNLOAD_CACHE_ROOT
from openpilot.tools.lib.logreader import LogReader, auto_source, internal_source, openpilotci_source, openpilotci_source_zst
from openpilot.tools.lib.logreader import LogReader, LogsUnavailable, openpilotci_source_zst, openpilotci_source, internal_source, \
internal_source_zst, comma_api_source, auto_source
from openpilot.tools.lib.route import SegmentName
from panda.tests.libpanda import libpanda_py
EventName = car.OnroadEvent.EventName
EventName = log.OnroadEvent.EventName
PandaType = log.PandaState.PandaType
SafetyModel = car.CarParams.SafetyModel
@@ -69,7 +69,6 @@ def get_test_cases() -> list[tuple[str, CarTestRoute | None]]:
class TestCarModelBase(unittest.TestCase):
platform: Platform | None = None
test_route: CarTestRoute | None = None
test_route_on_bucket: bool = True # whether the route is on the preserved CI bucket
can_msgs: list[capnp.lib.capnp._DynamicStructReader]
fingerprint: dict[int, dict[int, int]]
@@ -96,7 +95,7 @@ class TestCarModelBase(unittest.TestCase):
car_fw = msg.carParams.carFw
if msg.carParams.openpilotLongitudinalControl:
experimental_long = True
if cls.platform is None and not cls.test_route_on_bucket:
if cls.platform is None:
live_fingerprint = msg.carParams.carFingerprint
cls.platform = MIGRATION.get(live_fingerprint, live_fingerprint)
@@ -116,10 +115,8 @@ class TestCarModelBase(unittest.TestCase):
(SafetyModel.elm327, SafetyModel.noOutput):
cls.car_safety_mode_frame = len(can_msgs)
if len(can_msgs) > int(50 / DT_CTRL):
return car_fw, can_msgs, experimental_long
raise Exception("no can data found")
assert len(can_msgs) > int(50 / DT_CTRL), "no can data found"
return car_fw, can_msgs, experimental_long
@classmethod
def get_testing_data(cls):
@@ -127,31 +124,17 @@ class TestCarModelBase(unittest.TestCase):
if cls.test_route.segment is not None:
test_segs = (cls.test_route.segment,)
is_internal = len(INTERNAL_SEG_LIST)
for seg in test_segs:
segment_range = f"{cls.test_route.route}/{seg}"
try:
source = partial(auto_source, sources=[internal_source] if is_internal else [openpilotci_source, openpilotci_source_zst])
source = partial(auto_source, sources=[internal_source, internal_source_zst] if len(INTERNAL_SEG_LIST) else \
[openpilotci_source_zst, openpilotci_source, comma_api_source])
lr = LogReader(segment_range, source=source)
return cls.get_testing_data_from_logreader(lr)
except Exception:
except (LogsUnavailable, AssertionError):
pass
# Route is not in CI bucket, assume either user has access (private), or it is public
# test_route_on_ci_bucket will fail when running in CI
if not is_internal:
cls.test_route_on_bucket = False
for seg in test_segs:
segment_range = f"{cls.test_route.route}/{seg}"
try:
lr = LogReader(segment_range)
return cls.get_testing_data_from_logreader(lr)
except Exception:
pass
raise Exception(f"Route: {repr(cls.test_route.route)} with segments: {test_segs} not found or no CAN msgs found. Is it uploaded and public?")
@@ -185,7 +168,7 @@ class TestCarModelBase(unittest.TestCase):
del cls.can_msgs
def setUp(self):
self.CI = self.CarInterface(copy.deepcopy(self.CP), self.CarController, self.CarState)
self.CI = self.CarInterface(self.CP.copy(), self.CarController, self.CarState)
assert self.CI
Params().put_bool("OpenpilotEnabledToggle", self.openpilot_enabled)
@@ -193,7 +176,7 @@ class TestCarModelBase(unittest.TestCase):
# TODO: check safetyModel is in release panda build
self.safety = libpanda_py.libpanda
cfg = car.CarParams.SafetyConfig(**dataclasses.asdict(self.CP.safetyConfigs[-1]))
cfg = self.CP.safetyConfigs[-1]
set_status = self.safety.set_safety_hooks(cfg.safetyModel.raw, cfg.safetyParam)
self.assertEqual(0, set_status, f"failed to set safetyModel {cfg}")
self.safety.init_tests()
@@ -218,7 +201,7 @@ class TestCarModelBase(unittest.TestCase):
# TODO: also check for checksum violations from can parser
can_invalid_cnt = 0
can_valid = False
CC = structs.CarControl()
CC = structs.CarControl().as_reader()
for i, msg in enumerate(self.can_msgs):
CS = self.CI.update(can_capnp_to_list((msg.as_builder().to_bytes(),)))
@@ -310,17 +293,17 @@ class TestCarModelBase(unittest.TestCase):
# Make sure we can send all messages while inactive
CC = structs.CarControl()
test_car_controller(CC)
test_car_controller(CC.as_reader())
# Test cancel + general messages (controls_allowed=False & cruise_engaged=True)
self.safety.set_cruise_engaged_prev(True)
CC = structs.CarControl(cruiseControl=structs.CarControl.CruiseControl(cancel=True))
test_car_controller(CC)
test_car_controller(CC.as_reader())
# Test resume + general messages (controls_allowed=True & cruise_engaged=True)
self.safety.set_controls_allowed(True)
CC = structs.CarControl(cruiseControl=structs.CarControl.CruiseControl(resume=True))
test_car_controller(CC)
test_car_controller(CC.as_reader())
# Skip stdout/stderr capture with pytest, causes elevated memory usage
@pytest.mark.nocapture
@@ -404,13 +387,14 @@ class TestCarModelBase(unittest.TestCase):
controls_allowed_prev = False
CS_prev = car.CarState.new_message()
checks = defaultdict(int)
card = Car(CI=self.CI)
selfdrived = SelfdriveD(CP=self.CP)
selfdrived.initialized = True
for idx, can in enumerate(self.can_msgs):
CS = convert_to_capnp(self.CI.update(can_capnp_to_list((can.as_builder().to_bytes(), ))))
CS = self.CI.update(can_capnp_to_list((can.as_builder().to_bytes(), ))).as_reader()
for msg in filter(lambda m: m.src in range(64), can.can):
to_send = libpanda_py.make_CANPacket(msg.address, msg.src % 4, msg.dat)
ret = self.safety.safety_rx_hook(to_send)
self.assertEqual(1, ret, f"safety rx failed ({ret=}): {to_send}")
self.assertEqual(1, ret, f"safety rx failed ({ret=}): {(msg.address, msg.src % 4)}")
# Skip first frame so CS_prev is properly initialized
if idx == 0:
@@ -449,10 +433,10 @@ class TestCarModelBase(unittest.TestCase):
checks['cruiseState'] += CS.cruiseState.enabled != self.safety.get_cruise_engaged_prev()
else:
# Check for enable events on rising edge of controls allowed
card.update_events(CS, None)
card.CS_prev = CS
button_enable = (any(evt.enable for evt in CS.events) and
not any(evt == EventName.pedalPressed for evt in card.events.names))
selfdrived.update_events(CS)
selfdrived.CS_prev = CS
button_enable = (selfdrived.events.contains(ET.ENABLE) and
EventName.pedalPressed not in selfdrived.events.names)
mismatch = button_enable != (self.safety.get_controls_allowed() and not controls_allowed_prev)
checks['controlsAllowed'] += mismatch
controls_allowed_prev = self.safety.get_controls_allowed()
@@ -467,11 +451,6 @@ class TestCarModelBase(unittest.TestCase):
failed_checks = {k: v for k, v in checks.items() if v > 0}
self.assertFalse(len(failed_checks), f"panda safety doesn't agree with openpilot: {failed_checks}")
@unittest.skipIf(not CI, "Accessing non CI-bucket routes is allowed only when not in CI")
def test_route_on_ci_bucket(self):
self.assertTrue(self.test_route_on_bucket, "Route not on CI bucket. " +
"This is fine to fail for WIP car ports, just let us know and we can upload your routes to the CI bucket.")
@parameterized_class(('platform', 'test_route'), get_test_cases())
@pytest.mark.xdist_group_class_property('test_route')

View File

@@ -87,7 +87,7 @@ class Controls:
CC.enabled = self.sm['selfdriveState'].enabled
# Check which actuators can be enabled
standstill = CS.vEgo <= max(self.CP.minSteerSpeed, MIN_LATERAL_CONTROL_SPEED) or CS.standstill
standstill = abs(CS.vEgo) <= max(self.CP.minSteerSpeed, MIN_LATERAL_CONTROL_SPEED) or CS.standstill
CC.latActive = self.sm['selfdriveState'].active and not CS.steerFaultTemporary and not CS.steerFaultPermanent and not standstill
CC.longActive = CC.enabled and not any(e.overrideLongitudinal for e in self.sm['onroadEvents']) and self.CP.openpilotLongitudinalControl
@@ -209,7 +209,7 @@ class Controls:
self.update()
CC, lac_log = self.state_control()
self.publish(CC, lac_log)
rk.keep_time()
rk.monitor_time()
def main():
config_realtime_process(4, Priority.CTRL_HIGH)

View File

@@ -347,7 +347,8 @@ class LongitudinalMpc:
lead_1_obstacle = lead_xv_1[:,0] + get_stopped_equivalence_factor(lead_xv_1[:,1])
self.params[:,0] = ACCEL_MIN
self.params[:,1] = self.max_a
# negative accel constraint causes problems because negative speed is not allowed
self.params[:,1] = max(0.0, self.max_a)
# Update in ACC mode or ACC/e2e blend
if self.mode == 'acc':
@@ -356,6 +357,7 @@ class LongitudinalMpc:
# Fake an obstacle for cruise, this ensures smooth acceleration to set speed
# when the leads are no factor.
v_lower = v_ego + (T_IDXS * self.cruise_min_a * 1.05)
# TODO does this make sense when max_a is negative?
v_upper = v_ego + (T_IDXS * self.max_a * 1.05)
v_cruise_clipped = np.clip(v_cruise * np.ones(N+1),
v_lower,

View File

@@ -22,7 +22,7 @@ A_CRUISE_MAX_VALS = [1.6, 1.2, 0.8, 0.6]
A_CRUISE_MAX_BP = [0., 10.0, 25., 40.]
CONTROL_N_T_IDX = ModelConstants.T_IDXS[:CONTROL_N]
ALLOW_THROTTLE_THRESHOLD = 0.5
ACCEL_LIMIT_MARGIN = 0.05
MIN_ALLOW_THROTTLE_SPEED = 2.5
# Lookup table for turns
_A_TOTAL_MAX_V = [1.7, 3.2]
@@ -56,7 +56,10 @@ def get_accel_from_plan(CP, speeds, accels):
a_target_now = interp(DT_MDL, CONTROL_N_T_IDX, accels)
v_target = interp(CP.longitudinalActuatorDelay + DT_MDL, CONTROL_N_T_IDX, speeds)
a_target = 2 * (v_target - v_target_now) / CP.longitudinalActuatorDelay - a_target_now
if v_target != v_target_now:
a_target = 2 * (v_target - v_target_now) / CP.longitudinalActuatorDelay - a_target_now
else:
a_target = a_target_now
v_target_1sec = interp(CP.longitudinalActuatorDelay + DT_MDL + 1.0, CONTROL_N_T_IDX, speeds)
else:
@@ -131,7 +134,8 @@ class LongitudinalPlanner:
if self.mpc.mode == 'acc':
accel_limits = [A_CRUISE_MIN, get_max_accel(v_ego)]
accel_limits_turns = limit_accel_in_turns(v_ego, sm['carState'].steeringAngleDeg, accel_limits, self.CP)
steer_angle_without_offset = sm['carState'].steeringAngleDeg - sm['liveParameters'].angleOffsetDeg
accel_limits_turns = limit_accel_in_turns(v_ego, steer_angle_without_offset, accel_limits, self.CP)
else:
accel_limits = [ACCEL_MIN, ACCEL_MAX]
accel_limits_turns = [ACCEL_MIN, ACCEL_MAX]
@@ -146,12 +150,13 @@ class LongitudinalPlanner:
# Compute model v_ego error
self.v_model_error = get_speed_error(sm['modelV2'], v_ego)
x, v, a, j, throttle_prob = self.parse_model(sm['modelV2'], self.v_model_error)
self.allow_throttle = throttle_prob > ALLOW_THROTTLE_THRESHOLD
# Don't clip at low speeds since throttle_prob doesn't account for creep
self.allow_throttle = throttle_prob > ALLOW_THROTTLE_THRESHOLD or v_ego <= MIN_ALLOW_THROTTLE_SPEED
if not self.allow_throttle and v_ego > 5.0: # Don't clip at low speeds since throttle_prob doesn't account for creep
# MPC breaks when accel limits would cause negative velocity within the MPC horizon, so we clip the max accel limit at vEgo/T_MAX plus a bit of margin
clipped_accel_coast = max(accel_coast, accel_limits_turns[0], -v_ego / T_IDXS_MPC[-1] + ACCEL_LIMIT_MARGIN)
accel_limits_turns[1] = min(accel_limits_turns[1], clipped_accel_coast)
if not self.allow_throttle:
clipped_accel_coast = max(accel_coast, accel_limits_turns[0])
clipped_accel_coast_interp = interp(v_ego, [MIN_ALLOW_THROTTLE_SPEED, MIN_ALLOW_THROTTLE_SPEED*2], [accel_limits_turns[1], clipped_accel_coast])
accel_limits_turns[1] = min(accel_limits_turns[1], clipped_accel_coast_interp)
if force_slow_decel:
v_cruise = 0.0

View File

@@ -5,7 +5,6 @@ from opendbc.car.car_helpers import interfaces
from opendbc.car.honda.values import CAR as HONDA
from opendbc.car.toyota.values import CAR as TOYOTA
from opendbc.car.nissan.values import CAR as NISSAN
from openpilot.selfdrive.car.card import convert_to_capnp
from openpilot.selfdrive.controls.lib.latcontrol_pid import LatControlPID
from openpilot.selfdrive.controls.lib.latcontrol_torque import LatControlTorque
from openpilot.selfdrive.controls.lib.latcontrol_angle import LatControlAngle
@@ -21,7 +20,6 @@ class TestLatControl:
CarInterface, CarController, CarState, RadarInterface = interfaces[car_name]
CP = CarInterface.get_non_essential_params(car_name)
CI = CarInterface(CP, CarController, CarState)
CP = convert_to_capnp(CP)
VM = VehicleModel(CP)
controller = controller(CP.as_reader(), CI)

View File

@@ -5,14 +5,13 @@ import numpy as np
from opendbc.car.honda.interface import CarInterface
from opendbc.car.honda.values import CAR
from openpilot.selfdrive.car.card import convert_to_capnp
from openpilot.selfdrive.controls.lib.vehicle_model import VehicleModel, dyn_ss_sol, create_dyn_state_matrices
class TestVehicleModel:
def setup_method(self):
CP = CarInterface.get_non_essential_params(CAR.HONDA_CIVIC)
self.VM = VehicleModel(convert_to_capnp(CP))
self.VM = VehicleModel(CP)
def test_round_trip_yaw_rate(self):
# TODO: fix VM to work at zero speed

View File

@@ -19,7 +19,7 @@ def main():
ldw = LaneDepartureWarning()
longitudinal_planner = LongitudinalPlanner(CP)
pm = messaging.PubMaster(['longitudinalPlan', 'driverAssistance'])
sm = messaging.SubMaster(['carControl', 'carState', 'controlsState', 'radarState', 'modelV2', 'selfdriveState'],
sm = messaging.SubMaster(['carControl', 'carState', 'controlsState', 'liveParameters', 'radarState', 'modelV2', 'selfdriveState'],
poll='modelV2', ignore_avg_freq=['radarState'])
while True:
@@ -30,7 +30,7 @@ def main():
ldw.update(sm.frame, sm['modelV2'], sm['carState'], sm['carControl'])
msg = messaging.new_message('driverAssistance')
msg.valid = sm.all_checks(['carState', 'carControl', 'modelV2'])
msg.valid = sm.all_checks(['carState', 'carControl', 'modelV2', 'liveParameters'])
msg.driverAssistance.leftLaneDeparture = ldw.left
msg.driverAssistance.rightLaneDeparture = ldw.right
pm.send('driverAssistance', msg)

View File

@@ -80,10 +80,6 @@ class Track:
self.cnt += 1
def get_key_for_cluster(self):
# Weigh y higher since radar is inaccurate in this dimension
return [self.dRel, self.yRel*2, self.vRel]
def reset_a_lead(self, aLeadK: float, aLeadTau: float):
self.kf = KF1D([[self.vLead], [aLeadK]], self.K_A, self.K_C, self.K_K)
self.aLeadK = aLeadK

View File

@@ -28,7 +28,7 @@ def can_printer(bus, max_msg, addr, ascii_decode):
x = binascii.hexlify(msgs[_addr][-1]).decode('ascii')
freq = len(msgs[_addr]) / (time.monotonic() - start)
if max_msg is None or _addr < max_msg:
dd += "%04X(%4d)(%6d)(%3dHz) %s %s\n" % (_addr, _addr, len(msgs[_addr]), freq, x.ljust(20), a)
dd += f"{_addr:04X}({_addr:4d})({len(msgs[_addr]):6d})({freq:3}dHz) {x.ljust(20)} {a}\n"
print(dd)
lp = time.monotonic()

View File

@@ -14,7 +14,6 @@ N_RUNS = 10
class CarModelTestCase(TestCarModelBase):
test_route = CarTestRoute(DEMO_ROUTE, None)
ci = False
if __name__ == '__main__':
@@ -30,7 +29,7 @@ if __name__ == '__main__':
start_t = time.process_time_ns()
for msg in msgs:
can_list = can_capnp_to_list([msg])
for cp in tm.CI.can_parsers:
for cp in tm.CI.can_parsers.values():
if cp is not None:
cp.update_strings(can_list)
ets.append((time.process_time_ns() - start_t) * 1e-6)

View File

@@ -8,6 +8,7 @@ from typing import cast
from cereal.services import SERVICE_LIST
from openpilot.tools.lib.logreader import LogReader, ReadMode
from openpilot.selfdrive.test.process_replay.migration import migrate_all
if __name__ == "__main__":
cnt_events: Counter = Counter()
@@ -20,7 +21,7 @@ if __name__ == "__main__":
start_time = math.inf
end_time = -math.inf
ignition_off = None
for msg in LogReader(sys.argv[1], ReadMode.QLOG):
for msg in migrate_all(LogReader(sys.argv[1], ReadMode.QLOG)):
t = (msg.logMonoTime - start_time) / 1e9
end_time = max(end_time, msg.logMonoTime)
start_time = min(start_time, msg.logMonoTime)

View File

@@ -10,7 +10,7 @@ from openpilot.selfdrive.selfdrived.events import ET, Events
from openpilot.selfdrive.selfdrived.alertmanager import AlertManager
from openpilot.system.manager.process_config import managed_processes
EventName = car.OnroadEvent.EventName
EventName = log.OnroadEvent.EventName
def randperc() -> float:
return 100. * random.random()

View File

@@ -8,10 +8,12 @@ def get_fingerprint(lr):
# TODO: make this a nice tool for car ports. should also work with qlogs for FW
fw = None
vin = None
msgs = {}
for msg in lr:
if msg.which() == 'carParams':
fw = msg.carParams.carFw
vin = msg.carParams.carVin
elif msg.which() == 'can':
for c in msg.can:
# read also msgs sent by EON on CAN bus 0x80 and filter out the
@@ -20,7 +22,7 @@ def get_fingerprint(lr):
msgs[c.address] = len(c.dat)
# show CAN fingerprint
fingerprint = ', '.join("%d: %d" % v for v in sorted(msgs.items()))
fingerprint = ', '.join(f"{v[0]}: {v[1]}" for v in sorted(msgs.items()))
print(f"\nfound {len(msgs)} messages. CAN fingerprint:\n")
print(fingerprint)
@@ -32,6 +34,7 @@ def get_fingerprint(lr):
print(f" {f.fwVersion},")
print(" ],")
print()
print(f"VIN: {vin}")
if __name__ == "__main__":

View File

@@ -2,12 +2,16 @@
import jinja2
import os
from cereal import car
from openpilot.common.basedir import BASEDIR
from opendbc.car.interfaces import get_interface_attr
Ecu = car.CarParams.Ecu
CARS = get_interface_attr('CAR')
FW_VERSIONS = get_interface_attr('FW_VERSIONS')
FINGERPRINTS = get_interface_attr('FINGERPRINTS')
ECU_NAME = {v: k for k, v in Ecu.schema.enumerants.items()}
FINGERPRINTS_PY_TEMPLATE = jinja2.Template("""
{%- if FINGERPRINTS[brand] %}
@@ -45,7 +49,7 @@ FW_VERSIONS{% if not FW_VERSIONS[brand] %}: dict[str, dict[tuple, list[bytes]]]{
{% for car, _ in FW_VERSIONS[brand].items() %}
CAR.{{car.name}}: {
{% for key, fw_versions in FW_VERSIONS[brand][car].items() %}
(Ecu.{{key[0]}}, 0x{{"%0x" | format(key[1] | int)}}, \
(Ecu.{{ECU_NAME[key[0]]}}, 0x{{"%0x" | format(key[1] | int)}}, \
{% if key[2] %}0x{{"%0x" | format(key[2] | int)}}{% else %}{{key[2]}}{% endif %}): [
{% for fw_version in (fw_versions + extra_fw_versions.get(car, {}).get(key, [])) | unique | sort %}
{{fw_version}},
@@ -67,8 +71,9 @@ def format_brand_fw_versions(brand, extra_fw_versions: None | dict[str, dict[tup
comments = [line for line in f.readlines() if line.startswith("#") and "noqa" not in line]
with open(fingerprints_file, "w") as f:
f.write(FINGERPRINTS_PY_TEMPLATE.render(brand=brand, comments=comments, FINGERPRINTS=FINGERPRINTS,
FW_VERSIONS=FW_VERSIONS, extra_fw_versions=extra_fw_versions))
f.write(FINGERPRINTS_PY_TEMPLATE.render(brand=brand, comments=comments, ECU_NAME=ECU_NAME,
FINGERPRINTS=FINGERPRINTS, FW_VERSIONS=FW_VERSIONS,
extra_fw_versions=extra_fw_versions))
if __name__ == "__main__":

View File

@@ -25,7 +25,7 @@ while True:
if c.src % 0x80 == 0 and c.address < 0x800 and c.address not in (0x7df, 0x7e0, 0x7e8):
msgs[c.address] = len(c.dat)
fingerprint = ', '.join("%d: %d" % v for v in sorted(msgs.items()))
fingerprint = ', '.join(f"{v[0]}: {v[1]}" for v in sorted(msgs.items()))
print(f"number of messages {len(msgs)}:")
print(f"fingerprint {fingerprint}")

View File

@@ -8,6 +8,7 @@ from enum import Enum
from collections import defaultdict
from cereal import log, messaging
from cereal.services import SERVICE_LIST
from openpilot.common.transformations.orientation import rot_from_euler
from openpilot.common.realtime import config_realtime_process
from openpilot.common.params import Params
@@ -23,8 +24,10 @@ MIN_STD_SANITY_CHECK = 1e-5 # m or rad
MAX_FILTER_REWIND_TIME = 0.8 # s
MAX_SENSOR_TIME_DIFF = 0.1 # s
YAWRATE_CROSS_ERR_CHECK_FACTOR = 30
INPUT_INVALID_THRESHOLD = 0.5
INPUT_INVALID_DECAY = 0.9993 # ~10 secs to resume after a bad input
INPUT_INVALID_THRESHOLD = 0.5 # 0 bad inputs ignored
TIMING_INVALID_THRESHOLD = 2.5 # 2 bad timings ignored
INPUT_INVALID_DECAY = 0.9993 # ~10 secs to resume after exceeding allowed bad inputs by one (at 100hz)
TIMING_INVALID_DECAY = 0.9990 # ~2 secs to resume after exceeding allowed bad timings by one (at 100hz)
POSENET_STD_INITIAL_VALUE = 10.0
POSENET_STD_HIST_HALF = 20
@@ -265,10 +268,13 @@ def main():
estimator = LocationEstimator(DEBUG)
filter_initialized = False
critcal_services = ["accelerometer", "gyroscope", "liveCalibration", "cameraOdometry"]
observation_timing_invalid = False
critcal_services = ["accelerometer", "gyroscope", "cameraOdometry"]
observation_timing_invalid = defaultdict(int)
observation_input_invalid = defaultdict(int)
input_invalid_decay = {s: INPUT_INVALID_DECAY ** (100. / SERVICE_LIST[s].frequency) for s in critcal_services}
timing_invalid_decay = {s: TIMING_INVALID_DECAY ** (100. / SERVICE_LIST[s].frequency) for s in critcal_services}
initial_pose = params.get("LocationFilterInitialState")
if initial_pose is not None:
initial_pose = json.loads(initial_pose)
@@ -282,8 +288,6 @@ def main():
acc_msgs, gyro_msgs = (messaging.drain_sock(sock) for sock in sensor_sockets)
if filter_initialized:
observation_timing_invalid = False
msgs = []
for msg in acc_msgs + gyro_msgs:
t, valid, which, data = msg.logMonoTime, msg.valid, msg.which(), getattr(msg, msg.which())
@@ -298,18 +302,23 @@ def main():
if valid:
t = log_mono_time * 1e-9
res = estimator.handle_log(t, which, msg)
if which not in critcal_services:
continue
if res == HandleLogResult.TIMING_INVALID:
observation_timing_invalid = True
observation_timing_invalid[which] += 1
elif res == HandleLogResult.INPUT_INVALID:
observation_input_invalid[which] += 1
else:
observation_input_invalid[which] *= INPUT_INVALID_DECAY
observation_input_invalid[which] *= input_invalid_decay[which]
observation_timing_invalid[which] *= timing_invalid_decay[which]
else:
filter_initialized = sm.all_checks() and sensor_all_checks(acc_msgs, gyro_msgs, sensor_valid, sensor_recv_time, sensor_alive, SIMULATION)
if sm.updated["cameraOdometry"]:
critical_service_inputs_valid = all(observation_input_invalid[s] < INPUT_INVALID_THRESHOLD for s in critcal_services)
inputs_valid = sm.all_valid() and critical_service_inputs_valid and not observation_timing_invalid
critical_service_timing_valid = all(observation_timing_invalid[s] < TIMING_INVALID_THRESHOLD for s in critcal_services)
inputs_valid = sm.all_valid() and critical_service_inputs_valid and critical_service_timing_valid
sensors_valid = sensor_all_checks(acc_msgs, gyro_msgs, sensor_valid, sensor_recv_time, sensor_alive, SIMULATION)
msg = estimator.get_msg(sensors_valid, inputs_valid, filter_initialized)

View File

@@ -1,4 +1,3 @@
import pytest
import numpy as np
from collections import defaultdict
from enum import Enum
@@ -17,6 +16,7 @@ SELECT_COMPARE_FIELDS = {
'sensors_flag': ['sensorsOK'],
}
JUNK_IDX = 100
CONSISTENT_SPIKES_COUNT = 10
class Scenario(Enum):
@@ -25,6 +25,8 @@ class Scenario(Enum):
GYRO_SPIKE_MIDWAY = 'gyro_spike_midway'
ACCEL_OFF = 'accel_off'
ACCEL_SPIKE_MIDWAY = 'accel_spike_midway'
SENSOR_TIMING_SPIKE_MIDWAY = 'timing_spikes'
SENSOR_TIMING_CONSISTENT_SPIKES = 'timing_consistent_spikes'
def get_select_fields_data(logs):
@@ -43,6 +45,17 @@ def get_select_fields_data(logs):
return data
def modify_logs_midway(logs, which, count, fn):
non_which = [x for x in logs if x.which() != which]
which = [x for x in logs if x.which() == which]
temps = which[len(which) // 2:len(which) // 2 + count]
for i, temp in enumerate(temps):
temp = temp.as_builder()
fn(temp)
which[len(which) // 2 + i] = temp.as_reader()
return sorted(non_which + which, key=lambda x: x.logMonoTime)
def run_scenarios(scenario, logs):
if scenario == Scenario.BASE:
pass
@@ -51,30 +64,28 @@ def run_scenarios(scenario, logs):
logs = sorted([x for x in logs if x.which() != 'gyroscope'], key=lambda x: x.logMonoTime)
elif scenario == Scenario.GYRO_SPIKE_MIDWAY:
non_gyro = [x for x in logs if x.which() not in 'gyroscope']
gyro = [x for x in logs if x.which() in 'gyroscope']
temp = gyro[len(gyro) // 2].as_builder()
temp.gyroscope.gyroUncalibrated.v[0] += 3.0
gyro[len(gyro) // 2] = temp.as_reader()
logs = sorted(non_gyro + gyro, key=lambda x: x.logMonoTime)
def gyro_spike(msg):
msg.gyroscope.gyroUncalibrated.v[0] += 3.0
logs = modify_logs_midway(logs, 'gyroscope', 1, gyro_spike)
elif scenario == Scenario.ACCEL_OFF:
logs = sorted([x for x in logs if x.which() != 'accelerometer'], key=lambda x: x.logMonoTime)
elif scenario == Scenario.ACCEL_SPIKE_MIDWAY:
non_accel = [x for x in logs if x.which() not in 'accelerometer']
accel = [x for x in logs if x.which() in 'accelerometer']
temp = accel[len(accel) // 2].as_builder()
temp.accelerometer.acceleration.v[0] += 10.0
accel[len(accel) // 2] = temp.as_reader()
logs = sorted(non_accel + accel, key=lambda x: x.logMonoTime)
def acc_spike(msg):
msg.accelerometer.acceleration.v[0] += 10.0
logs = modify_logs_midway(logs, 'accelerometer', 1, acc_spike)
elif scenario == Scenario.SENSOR_TIMING_SPIKE_MIDWAY or scenario == Scenario.SENSOR_TIMING_CONSISTENT_SPIKES:
def timing_spike(msg):
msg.accelerometer.timestamp -= int(0.150 * 1e9)
count = 1 if scenario == Scenario.SENSOR_TIMING_SPIKE_MIDWAY else CONSISTENT_SPIKES_COUNT
logs = modify_logs_midway(logs, 'accelerometer', count, timing_spike)
replayed_logs = replay_process_with_name(name='locationd', lr=logs)
return get_select_fields_data(logs), get_select_fields_data(replayed_logs)
@pytest.mark.xdist_group("test_locationd_scenarios")
@pytest.mark.shared_download_cache
class TestLocationdScenarios:
"""
Test locationd with different scenarios. In all these scenarios, we expect the following:
@@ -122,7 +133,7 @@ class TestLocationdScenarios:
assert np.allclose(orig_data['yaw_rate'], replayed_data['yaw_rate'], atol=np.radians(0.35))
assert np.allclose(orig_data['roll'], replayed_data['roll'], atol=np.radians(0.55))
assert np.diff(replayed_data['inputs_flag'])[499] == -1.0
assert np.diff(replayed_data['inputs_flag'])[696] == 1.0
assert np.diff(replayed_data['inputs_flag'])[704] == 1.0
def test_accel_off(self):
"""
@@ -146,3 +157,21 @@ class TestLocationdScenarios:
orig_data, replayed_data = run_scenarios(Scenario.ACCEL_SPIKE_MIDWAY, self.logs)
assert np.allclose(orig_data['yaw_rate'], replayed_data['yaw_rate'], atol=np.radians(0.35))
assert np.allclose(orig_data['roll'], replayed_data['roll'], atol=np.radians(0.55))
def test_single_timing_spike(self):
"""
Test: timing of 150ms off for the single accelerometer message in the middle of the segment
Expected Result: the message is ignored, and inputsOK is False for that time
"""
orig_data, replayed_data = run_scenarios(Scenario.SENSOR_TIMING_SPIKE_MIDWAY, self.logs)
assert np.all(replayed_data['inputs_flag'] == orig_data['inputs_flag'])
assert np.all(replayed_data['sensors_flag'] == orig_data['sensors_flag'])
def test_consistent_timing_spikes(self):
"""
Test: consistent timing spikes for N accelerometer messages in the middle of the segment
Expected Result: inputsOK becomes False after N of bad measurements
"""
orig_data, replayed_data = run_scenarios(Scenario.SENSOR_TIMING_CONSISTENT_SPIKES, self.logs)
assert np.diff(replayed_data['inputs_flag'])[500] == -1.0
assert np.diff(replayed_data['inputs_flag'])[787] == 1.0

View File

@@ -12,7 +12,6 @@ from cereal import messaging
from cereal.messaging import PubMaster, SubMaster
from msgq.visionipc import VisionIpcClient, VisionStreamType, VisionBuf
from openpilot.common.swaglog import cloudlog
from openpilot.common.params import Params
from openpilot.common.realtime import set_realtime_priority
from openpilot.selfdrive.modeld.runners import ModelRunner, Runtime
from openpilot.selfdrive.modeld.models.commonmodel_pyx import CLContext
@@ -126,7 +125,6 @@ def main():
cl_context = CLContext()
model = ModelState(cl_context)
cloudlog.warning("models loaded, dmonitoringmodeld starting")
Params().put_bool("DmModelInitialized", True)
cloudlog.warning("connecting to driver stream")
vipc_client = VisionIpcClient("camerad", VisionStreamType.VISION_STREAM_DRIVER, True, cl_context)
@@ -139,7 +137,6 @@ def main():
pm = PubMaster(["driverStateV2"])
calib = np.zeros(CALIB_LEN, dtype=np.float32)
# last = 0
while True:
buf = vipc_client.recv()
@@ -155,8 +152,6 @@ def main():
t2 = time.perf_counter()
pm.send("driverStateV2", get_driverstate_packet(model_output, vipc_client.frame_id, vipc_client.timestamp_sof, t2 - t1, gpu_execution_time))
# print("dmonitoring process: %.2fms, from last %.2fms\n" % (t2 - t1, t1 - last))
# last = t1
if __name__ == "__main__":

View File

@@ -17,7 +17,6 @@ from openpilot.common.realtime import config_realtime_process
from openpilot.common.transformations.camera import DEVICE_CAMERAS
from openpilot.common.transformations.model import get_warp_matrix
from openpilot.system import sentry
from openpilot.selfdrive.car.card import convert_to_capnp
from openpilot.selfdrive.controls.lib.desire_helper import DesireHelper
from openpilot.selfdrive.modeld.runners import ModelRunner, Runtime
from openpilot.selfdrive.modeld.parse_model_outputs import Parser
@@ -184,7 +183,7 @@ def main(demo=False):
if demo:
CP = convert_to_capnp(get_demo_car_params())
CP = get_demo_car_params()
else:
CP = messaging.log_from_bytes(params.get("CarParams", block=True), car.CarParams)
cloudlog.info("modeld got CarParams: %s", CP.carName)
@@ -231,7 +230,8 @@ def main(demo=False):
desire = DH.desire
is_rhd = sm["driverMonitoringState"].isRHD
frame_id = sm["roadCameraState"].frameId
lateral_control_params = np.array([sm["carState"].vEgo, steer_delay], dtype=np.float32)
v_ego = max(sm["carState"].vEgo, 0.)
lateral_control_params = np.array([v_ego, steer_delay], dtype=np.float32)
if sm.updated["liveCalibration"] and sm.seen['roadCameraState'] and sm.seen['deviceState']:
device_from_calib_euler = np.array(sm["liveCalibration"].rpyCalib, dtype=np.float32)
dc = DEVICE_CAMERAS[(str(sm['deviceState'].deviceType), str(sm['roadCameraState'].sensor))]

Binary file not shown.

View File

@@ -7,7 +7,6 @@ from opendbc.car.car_helpers import get_demo_car_params
from openpilot.common.params import Params
from openpilot.common.transformations.camera import DEVICE_CAMERAS
from openpilot.common.realtime import DT_MDL
from openpilot.selfdrive.car.card import convert_to_capnp
from openpilot.system.manager.process_config import managed_processes
from openpilot.selfdrive.test.process_replay.vision_meta import meta_from_camera_state
@@ -20,11 +19,11 @@ class TestModeld:
def setup_method(self):
self.vipc_server = VisionIpcServer("camerad")
self.vipc_server.create_buffers(VisionStreamType.VISION_STREAM_ROAD, 40, False, CAM.width, CAM.height)
self.vipc_server.create_buffers(VisionStreamType.VISION_STREAM_DRIVER, 40, False, CAM.width, CAM.height)
self.vipc_server.create_buffers(VisionStreamType.VISION_STREAM_WIDE_ROAD, 40, False, CAM.width, CAM.height)
self.vipc_server.create_buffers(VisionStreamType.VISION_STREAM_ROAD, 40, CAM.width, CAM.height)
self.vipc_server.create_buffers(VisionStreamType.VISION_STREAM_DRIVER, 40, CAM.width, CAM.height)
self.vipc_server.create_buffers(VisionStreamType.VISION_STREAM_WIDE_ROAD, 40, CAM.width, CAM.height)
self.vipc_server.start_listener()
Params().put("CarParams", convert_to_capnp(get_demo_car_params()).to_bytes())
Params().put("CarParams", get_demo_car_params().to_bytes())
self.sm = messaging.SubMaster(['modelV2', 'cameraOdometry'])
self.pm = messaging.PubMaster(['roadCameraState', 'wideRoadCameraState', 'liveCalibration'])

View File

@@ -1,6 +1,6 @@
from math import atan2
from cereal import car
from cereal import car, log
import cereal.messaging as messaging
from openpilot.selfdrive.selfdrived.events import Events
from openpilot.common.numpy_fast import interp
@@ -9,7 +9,7 @@ from openpilot.common.filter_simple import FirstOrderFilter
from openpilot.common.stat_live import RunningStatFilter
from openpilot.common.transformations.camera import DEVICE_CAMERAS
EventName = car.OnroadEvent.EventName
EventName = log.OnroadEvent.EventName
# ******************************************************************************************
# NOTE: To fork maintainers.

View File

@@ -1,10 +1,10 @@
import numpy as np
from cereal import car, log
from cereal import log
from openpilot.common.realtime import DT_DMON
from openpilot.selfdrive.monitoring.helpers import DriverMonitoring, DRIVER_MONITOR_SETTINGS
EventName = car.OnroadEvent.EventName
EventName = log.OnroadEvent.EventName
dm_settings = DRIVER_MONITOR_SETTINGS()
TEST_TIMESPAN = 120 # seconds

View File

@@ -145,6 +145,10 @@ void Panda::set_can_speed_kbps(uint16_t bus, uint16_t speed) {
handle->control_write(0xde, bus, (speed * 10));
}
void Panda::set_can_fd_auto(uint16_t bus, bool enabled) {
handle->control_write(0xe8, bus, enabled);
}
void Panda::set_data_speed_kbps(uint16_t bus, uint16_t speed) {
handle->control_write(0xf9, bus, (speed * 10));
}

View File

@@ -77,6 +77,7 @@ public:
void enable_deepsleep();
void send_heartbeat(bool engaged);
void set_can_speed_kbps(uint16_t bus, uint16_t speed);
void set_can_fd_auto(uint16_t bus, bool enabled);
void set_data_speed_kbps(uint16_t bus, uint16_t speed);
void set_canfd_non_iso(uint16_t bus, bool non_iso);
void can_send(const capnp::List<cereal::CanData>::Reader &can_data_list);

View File

@@ -67,6 +67,10 @@ Panda *connect(std::string serial="", uint32_t index=0) {
}
//panda->enable_deepsleep();
for (int i = 0; i < PANDA_BUS_CNT; i++) {
panda->set_can_fd_auto(i, true);
}
if (!panda->up_to_date() && !getenv("BOARDD_SKIP_FW_CHECK")) {
throw std::runtime_error("Panda firmware out of date. Run pandad.py to update.");
}
@@ -306,6 +310,16 @@ void send_peripheral_state(Panda *panda, PubMaster *pm) {
LOGW("reading hwmon took %lfms", read_time);
}
// fall back to panda's voltage and current measurement
if (ps.getVoltage() == 0 && ps.getCurrent() == 0) {
auto health_opt = panda->get_state();
if (health_opt) {
health_t health = *health_opt;
ps.setVoltage(health.voltage_pkt);
ps.setCurrent(health.current_pkt);
}
}
uint16_t fan_speed_rpm = panda->get_fan_speed();
ps.setFanSpeedRpm(fan_speed_rpm);

View File

@@ -239,7 +239,7 @@ int PandaSpiHandle::spi_transfer_retry(uint8_t endpoint, uint8_t *tx_data, uint1
// due to full TX buffers
nack_count += 1;
if (nack_count > 3) {
SPILOG(LOGE, "NACK sleep %d", nack_count);
SPILOG(LOGD, "NACK sleep %d", nack_count);
usleep(std::clamp(nack_count*10, 200, 2000));
}
}
@@ -418,7 +418,7 @@ fail:
}
}
if (ret > 0) ret = -1;
if (ret >= 0) ret = -1;
return ret;
}
#endif

View File

@@ -6,6 +6,7 @@ import cereal.messaging as messaging
from cereal import log
from openpilot.common.gpio import gpio_set, gpio_init
from panda import Panda, PandaDFU, PandaProtocolMismatch
from openpilot.common.retry import retry
from openpilot.system.manager.process_config import managed_processes
from openpilot.system.hardware import HARDWARE
from openpilot.system.hardware.tici.pins import GPIO
@@ -51,6 +52,7 @@ class TestPandad:
assert not Panda.wait_for_dfu(None, 3)
assert not Panda.wait_for_panda(None, 3)
@retry(attempts=3)
def _flash_bootstub_and_test(self, fn, expect_mismatch=False):
self._go_to_dfu()
pd = PandaDFU(None)
@@ -103,9 +105,8 @@ class TestPandad:
# 5s for USB (due to enumeration)
# - 0.2s pandad -> pandad
# - plus some buffer
assert 0.1 < (sum(ts)/len(ts)) < (0.5 if self.spi else 5.0)
print("startup times", ts, sum(ts) / len(ts))
assert 0.1 < (sum(ts)/len(ts)) < (0.7 if self.spi else 5.0)
def test_protocol_version_check(self):
if not self.spi:

View File

@@ -14,7 +14,7 @@ from openpilot.common.params import Params
from openpilot.common.timeout import Timeout
from openpilot.selfdrive.pandad import can_list_to_can_capnp
from openpilot.system.hardware import TICI
from openpilot.selfdrive.test.helpers import phone_only, with_processes
from openpilot.selfdrive.test.helpers import with_processes
@retry(attempts=3)
@@ -72,7 +72,6 @@ class TestBoarddLoopback:
os.environ['STARTED'] = '1'
os.environ['BOARDD_LOOPBACK'] = '1'
@phone_only
@with_processes(['pandad'])
def test_loopback(self):
num_pandas = 2 if TICI and "SINGLE_PANDA" not in os.environ else 1

View File

@@ -7,7 +7,7 @@ import random
import cereal.messaging as messaging
from cereal.services import SERVICE_LIST
from openpilot.system.hardware import HARDWARE
from openpilot.selfdrive.test.helpers import phone_only, with_processes
from openpilot.selfdrive.test.helpers import with_processes
from openpilot.selfdrive.pandad.tests.test_pandad_loopback import setup_pandad, send_random_can_messages
JUNGLE_SPAM = "JUNGLE_SPAM" in os.environ
@@ -23,7 +23,6 @@ class TestBoarddSpi:
if not JUNGLE_SPAM:
os.environ['BOARDD_LOOPBACK'] = '1'
@phone_only
@with_processes(['pandad'])
def test_spi_corruption(self, subtests):
setup_pandad(1)

View File

@@ -27,10 +27,13 @@ class AlertEntry:
alert: Alert | None = None
start_frame: int = -1
end_frame: int = -1
added_frame: int = -1
def active(self, frame: int) -> bool:
return frame <= self.end_frame
def just_added(self, frame: int) -> bool:
return self.active(frame) and frame == (self.added_frame + 1)
class AlertManager:
def __init__(self):
@@ -41,10 +44,11 @@ class AlertManager:
for alert in alerts:
entry = self.alerts[alert.alert_type]
entry.alert = alert
if not entry.active(frame):
if not entry.just_added(frame):
entry.start_frame = frame
min_end_frame = entry.start_frame + alert.duration
entry.end_frame = max(frame + 1, min_end_frame)
entry.added_frame = frame
def process_alerts(self, frame: int, clear_event_types: set):
ae = AlertEntry()

View File

@@ -16,7 +16,7 @@ AlertSize = log.SelfdriveState.AlertSize
AlertStatus = log.SelfdriveState.AlertStatus
VisualAlert = car.CarControl.HUDControl.VisualAlert
AudibleAlert = car.CarControl.HUDControl.AudibleAlert
EventName = car.OnroadEvent.EventName
EventName = log.OnroadEvent.EventName
# Alert priorities
@@ -98,7 +98,7 @@ class Events:
def to_msg(self):
ret = []
for event_name in self.events:
event = car.OnroadEvent.new_message()
event = log.OnroadEvent.new_message()
event.name = event_name
for event_type in EVENTS.get(event_name, {}):
setattr(event, event_type, True)
@@ -382,14 +382,21 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = {
ET.PERMANENT: StartupAlert("Dashcam mode for unsupported car"),
},
EventName.startupNoSecOcKey: {
ET.PERMANENT: NormalPermanentAlert("Dashcam Mode",
"Security Key Not Available",
priority=Priority.HIGH),
},
EventName.dashcamMode: {
ET.PERMANENT: NormalPermanentAlert("Dashcam Mode",
priority=Priority.LOWEST),
},
EventName.invalidLkasSetting: {
ET.PERMANENT: NormalPermanentAlert("Stock LKAS is on",
"Turn off stock LKAS to engage"),
ET.PERMANENT: NormalPermanentAlert("Invalid LKAS setting",
"Toggle stock LKAS on or off to engage"),
ET.NO_ENTRY: NoEntryAlert("Invalid LKAS setting"),
},
EventName.cruiseMismatch: {
@@ -717,11 +724,6 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = {
Priority.LOWER, VisualAlert.none, AudibleAlert.none, .2, creation_delay=600.)
},
EventName.soundsUnavailable: {
ET.PERMANENT: NormalPermanentAlert("Speaker not found", "Reboot your Device"),
ET.NO_ENTRY: NoEntryAlert("Speaker not found"),
},
EventName.tooDistracted: {
ET.NO_ENTRY: NoEntryAlert("Distraction Level Too High"),
},
@@ -939,16 +941,6 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = {
ET.NO_ENTRY: NoEntryAlert("Slow down to engage"),
},
EventName.lowSpeedLockout: {
ET.PERMANENT: NormalPermanentAlert("Cruise Fault: Restart the car to engage"),
ET.NO_ENTRY: NoEntryAlert("Cruise Fault: Restart the Car"),
},
EventName.lkasDisabled: {
ET.PERMANENT: NormalPermanentAlert("LKAS Disabled: Enable LKAS to engage"),
ET.NO_ENTRY: NoEntryAlert("LKAS Disabled"),
},
EventName.vehicleSensorsInvalid: {
ET.IMMEDIATE_DISABLE: ImmediateDisableAlert("Vehicle Sensors Invalid"),
ET.PERMANENT: NormalPermanentAlert("Vehicle Sensors Calibrating", "Drive to Calibrate"),

View File

@@ -7,6 +7,7 @@ import cereal.messaging as messaging
from cereal import car, log
from msgq.visionipc import VisionIpcClient, VisionStreamType
from panda import ALTERNATIVE_EXPERIENCE
from openpilot.common.params import Params
@@ -14,12 +15,12 @@ from openpilot.common.realtime import config_realtime_process, Priority, Ratekee
from openpilot.common.swaglog import cloudlog
from openpilot.common.gps import get_gps_location_service
from openpilot.selfdrive.car.car_specific import CarSpecificEvents
from openpilot.selfdrive.selfdrived.events import Events, ET
from openpilot.selfdrive.selfdrived.state import StateMachine
from openpilot.selfdrive.selfdrived.alertmanager import AlertManager, set_offroad_alert
from openpilot.selfdrive.controls.lib.latcontrol import MIN_LATERAL_CONTROL_SPEED
from openpilot.system.hardware import HARDWARE
from openpilot.system.version import get_build_metadata
REPLAY = "REPLAY" in os.environ
@@ -33,7 +34,7 @@ State = log.SelfdriveState.OpenpilotState
PandaType = log.PandaState.PandaType
LaneChangeState = log.LaneChangeState
LaneChangeDirection = log.LaneChangeDirection
EventName = car.OnroadEvent.EventName
EventName = log.OnroadEvent.EventName
ButtonType = car.CarState.ButtonEvent.Type
SafetyModel = car.CarParams.SafetyModel
@@ -41,15 +42,21 @@ IGNORED_SAFETY_MODES = (SafetyModel.silent, SafetyModel.noOutput)
class SelfdriveD:
def __init__(self):
def __init__(self, CP=None):
self.params = Params()
# Ensure the current branch is cached, otherwise the first cycle lags
build_metadata = get_build_metadata()
cloudlog.info("selfdrived is waiting for CarParams")
self.CP = messaging.log_from_bytes(self.params.get("CarParams", block=True), car.CarParams)
cloudlog.info("selfdrived got CarParams")
if CP is None:
cloudlog.info("selfdrived is waiting for CarParams")
self.CP = messaging.log_from_bytes(self.params.get("CarParams", block=True), car.CarParams)
cloudlog.info("selfdrived got CarParams")
else:
self.CP = CP
self.car_events = CarSpecificEvents(self.CP)
self.disengage_on_accelerator = not (self.CP.alternativeExperience & ALTERNATIVE_EXPERIENCE.DISABLE_DISENGAGE_ON_GAS)
# Setup sockets
self.pm = messaging.PubMaster(['selfdriveState', 'onroadEvents'])
@@ -80,9 +87,6 @@ class SelfdriveD:
self.is_metric = self.params.get_bool("IsMetric")
self.is_ldw_enabled = self.params.get_bool("IsLdwEnabled")
# detect sound card presence and ensure successful init
sounds_available = HARDWARE.get_sound_card_online()
car_recognized = self.CP.carName != 'mock'
# cleanup old params
@@ -118,9 +122,9 @@ class SelfdriveD:
self.startup_event = EventName.startupNoCar
elif car_recognized and self.CP.passive:
self.startup_event = EventName.startupNoControl
elif self.CP.secOcRequired and not self.CP.secOcKeyAvailable:
self.startup_event = EventName.startupNoSecOcKey
if not sounds_available:
self.events.add(EventName.soundsUnavailable, static=True)
if not car_recognized:
self.events.add(EventName.carUnrecognized, static=True)
set_offroad_alert("Offroad_CarUnrecognized", True)
@@ -164,7 +168,20 @@ class SelfdriveD:
# Add car events, ignore if CAN isn't valid
if CS.canValid:
self.events.add_from_msg(CS.events)
car_events = self.car_events.update(CS, self.CS_prev, self.sm['carControl']).to_msg()
self.events.add_from_msg(car_events)
if self.CP.notCar:
# wait for everything to init first
if self.sm.frame > int(5. / DT_CTRL) and self.initialized:
# body always wants to enable
self.events.add(EventName.pcmEnable)
# Disable on rising edge of accelerator or brake. Also disable on brake when speed > 0
if (CS.gasPressed and not self.CS_prev.gasPressed and self.disengage_on_accelerator) or \
(CS.brakePressed and (not self.CS_prev.brakePressed or not CS.standstill)) or \
(CS.regenBraking and (not self.CS_prev.regenBraking or not CS.standstill)):
self.events.add(EventName.pedalPressed)
# Create events for temperature, disk space, and memory
if self.sm['deviceState'].thermalStatus >= ThermalStatus.red:
@@ -238,11 +255,12 @@ class SelfdriveD:
num_events = len(self.events)
not_running = {p.name for p in self.sm['managerState'].processes if not p.running and p.shouldBeRunning}
if self.sm.recv_frame['managerState'] and (not_running - IGNORE_PROCESSES):
self.events.add(EventName.processNotRunning)
if self.sm.recv_frame['managerState'] and len(not_running):
if not_running != self.not_running_prev:
cloudlog.event("process_not_running", not_running=not_running, error=True)
self.not_running_prev = not_running
if self.sm.recv_frame['managerState'] and (not_running - IGNORE_PROCESSES):
self.events.add(EventName.processNotRunning)
else:
if not SIMULATION and not self.rk.lagging:
if not self.sm.all_alive(self.camera_packets):
@@ -332,7 +350,7 @@ class SelfdriveD:
self.events.add(EventName.noGps)
if gps_ok:
self.distance_traveled = 0
self.distance_traveled += CS.vEgo * DT_CTRL
self.distance_traveled += abs(CS.vEgo) * DT_CTRL
if self.sm['modelV2'].frameDropPerc > 20:
self.events.add(EventName.modeldLagging)

View File

@@ -1,6 +1,6 @@
import random
from openpilot.selfdrive.selfdrived.events import Alert, EVENTS
from openpilot.selfdrive.selfdrived.events import Alert, EmptyAlert, EVENTS
from openpilot.selfdrive.selfdrived.alertmanager import AlertManager
@@ -32,8 +32,27 @@ class TestAlertManager:
for frame in range(duration+10):
if frame < add_duration:
AM.add_many(frame, [alert, ])
AM.process_alerts(frame, {})
AM.process_alerts(frame, set())
shown = AM.current_alert is not None
shown = AM.current_alert != EmptyAlert
should_show = frame <= show_duration
assert shown == should_show, f"{frame=} {add_duration=} {duration=}"
# check one case:
# - if alert is re-added to AM before it ends the duration is extended
if duration > 1:
AM = AlertManager()
show_duration = duration * 2
for frame in range(duration * 2 + 10):
if frame == 0:
AM.add_many(frame, [alert, ])
if frame == duration:
# add alert one frame before it ends
assert AM.current_alert == alert
AM.add_many(frame, [alert, ])
AM.process_alerts(frame, set())
shown = AM.current_alert != EmptyAlert
should_show = frame <= show_duration
assert shown == should_show, f"{frame=} {duration=}"

View File

@@ -33,16 +33,16 @@ class TestAlerts:
# Create fake objects for callback
cls.CS = car.CarState.new_message()
cls.CP = car.CarParams.new_message()
cfg = [c for c in CONFIGS if c.proc_name == 'controlsd'][0]
cfg = [c for c in CONFIGS if c.proc_name == 'selfdrived'][0]
cls.sm = SubMaster(cfg.pubs)
def test_events_defined(self):
# Ensure all events in capnp schema are defined in events.py
events = car.OnroadEvent.EventName.schema.enumerants
events = log.OnroadEvent.EventName.schema.enumerants
for name, e in events.items():
if not name.endswith("DEPRECATED"):
fail_msg = "%s @%d not in EVENTS" % (name, e)
fail_msg = f"{name} @{e} not in EVENTS"
assert e in EVENTS.keys(), fail_msg
# ensure alert text doesn't exceed allowed width

View File

@@ -4,8 +4,7 @@ import sys
from openpilot.common.prefix import OpenpilotPrefix
with OpenpilotPrefix():
ret = subprocess.call(sys.argv[1:])
exit(ret)
sys.exit(ret)

View File

@@ -10,7 +10,6 @@ from functools import wraps
import cereal.messaging as messaging
from openpilot.common.params import Params
from openpilot.system.manager.process_config import managed_processes
from openpilot.system.hardware import PC
from openpilot.system.version import training_version, terms_version
@@ -29,14 +28,6 @@ def set_params_enabled():
msg.liveCalibration.rpyCalib = [0.0, 0.0, 0.0]
params.put("CalibrationParams", msg.to_bytes())
def phone_only(f):
@wraps(f)
def wrap(self, *args, **kwargs):
if PC:
pytest.skip("This test is not meant to run on PC")
return f(self, *args, **kwargs)
return wrap
def release_only(f):
@wraps(f)
def wrap(self, *args, **kwargs):

View File

@@ -64,6 +64,7 @@ class Plant:
control = messaging.new_message('controlsState')
ss = messaging.new_message('selfdriveState')
car_state = messaging.new_message('carState')
lp = messaging.new_message('liveParameters')
car_control = messaging.new_message('carControl')
model = messaging.new_message('modelV2')
a_lead = (v_lead - self.v_lead_prev)/self.ts
@@ -130,6 +131,7 @@ class Plant:
'carControl': car_control.carControl,
'controlsState': control.controlsState,
'selfdriveState': ss.selfdriveState,
'liveParameters': lp.liveParameters,
'modelV2': model.modelV2}
self.planner.update(sm)
self.speed = self.planner.v_desired_filter.x

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