Commit Graph

113 Commits

Author SHA1 Message Date
Justin Newberry
759ab03b03 Ruff: disallow non-openpilot imports (#29841)
old-commit-hash: 110cfef1c2
2023-09-08 10:43:02 -07:00
Justin Newberry
37e4b2cba9 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
old-commit-hash: dde225221e
2023-09-07 16:29:36 -07:00
Justin Newberry
3b91610c0b Precommit: ensure executable bit is set (#29784)
* precommit ensure executable

* exclude tinygrad

* bump submodules

* exclude tinygrad globally
old-commit-hash: 4e69937d0d
2023-09-05 16:33:26 -07:00
Justin Newberry
42966979db Tests: parameterize following distance test (#29734)
* split

* parameterize it
old-commit-hash: 4aff2621d3
2023-08-31 13:41:02 -07:00
Kacper Rączy
dfe6c4729e radard: radar fault test (#29673)
* Radar fault test

* Remove i

* Add radar fault case for car interfaces

* Removed empty whitespace

* Fix typo
old-commit-hash: 97865d751f
2023-08-28 22:34:47 -07:00
Justin Newberry
c4f322ce2d Linter: remove pylint (#29611)
remove pylint
old-commit-hash: 1ee6ed4b16
2023-08-24 16:30:54 -07:00
Adeeb Shihadeh
16ec56398c 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
old-commit-hash: a9626f95b6
2023-08-20 20:49:55 -07:00
Adeeb Shihadeh
cf1d402531 remove fastcluster (#29352)
* remove fastcluster

* lock

* rm there

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

* Test all personalities

* Test only critical speeds

* 35ms max
old-commit-hash: ae3681f2bb
2023-06-23 17:14:41 -07:00
Dean Lee
1b3ba1c7ee ui: multilang offroad alerts (#28512)
Co-authored-by: Shane Smiskol <shane@smiskol.com>
Co-authored-by: Cameron Clough <cameronjclough@gmail.com>

old-commit-hash: 2b800cf2e7
2023-06-22 15:04:28 +01:00
Adeeb Shihadeh
ee363d69e3 fix a bunch of python warnings (#28576)
* fix a bunch of python warnings

* fix that
old-commit-hash: 111b4eee30
2023-06-16 13:22:30 -07:00
Kacper Rączy
a48b67f720 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
old-commit-hash: e6ac6320ac
2023-05-23 17:24:16 -07:00
Shane Smiskol
cdcf06e9e2 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
old-commit-hash: 42449b482d
2023-03-23 00:14:31 -07:00
Harald Schäfer
73561f01e0 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
old-commit-hash: 04fe6c4ec7
2023-02-17 15:28:26 -08:00
Shane Smiskol
cc456ad691 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
old-commit-hash: c4b84783a0
2023-02-14 17:55:41 -08:00
Adeeb Shihadeh
bc61a6b1fd controlsd: higher default set speed in experimental mode (#27279)
* controlsd: higher default set speed in experimental mode

* update tests

* update tests
old-commit-hash: 5ab2d35f7b
2023-02-09 19:27:51 -08:00
Shane Smiskol
0ceb423ccc 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 🤦
old-commit-hash: b00bc4f57e
2023-01-12 12:25:24 -08:00
Adeeb Shihadeh
b67646e1ab Revert "Car interface: require fingerprint and FW versions to get params (#26766)"
This reverts commit ff80ac0f7525916211da2cd0fce2c9c5f35ef89d.

old-commit-hash: f14deae475
2023-01-12 11:28:04 -08:00
Shane Smiskol
28ceb52c33 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
old-commit-hash: b68dabb689
2023-01-11 23:44:50 -08:00
Adeeb Shihadeh
b3e47c691b 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>
old-commit-hash: cd8e03d53e
2022-12-31 21:00:50 -08:00
Shane Smiskol
7a2dc6eca5 Longitudinal tests: clean up (#26708)
* refactor test_cruise_speed.py

* clean up long tests

* and here
old-commit-hash: 9ea72b6550
2022-12-05 17:34:57 -08:00
Shane Smiskol
76e7a45284 controls: preEnabled doesn't consider noEntry (#26627)
preEnabled doesn't consider noEntry
old-commit-hash: 8ad8d4e1c2
2022-11-29 13:11:03 -08:00
Shane Smiskol
b94dfd81c6 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
old-commit-hash: 23a7a987f6
2022-11-21 17:05:13 -08:00
Shane Smiskol
a0539910bf controlsd: no speed increment if enabled on button rising edge (#26490)
* don't increment speed if we enabled on rising edge

* more realistic test
old-commit-hash: e46063086f
2022-11-13 16:34:26 -08:00
Shane Smiskol
210e281cd4 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
old-commit-hash: 3524cc7f0b
2022-11-13 16:15:17 -08:00
Shane Smiskol
415152ade9 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
old-commit-hash: a638afb98e
2022-11-11 23:11:49 -08:00
Adeeb Shihadeh
74979a7c76 experimental mode (#26416)
* experimental mode

* rename param

* red lights
old-commit-hash: 9a3f468051
2022-11-08 14:45:01 -08:00
Shane Smiskol
6695cbf258 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
old-commit-hash: 7bf70bf7d8
2022-10-17 23:04:06 -07:00
HaraldSchafer
f9b65f9189 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
old-commit-hash: 2c9b150761
2022-10-11 14:53:43 -07:00
HaraldSchafer
a8ec6f4cfd 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>
old-commit-hash: cb0b7375b7
2022-10-05 21:43:38 -07:00
Shane Smiskol
c1b9a202aa 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
old-commit-hash: 992707c172
2022-09-13 23:20:45 -07:00
Cameron Clough
2347e913a0 rename esp ECU to abs (#25640)
* rename esp ecu to abs

* bump cereal
old-commit-hash: e9c87daef6
2022-09-07 14:25:57 -07:00
HaraldSchafer
0b87a4ddb1 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
old-commit-hash: 7899fb79c1
2022-09-06 21:52:34 -07:00
Adeeb Shihadeh
35ff65121e pre-commit: add codespell (#25571)
old-commit-hash: 6590fb2b93
2022-08-30 11:20:55 -07:00
HaraldSchafer
48522500ea 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>
old-commit-hash: 041458f632
2022-08-12 00:47:59 -07:00
Shane Smiskol
4eabd3b9d9 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
old-commit-hash: ea241bf3dc
2022-07-06 19:42:58 -07:00
Willem Melching
f22b124acf ui: change alerts to Inter (#24937)
* ui: change alerts to Inter

* fix up test
old-commit-hash: 88f246b909
2022-06-22 11:45:38 +02:00
Adeeb Shihadeh
cfc16a88c5 improved alert verbosity (#24434)
* improved alert verbosity

* better testing script

* better description

* speed diff

* touch ups

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

* overriding should consider soft disable too
old-commit-hash: d7a708d6da
2022-04-05 11:36:18 -07:00
Shane Smiskol
8e11fbe2db 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
old-commit-hash: d4f330447a
2022-04-04 17:13:29 -07:00
Jonathan Frey
baab5d7a7b 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>
old-commit-hash: d09dffb7cd
2022-02-25 14:16:44 -08:00
Adeeb Shihadeh
70f1418256 remove community features toggle (#23214)
* remove community features toggle

* bump cereal

* little more

* update refs
old-commit-hash: 3e9cb7fa12
2022-01-24 14:49:47 -08:00
Jonathan Frey
6f4c93238f 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>
old-commit-hash: 0681474840
2022-01-18 09:49:48 -08:00
Dean Lee
98de810849 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>
old-commit-hash: a653461dec
2022-01-10 16:36:51 +01:00
Ewout ter Hoeven
a962365292 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>
old-commit-hash: 55390d273f
2021-12-16 14:58:17 +01:00
Adeeb Shihadeh
3d72ed6ea1 alerts: add test for creation delay
old-commit-hash: 45f3662cf0
2021-12-09 14:29:50 -08:00
HaraldSchafer
3afc818433 Long policy: strictly squared stopped equivalence function (#23118)
* new ref

* never let lead stopped equivalence go down

* no overbraking

* stricter again

* cleanup

* updated refs
old-commit-hash: 0dcdf9c30f
2021-12-03 16:12:30 -08:00
HaraldSchafer
08ac1b33ba Human inspired follow distance (#22937)
* Add cost for creep

* more reasonable cost

* seems better than before

* science tune

* more chill

* closer follow

* stopping takes some leeway

* better cruise

* needed to be cumsum all along

* jerk not even needed

* matches better

* 6 is too much

* add back

* a little extra buffer is good for badly tuned cars

* new refs

* refs again
old-commit-hash: 46fd5892bf
2021-12-02 14:42:13 -08:00
Adeeb Shihadeh
85b0e69efd more alert checks
old-commit-hash: 8d917b6702
2021-11-16 22:56:29 -08:00