Commit Graph

107 Commits

Author SHA1 Message Date
Justin Newberry
ba3067a560 Revert "Pytest: run tests in random order" (#30469)
Revert "Pytest: run tests in random order (#30134)"

This reverts commit a5d99e0ebb.
2023-11-15 10:41:11 -08:00
Justin Newberry
a5d99e0ebb Pytest: run tests in random order (#30134)
* enable random order

* logprint info

* revert that

* better logging

* go to dfu

* try to flash every panda if not up to date

* revert panda debugging
2023-11-15 10:16:51 -08:00
Justin Newberry
2dd13c60cc Revert "run unit tests in a random order (#29799)" (#30116)
This reverts commit b483efe764.
2023-09-30 17:23:38 -07:00
Adeeb Shihadeh
b483efe764 run unit tests in a random order (#29799)
* run unit tests in a random order by default

* bump panda

* fix startup

* re-add random order plugin

---------

Co-authored-by: Justin Newberry <justin@comma.ai>
2023-09-30 15:56:23 -07:00
Justin Newberry
110cfef1c2 Ruff: disallow non-openpilot imports (#29841) 2023-09-08 10:43:02 -07:00
Justin Newberry
dde225221e CI: run unittests in parallel with xdist (#29756)
* parallel tests

* review suggesions

* add to pyproject

* add a bit more buffer on that

* fix rare athena issue

* remove from pypoetry
2023-09-07 16:29:36 -07:00
Justin Newberry
4e69937d0d Precommit: ensure executable bit is set (#29784)
* precommit ensure executable

* exclude tinygrad

* bump submodules

* exclude tinygrad globally
2023-09-05 16:33:26 -07:00
Justin Newberry
4aff2621d3 Tests: parameterize following distance test (#29734)
* split

* parameterize it
2023-08-31 13:41:02 -07:00
Kacper Rączy
97865d751f radard: radar fault test (#29673)
* Radar fault test

* Remove i

* Add radar fault case for car interfaces

* Removed empty whitespace

* Fix typo
2023-08-28 22:34:47 -07:00
Justin Newberry
1ee6ed4b16 Linter: remove pylint (#29611)
remove pylint
2023-08-24 16:30:54 -07:00
Adeeb Shihadeh
a9626f95b6 add openpilot prefix to imports (#29498)
* add openpilot prefix to imports

* more

* more

* fix docs

* fix linter

* bump submodules

* fix patched tests

* update dynamic imports

* debug

* Revert "debug"

This reverts commit db5e13b9911cc74438bee123bc3430da6c31b24b.

* fix pm test
2023-08-20 20:49:55 -07:00
Adeeb Shihadeh
00a11a1a2b remove fastcluster (#29352)
* remove fastcluster

* lock

* rm there

* and from release files
2023-08-11 21:08:49 -07:00
Harald Schäfer
ae3681f2bb Test and fix cruise speed all personalities (#28658)
* Fix cruise speed in non-standard mode

* Test all personalities

* Test only critical speeds

* 35ms max
2023-06-23 17:14:41 -07:00
Dean Lee
2b800cf2e7 ui: multilang offroad alerts (#28512)
Co-authored-by: Shane Smiskol <shane@smiskol.com>
Co-authored-by: Cameron Clough <cameronjclough@gmail.com>
2023-06-22 15:04:28 +01:00
Adeeb Shihadeh
111b4eee30 fix a bunch of python warnings (#28576)
* fix a bunch of python warnings

* fix that
2023-06-16 13:22:30 -07:00
Kacper Rączy
e6ac6320ac process_replay: universal replay mechanism using cereal fake sockets (#28115)
* replay_process_with_fake_sockets implementation

* add missing polled_pubs to configs

* drained_pubs field

* updated cereal

* Remove python/native variations of process replay. Replace with universal one using cereal fake sockets

* Replace old py FakeSocket with DummySocket

* Invalidate and deregister fake sockets after replay is done

* Remove unused import

* Set up new prefix for each replay

* Fixes for radard

* Refactor ReplayContext and ProcessConfig

* Minor fixes

* Reimplement controlsd fingerprinting callback

* time.sleep for sockets to safely reconnect

* Fix fingerprinting for controlsd

* Fixes for regen to work

* Fix replay loop to respect submaster frames

* Fix profiler to use new ProcessConfig fields

* Remove tqdm

* Refactor tests to use new ProcessConfig

* Add FrequencyBasedRcvCallback

* Make tolerance None by default

* Update cereal

* Add get_process_config utility func

* Update cereal. Simplify sync procedure

* Chain context managers

* New sub-socket reconnection procedure

* Fix linter issues

* Revert chaining of context managers

* Init controlsState only when replaying controlsd. Update cereal

* Update cereal

* Update process_replay to use new cereal API

* Update cereal

* Update cereal

* Update cereal

* Simplify radard recv callback

* Update release/files_common
2023-05-23 17:24:16 -07:00
Shane Smiskol
42449b482d boardd: ability to switch between ELM safety params (#27656)
* indecisive

* rename to generic FW query

* remove code and update comment

* we need this to start off, unless we set multiplexing immediately

* draft

* draft 2

* try that

* can't do this either, boardd might read Enabled after removing, but before setting new Request param

* this should work

* use one less param

* fix params

* match behavior (set all pandas to safety param of 1, disabling multiplexing for fingerprinting

* clean up (some tests may temp break)

* fix param name and sort

* time it

* yes it does matter

* add to hyundai's bus 5 query

* remove hyundai for now

* this should work

* clean up

* clean up

* flip argument around, clean up

* fix test_startup

* some clean up

* rm line

* comment makes more sense

* required typing

* clean up common type

* comments

* Update selfdrive/car/car_helpers.py

* line

* whoops, need to set before vin!

* fix debug

* annoying

* more debugging

* bug fix (needs both keys always)

* debuGG

debuGG

* Revert "debuGG"

This reverts commit 55b2f429324c0b92d5cfb2cabf8b20db1e166248.

* Revert "more debugging"

This reverts commit 02934c3403ad5270f03093508b704c151d1ccb2a.

* Revert "annoying"

This reverts commit 8b4e5e09989f9a0217e3ec1c0ba68735929b7366.

* clean that up

* bumpback

* bumpback

* every second write param

* flip

* stuff

* move up?

* fix timing out in CI

* rm
2023-03-23 00:14:31 -07:00
Harald Schäfer
04fe6c4ec7 Expand lateral MPC to 10s (#27343)
* 10s lat

* Full length MPC

* redfine N

* Leave controls the same for now

* Updates

* use long plan in lat plan

* interp plan

* add new interp

* simplergit add selfdrive/controls/plannerd.py selfdrive/controls/

* expand to 10s

* revert this

* fix linter

* Update sconscripts

* fix test

* fix test

* fix test

* Revert "Update sconscripts"

This reverts commit 6e23c69dcebd5ed003e37e01921f6af7c31de0db.

* Dont import drive helpers

* better compile deps

* fix compile

* comment

* update replay

* Update plannerd time
2023-02-17 15:28:26 -08:00
Shane Smiskol
c4b84783a0 Honda Bosch: gather available ECUs from camera (#27180)
* add flag

* actually use in fw_versions.py

* simpler

* not here

* Comment

* better name

* add param and block

* keys

keys

* block

* with a value

with a value

* add query for bosch PT bus

* different name

* fix

* .

* fix test

fix test

* add cloulogs

* mark as logging
2023-02-14 17:55:41 -08:00
Adeeb Shihadeh
5ab2d35f7b controlsd: higher default set speed in experimental mode (#27279)
* controlsd: higher default set speed in experimental mode

* update tests

* update tests
2023-02-09 19:27:51 -08:00
Shane Smiskol
b00bc4f57e Car interface: require fingerprint and FW versions to get params (#26932)
* require fingerprint and FW versions

* add get_non_essential_params()

* comment

* all required

* classmethod, need to allow subclasses to override _get_params

* fix that

* fix

* fix

* wrong fix 🤦
2023-01-12 12:25:24 -08:00
Adeeb Shihadeh
f14deae475 Revert "Car interface: require fingerprint and FW versions to get params (#26766)"
This reverts commit b68dabb689.
2023-01-12 11:28:04 -08:00
Shane Smiskol
b68dabb689 Car interface: require fingerprint and FW versions to get params (#26766)
* require fingerprint and FW versions

* add get_non_essential_params()

* comment

* all required

* classmethod, need to allow subclasses to override _get_params

* fix that

* fix
2023-01-11 23:44:50 -08:00
Adeeb Shihadeh
cd8e03d53e move all third party stuff into third_party/ (#26853)
* mv fastcluster

* move msm_kgsl.h

* camerad include

* update path

* mv pyextra

* fix tici build

* add acados_template to release build

Co-authored-by: Comma Device <device@comma.ai>
2022-12-31 21:00:50 -08:00
Shane Smiskol
9ea72b6550 Longitudinal tests: clean up (#26708)
* refactor test_cruise_speed.py

* clean up long tests

* and here
2022-12-05 17:34:57 -08:00
Shane Smiskol
8ad8d4e1c2 controls: preEnabled doesn't consider noEntry (#26627)
preEnabled doesn't consider noEntry
2022-11-29 13:11:03 -08:00
Shane Smiskol
23a7a987f6 controlsd: add test around cruise speed gas pressed behavior (#26486)
* test

* test

* debug

* test

* test

* test

* clean up

* clean up

* add test

* stash

* clean up

* clean up

* clean up

* assert equal
2022-11-21 17:05:13 -08:00
Shane Smiskol
e46063086f controlsd: no speed increment if enabled on button rising edge (#26490)
* don't increment speed if we enabled on rising edge

* more realistic test
2022-11-13 16:34:26 -08:00
Shane Smiskol
3524cc7f0b cruise speed tests: match controlsd initialization of cruise speed (#26491)
* helper functions and fix resetting/enabling

* comment (resume not yet tested)

* make it clear how this resets

* this is fine to enable once

* same here
2022-11-13 16:15:17 -08:00
Shane Smiskol
a638afb98e controlsd: add tests around cruise speed (#26478)
* start to add some tests

* test !pcmCruise

* test !pcmCruise

* better test

* fix pylint

* new test for making sure we adjust on falling edge of buttons
2022-11-11 23:11:49 -08:00
Adeeb Shihadeh
9a3f468051 experimental mode (#26416)
* experimental mode

* rename param

* red lights
2022-11-08 14:45:01 -08:00
Shane Smiskol
7bf70bf7d8 CAN-FD HKG: query FW versions from camera (#26063)
* add adas essential ecus

* add adas ecu and query

* add queries

* add name

* after

* presence of adas ecu

* Revert "presence of adas ecu" (POC)

This reverts commit ab88a7e7df32e1c02a175b81848bd4112b2e5c69.

* no whitelist for debugging

* Apply suggestions from code review

* add adas response

* remove adas version

* temp

* read pandaStates

* works in debug script

* only fwdCamera on tucson

* fix pandaStates reading

* fix test_startup

* fix

* simpler

* use existing socket

* pass in number of pandas

* need to create sm using outcome of fingerprinting, which uses sm

fix

* move default argument

* use sock

* always ignore

always ignore

* add canfd fingerprint test

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

* set
2022-10-17 23:04:06 -07:00
HaraldSchafer
2c9b150761 Low speed lateral like before (#26022)
* Add explicit cost on steering wheel movement

* Laxer low speed control

* Laxer low speed control

* Lower min speed now there is a cost

* 3m/s

* Similar to old master

* Add cost

* Crazy high

* Update ref

* comment
2022-10-11 14:53:43 -07:00
HaraldSchafer
cb0b7375b7 Rocket Launcher Model (#25963)
* 1456d261-d232-4654-8885-4d9fde883894/440 6b7d7cec-ead8-40f3-86cc-86d52c9b03fe/300

* compute only 9 tokens: 1456d261-d232-4654-8885-4d9fde883894/440 6b7d7cec-ead8-40f3-86cc-86d52c9b03fe/300

* tinygrad: cleanup gather

* 1456d261-d232-4654-8885-4d9fde883894/440 6b7d7cec-ead8-40f3-86cc-86d52c9b03fe/700

* empty commit for tests

* bump tinygrad

* dont use tinygrad matmul for now

* bump tinygrad

* 1456d261-d232-4654-8885-4d9fde883894/440 e63ab895-2222-4abd-a9a5-af86bb70e260/700

* float16 1456d261-d232-4654-8885-4d9fde883894/440 e63ab895-2222-4abd-a9a5-af86bb70e260/700

* increase steer rate cost

* Revert "increase steer rate cost"

This reverts commit 74ce9ab9be7ef17ecfec931f96851b12f37f2336.

* fork tinygrad

* empty commit for tests

* basics

* Kinda works

* new lat

* new tuning

* Move LATMPCN so scons compiles

* Update long weights

* Add tinygrad optim

* Update model ref

* update weights

* Update ref

* Try

* Error message for field ignore

* update model regf

* ref commit

* Fix onnx test

Co-authored-by: Yassine Yousfi <yyousfi1@binghamton.edu>
2022-10-05 21:43:38 -07:00
Shane Smiskol
992707c172 controls: enter overriding state for steering override (#25617)
* lateral overriding is overriding

* Update test

* remove

* also could do something like this and only have one OVERRIDE ET

* Revert "also could do something like this and only have one OVERRIDE ET"

This reverts commit 5c381641c08961676a56a9718fbdaa84989ac249.

* full names

* bump cereal

* test every event type

* update refs
2022-09-13 23:20:45 -07:00
Cameron Clough
e9c87daef6 rename esp ECU to abs (#25640)
* rename esp ecu to abs

* bump cereal
2022-09-07 14:25:57 -07:00
HaraldSchafer
7899fb79c1 More conservative lead policy in e2e long mode (#25684)
* Add params for lead and danger

* fix long params

* E2e passes simple maneuver tests

* Make tests run with e2e long mode

* Slightly more error allowed in e2e mode

* FCW back and populate long source field

* Fix planner name

* FCW still doesnt work

* Slightly less aggressive

* Doesn't need to simulate from stop
2022-09-06 21:52:34 -07:00
Adeeb Shihadeh
6590fb2b93 pre-commit: add codespell (#25571) 2022-08-30 11:20:55 -07:00
HaraldSchafer
041458f632 Falcon Punch Model: turn cutting improvements (#25413)
* simplified change to mpc dynamics

* add jerk pts

* increase jerk cost

* increase jerk pts multipler to master value

* Add final commit

* 1456d261-d232-4654-8885-4d9fde883894/440 ac1a6744-85b0-4ec6-8ba7-608d0717b8f1/750

* some copies are useful

* update model replay ref

* less frames in model replay onnx cpu

* 1456d261-d232-4654-8885-4d9fde883894/440 264b67f5-3f52-4b58-b11f-58dd8aaf08bf/950

* 1456d261-d232-4654-8885-4d9fde883894/440 236fc556-fba3-4255-8ccf-684b22637160/950

* c9d10c64-bea4-41ec-8ca3-d8c886fda172/440 26d73dd2-862a-44ae-bbdd-32cc4f397ad7/900

* Fix couple tests

* Update ref

* Unused for now

* Add lateral factor comment

* Unused variable

Co-authored-by: nuwandavek <vivekaithal44@gmail.com>
Co-authored-by: Bruce Wayne <yassine@comma.ai>
Co-authored-by: Yassine Yousfi <yyousfi1@binghamton.edu>
Co-authored-by: Bruce Wayne <batman@gpu06.internal>
2022-08-12 00:47:59 -07:00
Shane Smiskol
ea241bf3dc FW fingerprinting: log all FW versions (#25042)
* get_fw_versions returns all fw versions with request's brand

* keep track of everything received

* debug

* need to regen or write a hack in build_fw_dict

* to be safe, still replace old responses within same brands (hyundai responds to two queries, can fix later)

to be safe, still replace old responses within same brands (hyundai responds to two queries, can fix later)

* update test_fw_query_on_routes

* clean up

* better name

* slightly cleaner

* fix test_startup unit test

del

* fix imports

* fix test_fw_fingerprint

fix test_fw_fingerprint

fix

* fingerprint on all FW_VERSIONS, not just brands with requests

* support old routes in test_fw_query_on_routes

* regen and update refs

* similar function style to before

* better comment

* space

switch name

* try to exact match first

* useless else

* fix debug script

* simpler dictionary

* bump cereal to master
2022-07-06 19:42:58 -07:00
Willem Melching
88f246b909 ui: change alerts to Inter (#24937)
* ui: change alerts to Inter

* fix up test
2022-06-22 11:45:38 +02:00
Adeeb Shihadeh
b1858df00e improved alert verbosity (#24434)
* improved alert verbosity

* better testing script

* better description

* speed diff

* touch ups

* fix that
2022-05-16 21:19:38 -07:00
Willem Melching
31af13101b Add unittest for alert callbacks (#24551)
add alert callback test
2022-05-16 16:25:52 +02:00
Shane Smiskol
d7a708d6da tests: add overriding to state machine test (#24131)
* add overriding to state machine test

* overriding should consider soft disable too
2022-04-05 11:36:18 -07:00
Shane Smiskol
d4f330447a controlsd: add state machine tests (#24107)
* Handle NO_ENTRY in PRE_ENABLED

* add test

* add preEnabled NO_ENTRY test

* stash

* test soft disable

* tuples

* remove overriding until it's merged in

* use Events class

* fix tests and split out

* don't rely on controlsd's counter
2022-04-04 17:13:29 -07:00
Jonathan Frey
d09dffb7cd Cython acados and minor (#23835)
* acados_ocp_solver_pyx.pyx: implement get_stats for timings and ints

* long_mpc: use acados timers

* acados_ocp_solver_pyx.pyx: fix dynamics_get

* acados_ocp_solver_pyx.pyx: get statistics

* use acados_ocp_solver_pyx.pyx from commaai/cython2 branch

* acados_ocp_solver_pyx.pyx: implement store_iterate

* acados_ocp_solver_pyx.pyx: implement get_residuals

* acados_ocp_solver_pyx.pyx: fix set() for empty fields

* acados_ocp_solver_pyx.pyx: load_iterate

* cython acados: add print_statistics

* test_following_distance: fix typo

* test_longitudinal: unique names for test maneuvers

* longitudinal MPC: comments for evaluation

* longitudinal MPC: add comments to eval acados residuals

* long_mpc: use qp_solver_cond_N = 1

* long MPC: comments, simplify set_cur_state

* update acados version in build script

* longitudinal mpc: weigh a_change in 1 place only

* update ref

* Update ref

Co-authored-by: Harald Schafer <harald.the.engineer@gmail.com>
2022-02-25 14:16:44 -08:00
Adeeb Shihadeh
3e9cb7fa12 remove community features toggle (#23214)
* remove community features toggle

* bump cereal

* little more

* update refs
2022-01-24 14:49:47 -08:00
Jonathan Frey
0681474840 work on acados lateral MPC (#23558)
* lat_mpc: make v_ego, rotation_radius parameters instead of states

* lat_mpc: remove rotation_radius argument, since it is part of the parameters

* lat_mpc: use qp_solver_cond_N = 1

slightly faster and in line with case study in Fig. 2/ 3 in Frison2016 - https://cdn.syscop.de/publications/Frison2016.pdf
An Efficient Implementation of Partial Condensing for Nonlinear Model Predictive Control

* adapt test_lateral_mpc to formulation with parameters

* lat_mpc: set parameters in reset() and copy values

* acados_ocp_solver_pyx: make options_set useable

* update ref

Co-authored-by: Willem Melching <willem.melching@gmail.com>
2022-01-18 09:49:48 -08:00
Dean Lee
a653461dec check in tuple instead of list (#23477)
* check in tuple instead of list

* Update selfdrive/car/toyota/carcontroller.py

Co-authored-by: Willem Melching <willem.melching@gmail.com>

* Update selfdrive/car/mazda/interface.py

Co-authored-by: Willem Melching <willem.melching@gmail.com>

Co-authored-by: Willem Melching <willem.melching@gmail.com>
2022-01-10 16:36:51 +01:00
Ewout ter Hoeven
55390d273f Convert format strings strings to f-strings (#23241)
* Convert all text strings to f-strings

Reformats all the text from the old "%-formatted" and .format(...) format to the newer f-string format, as defined in PEP 498. This requires Python 3.6+.

Flynt 0.69 was used to reformat the strings. 120 f-strings were created in 51 files.

F-strings are in general more readable, concise and performant. See also: https://www.python.org/dev/peps/pep-0498/#rationale

* revert pyextra changes

* revert ublox.py

Co-authored-by: Willem Melching <willem.melching@gmail.com>
2021-12-16 14:58:17 +01:00