Commit Graph

218 Commits

Author SHA1 Message Date
Shane Smiskol
328bfefb5a FW query timing test: fix total time ref 2023-07-31 22:18:06 -07:00
Justin Newberry
38954418f0 Subaru: New LKAS Angle based cars in dashcam only (#29190)
* dashcam mode only

* fix name

* added those cars in dashcam mode only
2023-07-31 13:58:33 -07:00
Shane Smiskol
80bbba14f7 test_models: panda safety tx test (#28949)
* draft

* assertrue

* this is way too complicated, even with unittest discover

* works

* test we can send resume button

* nice catches this

* fix

* fixed

* not needed

* draft

* works

* comment out to let catch

* clean up into a function

* clean ups

* final clean up

* no this is final

* bump

* simplify

* simplify

* pass

* bump

* globals don't work inside methods

* space
2023-07-20 23:16:43 -07:00
Shane Smiskol
18cf253c62 test_car_interfaces: use DT_CTRL 2023-07-18 20:01:22 -07:00
Shane Smiskol
c9f80e89b7 test car interface: fuzzy CarParams (#28931)
* bump

* should be bytes

* draft fuzzy car params

* stash

* bump

* bump

* this is explored!

* some clean up

* more clean up

* clean up

* can't easily

* clean up

* no import

* Apply suggestions from code review

* move into a function

* Update selfdrive/car/tests/test_car_interfaces.py

* Update selfdrive/car/tests/test_car_interfaces.py

* Update selfdrive/car/tests/test_car_interfaces.py

* come onn

* we know it will return a dict here
2023-07-18 01:49:01 -07:00
Shane Smiskol
44f7b312a0 test car interfaces: more GM coverage (#28954)
* Update test_car_interfaces.py

* Update selfdrive/car/tests/test_car_interfaces.py

* make it fail

* catches crashed, not blocked
2023-07-18 01:42:51 -07:00
Shane Smiskol
35aaf90587 Nissan FPv2: use default diagnostic session (#28634)
* Revert "Nissan FPv2: log different diagnostic session types (#28585)"

This reverts commit 2f2b94758b.

* switch to standard KWP2000 diagnostic session type

* we're speedy again
2023-07-17 18:21:18 -07:00
Shane Smiskol
047bb46d3a Ford: fix CAN FD fingerprinting (#28995)
* fix CAN FD fingerprinting for now

* comment

* this is the simplest for now

* revert

* cmt

* todo and fixme!
2023-07-17 16:56:13 -07:00
Cameron Clough
17e71cdf44 Ford: add F-150 2023 support (dashcam only) (#28974) 2023-07-17 16:16:28 +01:00
Shane Smiskol
f495c21805 FuzzyGenerator: typing (#28934)
* bump

* should be bytes

* draft fuzzy car params

* stash

* bump

* bump

* this is explored!

* some clean up

* more clean up

* clean up

* do we need draw??

* draft

* this was confusing

* revert

* draft

* Revert "draft"

This reverts commit c593a03474b04d4df2648d8149798196c991a108.

* draft

* more typing!

* complete typing

* fix that

* cleanup

* better
2023-07-14 21:41:30 -07:00
Shane Smiskol
f6390c6e40 test_models: don't skip test cases with multiple pytest jobs (#28953)
* Update test_models.py

* Update selfdrive/car/tests/test_models.py

* Update selfdrive/car/tests/test_models.py
2023-07-14 16:24:07 -07:00
Shane Smiskol
c9c636bdd7 test_models: fix rx message bus (#28947)
Update test_models.py
2023-07-14 14:04:24 -07:00
Shane Smiskol
af7b2e4dd4 test car interfaces: support pytest (#28937)
sort
2023-07-14 01:48:36 -07:00
Shane Smiskol
4ed9dec6f4 test car interface: fuzzy experimental long (#28936)
fuzzy exp long
2023-07-14 01:25:01 -07:00
Jason Wen
682a240c36 HKG: Add FW Versions for China Kia Carnival 2023 (#28918) 2023-07-13 17:51:58 -07:00
Shane Smiskol
bc24783657 Hyundai: add Ioniq 6 platform (#28915) 2023-07-13 12:49:38 +01:00
Jason Wen
f1c604bde7 HKG: Car Port for Kia Carnival 2023 (HDA1) (#27785)
* HKG: Car Port for Kia Carnival (China only) 2023 (HDA1)

* add FW

* seems to be radar SCC

* Update CARS.md

* Update CARS.md

* Add test route

* Fix docs

* New route

* Fix docs formatting

* update with US model

* 2 total

* Update RELEASES.md

* add FW for US carnival 2023

* fix docs

* update test routes

* no rlogs for chinese route

* update docs

* revert chinese to merge now

* Apply suggestions from code review

* fine to fully remove

* less precise

* remove from releases

* Apply suggestions from code review

* Update selfdrive/car/tests/routes.py

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-07-06 00:37:49 -07:00
Maxime Desroches
0ebec253d0 simple fuzzing test for all processes (#28661)
* Revert "Revert "simple fuzzing test for all processes (#28584)""

This reverts commit 7783dc602c.

* determinism

* fingerprint
2023-06-29 21:49:23 -07:00
Shane Smiskol
d59172bc19 Mazda: query and log FW on bus 0 (#28569)
* mazda: query FW on bus 0

* update refs
2023-06-29 00:14:09 -07:00
Shane Smiskol
16203cc856 FwQueryConfig: test request lists (#28741)
* request callbacks

* support in IsoTpParallelQuery

* tiny bit simpler

* shorter lines

* need to check length again, could return empty list

* takes in prev response

* typing

* test

* only test

* simple test

* revert this

* subtest!
2023-06-28 23:50:52 -07:00
Shane Smiskol
3f8c976d99 FPv2: test timing for present ECUs and VIN queries (#28676)
* put one subaddr in parallel_addrs

* p

* remove print

* update test refs

* test

* revert that

* clean up

* clean up

* fix

* print results

* fixup cmt

* move down
2023-06-24 05:47:55 -07:00
Shane Smiskol
ed86a4ae62 FPv2: cleanup FW query timing test (#28677)
* put one subaddr in parallel_addrs

* p

* remove print

* update test refs

* test

* revert that

* clean up

* clean up

* only clean up

* clean up

* rm

* type

* one line

* this is fine
2023-06-24 05:09:11 -07:00
Shane Smiskol
164dd5015e Toyota: add central gateway ECU (#28653)
* add comment about central gateway

* add as ecu

* bump ref

* add to whitelists
2023-06-22 23:30:34 -07:00
Adeeb Shihadeh
7783dc602c Revert "simple fuzzing test for all processes (#28584)"
This reverts commit bac193bdd5.
2023-06-22 14:59:50 -07:00
Shane Smiskol
ae0d1635b4 Toyota FPv2: log telematics ECU (#28613)
* add electronic parking brake ecu

* add

* add to whitelists

* update refs
2023-06-21 00:32:40 -07:00
Shane Smiskol
12be5afb8a Toyota FPv2: log electronic parking brake ECU (#28612)
* add electronic parking brake ecu

* add comment

* bump

* screw sequential subaddrs
2023-06-20 23:53:20 -07:00
Maxime Desroches
bac193bdd5 simple fuzzing test for all processes (#28584)
* working test

* classmethod

* review

* add to ci
2023-06-20 10:57:02 -07:00
Cameron Clough
78bb637993 Ford: remove Focus Mk4 from dashcam only (#28551) 2023-06-17 15:16:59 +01:00
Shane Smiskol
2f2b94758b Nissan FPv2: log different diagnostic session types (#28585)
* standard KWP2000 diagnostic session type

* draft

* clean up

* not needed

* update FP refs

* should log logging
2023-06-17 02:39:58 -07:00
Maxime Desroches
3fc104fb6d test: car interface fuzzy testing + generating capnp structs (#28530)
* random car control

* format

* struct generation

* math

* staying real

* really staying real

* move

* split this

* format

* Revert "format"

This reverts commit a70a73952ee3833c4ae839d7b2729ee2a1e1a85b.

* Revert "split this"

This reverts commit ae96be63cbfbee230101e69a0f84c874f321fafa.

* space
2023-06-15 17:01:13 -07:00
Shane Smiskol
f788edb6a5 HKG: use platform codes to fuzzy fingerprint (#28531)
* get gas/ev/hev from FW (not all correct, poc)

* add test for essential ecus for fuzzy fingerprinting

* kinda works

* stash

* clean up

* add code

* simpler

* use the function

* test it with our cars

* no re

no re

no re

* debugging

* handle empty dict

* simpl

* this is promising

start on making existing fingerprinting functions use the config, instead of entirely replacing them

* needs to allow 1 match

* lay out how this should look

* changes

* executable

* some work

* use config

* fuzzy ecus

* config test

* comment and some clean up

* test platform codes

* use regex, simpler and fixes bug

* in func

* rm bad func

* typing for new func and remove old from dc

* todo done

* tested!

* remove fake platform codes

* thought we needed this, but actually...

* not needed

* not applicable any more

* use config for essential ecus

* first draft of test to make adding/removing fuzzy FP platform intentional

* compile

* clean up test

* even cleaner

* fix default ecus type

* temp fix

* this is mostly in tests now

* test every fuzzy ecu fw returns one platform code

* experiment with dates

* Revert "experiment with dates"

This reverts commit 3251b9cc5c3ca41ca92c8b75ad9b2234b720aa0b.

* clean that up

* comment

* test

* work on all cars

* fix fuzz_fw_fingerprint

* comment

* get first by search

* bit more clean up

* and more

* use compiled pattern for nicer syntax

* default

* flip dat around, much cleaner

* clean up hyundai test a bit

* flip order

same here

* rename test and flip subTest

* fix pylint

* revert fw changes

revert fw changes

* line

* add original functions to test

* needs to be a list

* cmt

* draft (need to count one ecu as a match)

* tiny clean up

* todo: date range

* only in notebook

* remove comment (still can be either list or set)

* same, only notebook

* more consistent signature

* copilot inspired

* copilot no good

* test for date parsing

* better name

* good, now we don't have to worry about the dates mismatching in another test/logic

* comment up+

* some stuff

* clean up

fix test

fix test

* test

* comment

* use utils

* clean up (utils are cleaner and less buggy)

* clean up (utils are cleaner and less buggy)

* fixup test

* use a dash (prettier) and remove some platforms that can fingerprint now!

* compile global pattern

* same as what we do in values

* remove comments

* fuzzy_get_platform_codes is one or none here

* more clean up

* sort imports

* woah woah woah

* add comment

* fix reassigning different types

* add types

* adapt fuzzy test recently added (nice it caught this!)

* update lock

* options

comments

* stash

* comments and fixes

* better comments

* better

* test: run on exact fuzzy matching logic, same results!

* use match_fw_to_car

* test all fw

* ex

* unused random

* this is a possibility

* this is more clear

* fix

* revert

* revert to needing both ECUs to match to reduce false positives, test

* fix excluded platform test :( but it's ok

* add comment

* we actually want to only test fuzzy ecus to make it explicit

* fix mypy

* comment for tomorrow

* just add matches with fuzzy FP

* add comment

* this was the cleanest I could think of, but still working on it. not very easy to understand

* think this is better, but also worse...

* comment: reframing how this works

* revert back to what we did before

* was swapped

* else set

* remove old comment

* fixes from merge

* remove fuzzy_min_match_count from this pr

* fix static analysis

* also unused

* different method first draft

* copy existing fuzzy func

* check all possible ecus exist, only platform codes, slightly refactor main loop

* fix

* Revert recent

Revert "fix"

This reverts commit 5cdb7bda835f1e48e750ab4195e891afe08e11ea.

Revert "check all possible ecus exist, only platform codes, slightly refactor main loop"

This reverts commit d3e918fa20fa4ce881445850f5f7428a3c11adf8.

Revert "copy existing fuzzy func"

This reverts commit 34c8c0545097c84f55f4b4f61907606c93760ddd.

Revert "different method first draft"

This reverts commit b91139055d7d1802c1eb726504798c156a183c9c.

* new func

* fixup test

* remove changes from v1 from fw_versions.py

* clean up a bit

* return part as part of code

* fix test

* add original fuzzy function

* add an ecu match if the date is within range (or date doesn't exist)

* add format for what we're going to do

* not working stash

* the exact matching function does more of what we want with less code and less custom logic

* we don't care about found versions, only codes and dates

* actually we do have an exception

* this works pretty nicely now

* up here

* this is better

* some minor clean up

* old function=now junk

* fix platform code test

* remove old platform code function

* now rename _new to

* use FW_QUERY_CONFIG

* clean up imports

* rename that too

* one line

* correct typing

correct typing

* draft tests

* so that works

* fixup excluded platform test now too

* this is tested by excluded platform test

* test parts and dates

* remove old comment

* old import

* take platform code stuff out of FwQueryConfig

* fix test

* revert debug script

* flip order

* make this a set by default

* revert this part

* correct typing

* clean up comments

* clean that test up too/pylint

* combine these three tests ina clean way

* not right

* more general

* be consistent with quotes

* comment

* comment

* comment in fw_versions

* flip order

* this is more readable

* could test all this, but it's tested in test_hyundai and doesn't do a lot here

* only assert brands which use this

* invalidate all CAN FD ICE and hybrid

* tuple

* can get away without filtering

* add comment reasons

* fix

* some review suggestions

* this works (first draft)

* this is better

* script to print platform codes and dates

* sanity check for dates are in correct ecus and platforms

* mypy

* better variable name and comment

* rename

* same

* slightly better name

* subset

* exclude platforms and live car without dates

* consistent

* self explan

* better name

* test to make sure the functions agree

* clean that up

* comment

* we get other responses from queries not in DB, only check any

* not used or typed
2023-06-15 02:50:45 -07:00
Shane Smiskol
6c619561ee FPv2 timing unit test: halve runs (#28540)
Update test_fw_fingerprint.py
2023-06-13 21:26:31 -07:00
Shane Smiskol
572a221a86 FwQueryConfig: remove platform codes (#28538)
* bring platform codes out of config for now (can re-introduce later)

* clean that up

* flake8

* comment

* comments and better test names

* typo

* Update selfdrive/car/hyundai/tests/test_hyundai.py

* Update selfdrive/car/hyundai/tests/test_hyundai.py
2023-06-13 20:41:03 -07:00
Shane Smiskol
f5e032b67f FwQueryConfig: add platform code support and tests (#28475)
* add config options

* you know what, platform codes don't need to be related to fuzzy fingerprinting at all

* better comment?

* add comment

* add test from other PR

* add platform code function to hyundai

* comment and add eps!

* clean up config test

* fix test

* add error message to test

* until we have multiple ways a brand can set up fuzzy FP, let's leave func name fuzzy-specific

* rename in comment too

* hyundai tests

* simpler test!

* check all ecus with platform codes

* add types-python-dateutil = "^2.8.19.13"

* these aren't used any more

* Update selfdrive/car/hyundai/tests/test_hyundai.py

* not to imply this is active yet
2023-06-09 22:51:55 -07:00
Maxime Desroches
181b44b28e car docs: test print_docs_diff (#28459)
* test print docs

* delete

* remove this

* print
2023-06-09 14:13:22 -07:00
Shane Smiskol
f976fce7d0 FPv2: assert non-empty FW lists (#28441)
* test empty fw lists

* fix

* generic test name

* can rmeove this check now

* and here!

* can remove that

* add to print
2023-06-07 00:05:41 -07:00
Shane Smiskol
9e8936be98 fuzzy fingerprint: track number of matching ECUs, not FW versions (#28423)
* first attempt trying to do it implicitly bad

* back to lists and explicitly do this

* continue checking if candidate switches on these, that's fine to check

* debugging

* clean up

* more clean up

* spot free

* only need to create/update on change

* fix test

* draft

* Revert "draft"

This reverts commit dbe32f58b172eddc8f9699044c6a5956e753305d.

* Revert "fix test"

This reverts commit 1d34269fe2de35d314aa0658fa47a78a08d93e08.

* fix test for real

* first draft of test

* this should be good

* can replace existing fuzzy test

* rm

* matching

* test non-empty fws

* TEST DOWN HERE

* no test

* unique + fix skip message + comment + clean up

* less confusing

* ing

* better
2023-06-07 00:03:01 -07:00
Shane Smiskol
0acc30d264 FPv2: test minimum fuzzy fingerprint ECUs (#28433)
* basic messy test

* draft

* clean up

* clean up

* clean up

* clean up

* never was fuzzy, but be explicit

* switch it up
2023-06-06 21:38:10 -07:00
Shane Smiskol
024abe6455 car docs: document parts of parts (#28292)
* more stuff

* even more

* all parts func

* start to use it

* include self in parts

* use car_parts_new

* not used

* more usages

* remove get_parts

* remove more commented stuff

* remove iter

* clean up some more stuff

* more

more

* ford

* optional

optional

* nissan

* use new classes

* fix tests

* fix

* order

* no more required

* connector

* CARS.md

---------

Co-authored-by: Maxime Desroches <desroches.maxime@gmail.com>
2023-05-31 21:30:50 -07:00
Maxime Desroches
9f5f8b603c car docs: list all needed hardware (#28212)
* generic car parts

* better carparts

* add part type

* more tests

* multiple enums

* unit tests

* just check isinstance

* better name

* remove _connector suffix

* remove those hyundai lines

* remove default arg

* Revert "remove default arg"

This reverts commit 139650a3b6b94358c3b9b12bb5fbe0a326d7abad.

* cleaner code structure

* use fingerprint

* review

* abstrac data class + common

* no more dataclass

* conflict

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-05-22 10:17:33 -07:00
Maxime Desroches
70677fe5fc add harness kit content to the doc (#28139)
* add harness kit content to the doc

* parts as enum

* nissan

* merge column

* rename column

* scaling

* scaling again

* 500px

* align text

* more px

* add style

* more width

* more

* more

* smaller text

* make all text smaller

* prev width

* default list

* remove hidden a ref

* try to remove again

* revert

* replace harness with harness_kit

* try fix

* cleaner

* center everything

* make pylint happy

* allow more than 1 of each parts

* use copy module

* review

* testing spacing

* revert

* bigger text

* formating

* split harness col lines

* remove print

* resolve

* rename to view

* keep formating in template

* simplify

* add unit test

* more generic way

* better

* harness connector only

* comment

* review

* put back harness parts

* missing dash

* too much space

* don't reload when clicking

* shorter comment

* only last line

* generate

---------

Co-authored-by: Cameron Clough <cameronjclough@gmail.com>
Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-05-15 15:33:54 -07:00
Cameron Clough
202751a796 Ford: add Maverick test route (#28181)
* Ford: add Maverick test route

* docs

* bump
2023-05-13 23:38:28 +01:00
JWingate80
758a9d7c24 HKG: Genesis GV80 2023 support (#28069)
* Update values.py

* Update values.py

* Update routes.py

* Update values.py

* Update values.py

* Update interface.py

* Update override.yaml

* Updated car name in torque settings to the correct one

* Removed unused ECU's from GV80

Fix AssertionError: 3 != 0 : GENESIS GV80 2023: Car model has ECUs not in auxiliary request whitelists: Ecu.eps, Ecu.transmission, Ecu.engine

* Update routes.py

Updated to a better route

* Update routes.py

* Update test_models.py

* Update test_models.py

* Hopefully this route will work...

* Update selfdrive/car/hyundai/values.py

* Update selfdrive/car/hyundai/values.py

* this could use some cargo

* don't need to combine just yet

* add to docs and releases

* Update routes.py

* Update RELEASES.md

* Update routes.py

Updated route, hopefully this one works...

* Update selfdrive/car/tests/routes.py

* alphabetical

* update docs

* Update routes.py

Hopefully this route works

* Update routes.py

Trying segment 1 for GV80

* bump

* no need

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
Co-authored-by: Cameron Clough <cameronjclough@gmail.com>
2023-05-06 23:18:06 -07:00
Cameron Clough
a0d2e4e711 Ford: add Escape test route and remove dashcam only (#28113)
* Ford: add Escape Mk4 test route

* generate docs

* remove from non_tested

* fix model years

* clearer packages for EU

* docs

* 2020 hybrid

26b2cace68e36212

1FMCU9DZ9LUA82589

* 2021 phev

1FMCU0LZXMUA80767

f8eaaccd2a90aef8

* add this too

* more docs
2023-05-04 17:21:36 -07:00
Shane Smiskol
177ca52e76 car interfaces: assert some friction (#28074)
* assert some friction

* duh

* convention

* order
2023-05-03 20:22:38 -07:00
Shane Smiskol
5aebdb0ad0 Car docs: pass docs flag to car interfaces (#27311)
* docs

* docs

* docs

* docs

* use docs in gm
2023-04-18 12:22:22 -07:00
Shane Smiskol
158c951d6f FPv2: add worst case timing test (#27917)
* can FP time

* add

* move the ref up

* assert function

* all brands

* Update selfdrive/car/tests/test_fw_fingerprint.py

* can this can vary a bit more

* or can it
2023-04-14 23:41:12 -07:00
Adeeb Shihadeh
08e2149b0f Hyundai: factor out bus numbers (#27903)
* mv bus

* mv that

* if len

* fix tests

* use that

* same name
2023-04-14 11:23:22 -07:00
AlexandreSato
93c1810522 Honda: HR-V 2023 port (#27731)
* initial commit

* HR-V is diff enought to split from Civic22

* Add US HR-V 2023

* update CARS.md

* Update RELEASES.md

* Use a alternative brake signal

* US HR-V have a weird noise in the BrakeSwitch

* Shane tunning

* this is added automatically

* sorry jyoung

* civic22_stop_faster

limit stopAccel to current safety model

* relax calib temporarily (12 deg)

relax calib temporarily (10 deg)

* compute accel (car overshoots requests at low speed)

* revert brake pressed caused controls mismatches

* fix crash

* cause a cruise fault

* Revert "cause a cruise fault"

This reverts commit 09a6469ac6fc38ebd38dd1c5d464712a15d0fde1.

* no brake error

* use alt brake

* Update selfdrive/car/honda/carcontroller.py

* change HONDA_BOSCH_ALT_BRAKE_SIGNAL to CP.flags

* Revert "change HONDA_BOSCH_ALT_BRAKE_SIGNAL to CP.flags"

This reverts commit e0f8123b33db3218f27c4b64a7b2a0b1f740860f.

* remove FPv2 from brazilian HR-V

* bump panda

* fix a bug

* revert calib threshold

* new test route

* separate pr

* update

* update that

* thought i removed this

* revert steer ratio

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-04-14 03:12:10 -07:00
Shane Smiskol
f222d434b8 FPv2: add timing unit test (#27753)
* add timing unit test

* formatting

* not clean

* Revert "not clean"

This reverts commit dab35d582c274efc32d693fc0a2773d8727be2bd.

* Revert "formatting"

This reverts commit 56a1ae4bb721594cc68952e5747a3ebc652f62d9.

* need to consider subaddrs (0.3 to 0.7s for toyota)

* clean up

* move to test_fw_fingerprint

* use a thread to get real time

* lower threshold

* revert that

* ?

* some sleep

* at top

* use the config

* function to measure query time, similar to opendbc's convention

* revert that

* avg

* Update selfdrive/car/tests/test_fw_fingerprint.py

* draft

* starting a thread takes a long time!

* refs

* uncomment
2023-04-14 02:21:52 -07:00