Commit Graph

443 Commits

Author SHA1 Message Date
Adeeb Shihadeh
954b567b9b merge a bunch of misc stuff into common.utils (#36463)
just utils
2025-10-24 20:45:56 -07:00
Shane Smiskol
1c9bbb290a run_process_on_route.py: qol improvements (#35923)
* take from upstrema/exc-lat-accel

* see ya

* sort

* rm

* duh

duh
2025-08-04 17:11:53 -07:00
Adeeb Shihadeh
e0656f9b44 bump panda (#35784) 2025-07-21 18:42:32 -07:00
Shane Smiskol
632f7594a4 Ban time v2 (#35744)
* ban it!

* some legitimate blunders

* even more!

* this is from commaai/one

* here too

* this too

* ignore rest

* one liner

* Revert "one liner"

This reverts commit d96a1624032aaad829a005b523e579d953cfe690.
2025-07-17 16:50:52 -07:00
Shane Smiskol
1562b88f63 Move format_fingerprints.py to opendbc (#35532)
* mv

* format fingerprints

* fixx

* no cereal

* bump
2025-06-11 15:30:45 -07:00
Adeeb Shihadeh
f1ba6c389b quick repo garbage collection (#35274)
* start gc

* lil more

* debug

* no sound

* add back
2025-05-18 16:59:53 -07:00
Shane Smiskol
abad7649d6 Rename experimental long (#35011)
* now alpha long

* fix

* rename param

* thought i did this

* debug

* debug

* more

* more

* moar

* Revert "moar"

This reverts commit e347106246583982e1be206485ad4d8eb944f817.

* Revert "more"

This reverts commit 0746e6d2e400ce1715614c62af84a9680c4d65c1.

* Revert "more"

This reverts commit 0db5a8792c01bb2d687f9152e6ba37fb76d4a453.

* Revert "debug"

This reverts commit 72f235b13727980e4331ff487998ddc7c7f7fb63.

* Revert "debug"

This reverts commit 7871b69f8c1bdffed386c2baac99542fcc50f7eb.
2025-04-14 17:17:59 -07:00
Shane Smiskol
e652f435f9 max_lat_accel.py: use parallel processing (#34936)
* use run_across_segments

* disable tqdm
2025-03-25 13:26:16 -07:00
Shane Smiskol
de8806cdfd Add extrapolate option to max_lat_accel.py (#34931)
* add extrapolate

* -e

* adjust
2025-03-24 15:21:36 -07:00
Alexandre Nobuharu Sato
5a28b0c9fe Avoid IndexError in max_lat_accel.py due to empty values in dataset (#34926)
* Update max_lat_accel.py

The error you're encountering is due to the fact that the code is trying to calculate the 90th percentile of lateral acceleration values that are less than 0, but there are no such values in the dataset. This results in an empty list, which causes the np.percentile function to fail with an IndexError

* fix

* simpler

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2025-03-24 14:40:25 -07:00
Shane Smiskol
27ce30587a fix 2025-03-21 16:18:39 -07:00
Shane Smiskol
715a38fd6a max_lat_accel: support multiple routes 2025-03-21 16:16:53 -07:00
Shane Smiskol
7ab558a789 run_process_on_route: support multiple processes (#34867)
support multiple procs
2025-03-14 16:09:23 -07:00
Shane Smiskol
18db927fc1 test_models: convert can data to namedtuple (#34845)
* stash

* fastest

* faster but not fastest

* clean up

* here too

* fix that

* revert

* already sorted

* rev

* clean up

* allow empty

* lower tm time for cache miss
2025-03-11 14:58:05 -07:00
Shane Smiskol
ae3a715f51 test_fw_query_on_routes: support no FW 2025-03-06 18:52:46 -08:00
Shane Smiskol
a14bcb5461 fix static analysis 2025-02-28 17:01:20 -08:00
Shane Smiskol
7d43fbae7f debug_fw_fingerprinting_offline: add rxoffset 2025-02-28 15:55:50 -08:00
Shane Smiskol
8f3e773977 actuators: rename steer to torque (#34724)
* bump

* temp fix

* fix

* forgot these
2025-02-27 16:12:55 -08:00
Shane Smiskol
a8c14a4e10 Script to plot max lateral acceleration events (#34710)
* max lat accel script

* more

* clean up

* 90th percentile good

* ugh
2025-02-25 18:03:59 -08:00
commaci-public
2944bead37 [bot] Update Python packages (#34664)
* Update Python packages

* fix that

* fix that too

* bump panda

* bump

---------

Co-authored-by: Vehicle Researcher <user@comma.ai>
Co-authored-by: Shane Smiskol <shane@smiskol.com>
2025-02-21 17:37:04 -08:00
Shane Smiskol
f2fb0b92ad debug_fw_fingerprinting_offline.py: better formatting 2025-02-19 23:30:33 -08:00
Shane Smiskol
d6a0e49def Move safety constants to opendbc (#34573)
* forgot these

* bump

* get these

* and flags

* fix

* bump

* test

* debug

* print sim thread errors
2025-02-11 21:48:20 -08:00
Dean Lee
27c11eb597 athena upload: streaming file upload (#34559)
streaming file upload
2025-02-10 13:57:31 -08:00
Adeeb Shihadeh
9bc35c0919 Revert "athena upload: reduce memory usage and improve efficiency with streaming (#34528)"
This reverts commit 4c65f51a55.
2025-02-06 11:50:04 -08:00
Dean Lee
4c65f51a55 athena upload: reduce memory usage and improve efficiency with streaming (#34528)
* reduce memory usage and improve upload efficiency with streaming

* space
2025-02-04 13:10:13 -08:00
Shane Smiskol
26f972b9f7 Bump opendbc (#34525)
* no debug param and new import

* bump

* bump to master

* and fix that

* oop

* bump to master
2025-02-03 21:05:23 -08:00
Mauricio Alvarez Leon
c57f535238 add adb toggle to developerPanel (#34459)
* add adb toggle to developerPanel

* translations + toggleOrder

* initial docs

* move adb.sh into toggle

* finish up docs

* QProcess

* adbToggle h

* translations

* vanish translations

* description

* tr

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2025-01-25 13:24:24 -08:00
Sammohana
8eebce75ac Getting rid of openpilot.common.numpy_fast (#34368)
* Got rid openpilot.common.numpy_fast

* fixed some data type erros

* importing numpy instead of importing specific functions

* fixing some numpy importing mistakes

* Update selfdrive/car/cruise.py

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2025-01-14 14:52:56 -08:00
Shane Smiskol
db2032c398 Move uds.py (#34374)
* rm uds pt. 1

* rm uds pt. 2

* imports
2025-01-13 00:54:10 -08:00
Adeeb Shihadeh
420d6f0d5e Quick GC pass heading into 2025 (#34330)
* first pass

* bye bye snpe
2025-01-05 15:10:24 -08:00
Maxime Desroches
14123e94bb cleanup touch_replay (#34305)
mathematics
2024-12-23 17:30:05 -05:00
Maxime Desroches
155d842a3b set plot limits for touch events viz (#34277)
lim
2024-12-17 15:10:13 -08:00
Maxime Desroches
70fa0ab4c1 debug: touch events plot (#34242)
* replay

* remove
2024-12-14 13:09:59 -08:00
Adeeb Shihadeh
f3c4770f91 debug: migrate old logs 2024-12-06 10:53:02 -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
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
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
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
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
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
Adeeb Shihadeh
e04455cbaa selfdrived: controlsd only does controls (#33485)
* selfdrived

* process replay

* lil more

* set the valids

* rename that
2024-09-06 17:16:32 -07:00
Adeeb Shihadeh
aef650013e controlsd: split up publishing and logic (#33483)
* split up the pubs

* move all event adds

* split out alerts

* lil more

* clenaup

* update test

* cleanup
2024-09-05 16:28:57 -07:00
Adeeb Shihadeh
7575c707f1 carEvent -> onroadEvent (#33432)
old-commit-hash: c481f11833d748a0d12d2ba14003e931d2849135
2024-09-01 11:31:39 -07:00
Adeeb Shihadeh
1b2bc44227 controlsd: split out state/alerts into selfdriveState (#33421)
* setup selfdriveState

* little more

* update refs

* migration

* all too slow
old-commit-hash: 87051803ab
2024-08-31 18:48:17 -07:00
Adeeb Shihadeh
60549c9557 controlsd: deprecate alertBlinkingRate (#33422)
* controlsd: deprecate alertBlinkingRate

* simplify

* update refs
old-commit-hash: f4e101c67d
2024-08-31 17:58:02 -07:00
Adeeb Shihadeh
55bae8feef openpilot isn't required for a car port PR (#33383)
* disable car docs diff

* mv routes.py

* bump opendbc
old-commit-hash: 48bceb2bbf
2024-08-26 17:12:01 -07:00
Shane Smiskol
4f019b5f60 move selfdrive/car to opendbc (#32630)
* move most of /car

* move some car tests

move some car tests

* fix selfdrive/car/tests

* fix selfdrive/controls tests

* fix the rest of the selfdrive tests

* bump opendbc

* fix all tests

* few more non-test references

* remove opcar and move docs to car

fix these debugging scripts

fix docs

* bump opendbc and panda

forgot panda
old-commit-hash: e735a7f379
2024-08-17 00:54:51 -07:00
Shane Smiskol
95224db413 selfdrive/car: ban cereal and capnp (#33208)
* ban cereal and msgq

* common too

* do toyota/values.py

* do all fingerprints

* example without builder

* this still works, but no type checking anymore

* stash

* wtf, how does this work

* okay actually not bad

* safe

* epic!

* stash data_structures.py

* some clean up

* hell yeah

* clean up old file

* add to delete

* delete

This reverts commit 90239b7797ace31ee647a2fdbd67e0c3faa98dcf.

* switch more CarParams stuff over

remove unused

* fix car tests by removing cereal! mypy forgets about dataclass if we wrap it :(

* fix this too

* fix this too

* remove more cereal and add some good hyundai tests

* bunch more typing

* override default with 20hz radar

* temp capnp converter helper

* more lateralTuning

* small union replicator is better than what i was trying, and fixes mypy dynamic typing issues

* can keep all this the same now!

* type ret: CarParams, add more missing structs, revert lateralTuning changes (smaller diff!)

* revert more

* get first enum automatically, but ofc mypy doesn't pick up the new metaclass so can't use :(

would have been `CarParams.NetworkLocation()`

* Revert "get first enum automatically, but ofc mypy doesn't pick up the new metaclass so can't use :("

This reverts commit bb28b228becba932052d2fc5a4389784027435b1.

* remove cereal from car_helpers (TODO: caching)

* remove a bunch of temp lines

* use dataclass_transform!

* remove some car.CarParams from the interfaces

* remove rest of car.CarParams from the interfaces

* same which() API

* sort

* from cereal/cache from fingerprinting!

* more typing

* dataclass to capnp helper for CarParams, cached it since it's kinda slow

* (partial) fix process replay fingerprintig for new API

* latcontrollers take capnp

* forgot this

* fix test_models

* fix unit tests

* not here

* VehicleModel and controller still takes capnp CP since they get it from Params()

* fix modeld test

* more fix

* need to namespace to structs, since CarState is both class and struct

* this was never in the base class?!

* clean that up again

* fix import error

fix import error

* cmts and more structs

* remove some more cereal from toyota + convert CarState to capnp

* bruh this was wrong

* replace more cereal

* EventName is one of the last things...

* replace a bunch more cereal.car

* missing imports

* more

* can fix this typing now

* proper toyota+others CS typing!

* mypy can detect return type of CS.update() now

* fix redeclaration of cruise_buttons type

* mypy is only complaining about events now

* temp fix

* add carControl struct

* replace CarControl

i hope there's no circular imports in hyundai's CC

* fine now

* lol this was wrong too

* fix crash

* include my failed attempts at recursively converting to dataclass (doesn't implicitly convert types/recursively :( )

but attrs does, maybe will switch in the future

* clean up

* try out attr.s for its converter (doesn't work recursively yet, but interesting!)

* Revert "try out attr.s for its converter (doesn't work recursively yet, but interesting!)"

This reverts commit ff2434f7bbd45a4d4bfb21f7d6712d1f1c3bcde9.

* test processes doesn't fail anymore (on toyota)!

* fix honda crash

* stash

* Revert "stash"

This reverts commit c1762af4e776790e4ad1322ad4ce0610157346e0.

* remove a bunch more cereal!

* LET'S GOOO

* fix these tests

* and these

* and that

* stash, something is wrong with hyundai enable

* Revert "stash, something is wrong with hyundai enable"

This reverts commit 39cf327def258e2959fe23cd7a550a858f6d8f03.

* forgot these

* remove cereal from fw_versions

* Revert "remove cereal from fw_versions"

This reverts commit 232b37cd409b55d04b1afc90d4a80c49e710eb56.

* remove rest of the cereal exceptions!

* fix that

* add typing to radard since I didn't realize RI.update() switched from cereal to structs

* and here too!

* add TODO for slots

* needed CS to be capnp, fix comparisons, and type hint car_specific so it's easier to catch type issues (capnp isn't detected by mypy :( )

* remove the struct converter

* save ~4-5% CPU at 100hz, we don't modify after so no need to deepcopy

btw pickle.loads(pickle.dumps()) is faster by ~1% CPU

* deepcopy -> copy: we can technically make a reference, but copy is almost free and less error-prone

saves ~1% CPU

* add non-copying asdict function

* should save ~3% CPU (still 4% above baseline)

* fix that, no dict support

* ~27% decrease in time for 20k iterations on 3X (3.37857 -> 2.4821s)

* give a better name

* fix

* dont support none, capitalize

* sheesh, this called type() on every field

* remove CS.events, clean up

* bump card %

* this was a bug on master!

* add a which enum

* default to pid

* revert

* update refs

* not needed, but consistent

* just Ecu

* don't need to do this in this pr

* clean up

* no cast

* consistent typing

* rm

* fix

* can do this if we're desperate for the last few %

* Revert "can do this if we're desperate for the last few %"

This reverts commit 18e11ac7883a0a56583750b1cc5a2b13011e7299.

* type this

* don't need to convert carControl

* i guess don't support set either

* fix CP type hint

* simplify that
old-commit-hash: 6a15c42143
2024-08-16 15:13:00 -07:00