Commit Graph

3697 Commits

Author SHA1 Message Date
Shane Smiskol
85278520ed test models: allow public routes (#33740)
* source doesn't matter

* this too

* and
2024-10-07 13:44:38 -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
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
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
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
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
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
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
900c2c83bd docs: car port info cleanup (#33630)
* GC, now duplicated and out of place

* typo fix

* link to official video with better slides

* expansion and cleanup
2024-09-23 16:39:36 -04:00
Shane Smiskol
5e024b775b fix big cars test (#33603)
export and fix platforms
2024-09-19 18:08:40 -07:00
Shane Smiskol
5be53a39f0 Cruise speed: 0 is considered unset (#33449)
* give 10 frames of tolerance to reset -- WARNING: hacks inside

old-commit-hash: d72ac9e53d211074b059f049f8ebc89b9cff1c58

* comment

old-commit-hash: adf1ef88b692132c37d865fc973189fdf971464f

* more conventional

old-commit-hash: 552aa2c159fc535682d098425e827d8cb56911c1

* move

old-commit-hash: fe88ac0afc5aa7438d5b36908744124bc1cb68c9

* oh tf

old-commit-hash: 98d8659bd0f61dd512693807ea29d2f0c78f7514

* better

old-commit-hash: 5ddda806a008cc189758491f91a4a4d0aeb8d343

* this is fine 🔥

* INIT NOT UNINIT

* only vCruise changes here

* update refs
2024-09-16 15:47:59 -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
Dean Lee
51ebf44f48 card: remove redundant CAN data conversion (#33488)
* remove redundant CAN data conversion

* 1 less %

* rename

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2024-09-06 13:51:19 -07:00
Shane Smiskol
e80c27ffdf liveTracks: don't check carState for valid CAN (#33489)
* no need to check CS.canValid

* update refs
2024-09-06 13:29:20 -07:00
Shane Smiskol
922348f33d card parses radar points (#33443)
* interfaces returns radarinterface

old-commit-hash: 9ad1f096bfca3712320f19b1b49aa9e6ac9b68e4

* bump

old-commit-hash: 20334a8b257c6037e11d02f2ba7b1f02c59f3240

* get RI from opendbc

old-commit-hash: b5f6d0c48c90927926e9dd557130075aeec5edee

* stash so far

old-commit-hash: 5aa2c842eb152316434c17a661df05bb8af61f47

* new liveTracks message (radard expects and needs RadarData)

* this should just work?

* whoops

* fix that

* rm liveTracks from radard pm

* fix proceess replay

* lol fcw diff, something's not right

* actually there's fcw in original route. it's pretty close

* no tracks!

* fix test_leads

* CPU moved across procs

* fix not engageable from onroadEvents

* bump

* fixes

* bump to master

* radard publishes w/ modelV2 now, so it will always be sent. check valid which radard sets using liveTracks avg freq

* fix that (it works!)

* combine

join

* bump

* bump

* deprecate

* why

* fix incorrect args

* remove cumLagMs from process_replay

* update refs
2024-09-05 22:40:17 -07:00
Shane Smiskol
d0f0632f78 interfaces returns RadarInterfaces (#33444)
* interfaces returns radarinterface

* bump

* bump

* bump
old-commit-hash: f94ef10df7a663c2b873b2cdf2e0263714447fa3
2024-09-03 19:17:25 -07:00
commaci-public
1e92af9b3c [bot] Update Python packages (#33436)
* Update Python packages

* bump

* specify any list of sources

ooh this is pretty nice

* update

* y

* fix

* fix that

* bump

---------

Co-authored-by: Vehicle Researcher <user@comma.ai>
Co-authored-by: Shane Smiskol <shane@smiskol.com>
old-commit-hash: 239cc69a20b7d3c2f285bd1907cecad9c9604d50
2024-09-03 18:57:28 -07:00
Shane Smiskol
9da055853f LogReader clean ups (#33446)
* buggin me

* no caps

* remove at least one level of indirection

* no recursion, remove a bunch of junk

* default is now allfault ??

* back

* fix tests
old-commit-hash: 5796bf12b6dac4f3fc8e55ecd9785c73044d8a08
2024-09-03 18:34:18 -07:00
Adeeb Shihadeh
53288d4dbf Move vCruise to card (#33439)
* Move vCruise to card

* cleanup drive_helpers

* works in sim

* update refs

* update that

* too slow :(
old-commit-hash: 2f3256ed8baa3d7a5c4d1befe9148dbfecb37246
2024-09-02 17:18:43 -07:00
Adeeb Shihadeh
7575c707f1 carEvent -> onroadEvent (#33432)
old-commit-hash: c481f11833d748a0d12d2ba14003e931d2849135
2024-09-01 11:31:39 -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
2ea4a8f48e car helpers file (#33379)
* helpers file

* clean up
old-commit-hash: 6d392a2e7b
2024-08-26 11:52:41 -07:00
Shane Smiskol
093fac6f5a move some car interface tests into opendbc (#33352)
* bump

* this is in opendbc

* so is radar interface

* clean up

* bump

* can import from opendbc

* bump
old-commit-hash: 7af3c6dfee
2024-08-21 00:30:06 -07:00
Shane Smiskol
8d4770a65a move test_lateral_limits.py to opendbc
old-commit-hash: fe51a2fc62
2024-08-20 15:42:25 -07:00
Shane Smiskol
89725e7ac2 card: fix memory leak from nested function scoping (#33328)
* stash

* no other leaks! pm.send grows memory usage by ~20mb but that's it

* undo

* clean up
old-commit-hash: ee9977df2f
2024-08-19 14:27:50 -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
93b11c816e car: move conversions.py into common/
old-commit-hash: 1eda5f4736
2024-08-16 15:53:37 -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
Shane Smiskol
6fc97576d6 test_fw_fingerprint.py: fix RAM HD test
old-commit-hash: e6b2996478
2024-08-16 01:00:26 -07:00
Shane Smiskol
e19db6a5eb ecu_addrs.py: fix function argument typing
old-commit-hash: a255b8043a
2024-08-16 00:58:53 -07:00
Shane Smiskol
8dbf878f76 card: fix return signature for update_events
old-commit-hash: c9f9eba614
2024-08-16 00:56:31 -07:00
Shane Smiskol
b700f3db77 hyundai: test some feature detection (#33315)
test some feature detection
old-commit-hash: 207c77ea93
2024-08-16 00:30:11 -07:00
Shane Smiskol
b65b1bf908 hyundai: declare type override of cruise_buttons
old-commit-hash: bce11e393f
2024-08-16 00:26:40 -07:00
Shane Smiskol
5cea99cb2d toyota: pycapnp enum which should be called
old-commit-hash: f6780fca2f
2024-08-16 00:18:37 -07:00
Shane Smiskol
4490156cb1 GM: remove basedir import (#33312)
* remove these exceptions

* whoop

* ahhh
old-commit-hash: d43bf89978
2024-08-14 22:55:17 -07:00
Shane Smiskol
9b0adebec8 docs: remove common import (#33310)
* add opcar

* fix references

* actually better to split this so opendbc will test docs conventions, and openpilot will test diffing

* not exe

* clean up
old-commit-hash: 424b657376
2024-08-14 20:29:14 -07:00
Shane Smiskol
9e5fe1e5c0 body: remove controls import (#33309)
* body uses car's PIDController

* use a simple version
old-commit-hash: 9d0180ca97
2024-08-14 20:27:53 -07:00
Shane Smiskol
51ea9f5799 move live fingerprint debugging code to debug/car (#33308)
* remove cereal from fw_versions

* fix it

* do ecu_addrs and vin

* do last one

* move executable-ness

* notexe

* nice test
old-commit-hash: 2ed567b0f5
2024-08-14 19:24:24 -07:00
Shane Smiskol
915524d408 Copy kalman filter to selfdrive/car (#33307)
move to car/common/ and give proper names
old-commit-hash: bcfb50d98c
2024-08-14 18:10:11 -07:00
Shane Smiskol
f8ef09fcb2 rm tesla (#33300)
* rm tesla

* more rm

* ugh we should remove dynamic imports soon
old-commit-hash: b9dec5e3b5
2024-08-14 15:06:00 -07:00
Shane Smiskol
35a99d7fc6 Common CI._update function (#33289)
* use CP

* no car control, consistent _update function signatures

* eh it's fine to name it whatever

* clean up

* oops

* !!

* now we can delete this!

* nobody does anymore
old-commit-hash: 7248b00086
2024-08-13 22:59:25 -07:00
Shane Smiskol
fae517416e card: set mock carState fields (#33294)
* mock carstate inside card

* not used
old-commit-hash: cb61d0045c
2024-08-13 22:48:55 -07:00
Shane Smiskol
9cf575657e Move buttonEvents to CarState (#33292)
* move mazda button events to carstate

* do  more

* remove

* some more

* clean up
old-commit-hash: 9f14c447db
2024-08-13 22:30:46 -07:00
Shane Smiskol
d26b49a409 Consistent spacing in car interfaces (#33293)
* formatting

* fix these

* not these
old-commit-hash: 29882b4519
2024-08-13 22:08:48 -07:00
Shane Smiskol
6ab415bc59 fix static analysis
old-commit-hash: d65e1d9500
2024-08-13 21:28:06 -07:00