Commit Graph

414 Commits

Author SHA1 Message Date
Shane Smiskol efd1ff1452 Longitudinal planner: make v_desired a FirstOrderFilter (#23341)
* make v_desired a FirstOrderFilter

* forgot one

* one more ref

* Add a new object for the filter

* fix

* fix tests

* update ref

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: 9f88ba188a19cd90e8fee48353668dda7b47b2ba
2022-01-04 12:17:33 +01:00
Dean Lee a55046c949 longcontrol/update: optimize capnp (#23382)
old-commit-hash: 5dc631fa1bf471264fceab67edfe4c3962ac9831
2022-01-04 11:32:54 +01:00
Dean Lee 3723b3a877 lane_planner.py/parse_model: follow capnp best practices (#23368)
old-commit-hash: f2520b6e80125a108108b7acef1a10ab55b51284
2022-01-03 15:08:24 -08:00
Dean Lee 5fbbb129a6 lateral_planner.py/publish: follow capnp best practices (#23359)
old-commit-hash: 2ca0925da7fd94a5f12a4ebe14a394a09703a212
2022-01-02 11:55:24 -08:00
George Hotz 86a39e838b Add More Types for mypy (#23268)
* mypy passes

* a few more

* a few in manager

* more types, will lint

* more

* simple types

* events type

* Update selfdrive/thermald/thermald.py

* Apply suggestions from code review

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: dc96d4bee7b898172a6a15de4799af0e2d35605e
2021-12-28 18:07:00 +01:00
Shane Smiskol d5bf8e0e65 LongitudinalMpc: minor clean up (#23296)
* correct order

* formatting

* Revert "formatting"

This reverts commit 481c390f400179f5d0d8f9b5a3066cb68e484d0c.

* use np.zeros

* typos and formatting

* typo

* typo
old-commit-hash: 5387806400ff9258e158e0400683a2c9a5e6c043
2021-12-28 12:05:52 +01:00
Ewout ter Hoeven f206ebd054 Pyupgrade 3.6: Update syntax with Python 3.6+ features (#23305)
Updated Python code with Python 3.6+ features:
- utf-8 encoding is now the default (PEP 3120)
- Replace list comprehensions by Generator Expressions (PEP 289)
- Replace yield loop by yield from (PEP 380)
- Remove the (object) subclass when defining a class
- Replace the IOError alias by OSError (PEP 3151)
- Define sets with curly braces {} instead of set()
- Remove "r" parameter from open function, which is default

Co-Authored-By: Adeeb Shihadeh <8762862+adeebshihadeh@users.noreply.github.com>
Co-Authored-By: GregorKikelj <96022003+GregorKikelj@users.noreply.github.com>

Co-authored-by: Adeeb Shihadeh <8762862+adeebshihadeh@users.noreply.github.com>
Co-authored-by: GregorKikelj <96022003+GregorKikelj@users.noreply.github.com>
old-commit-hash: 332f568a8241fba9459cb70c76840b9670e6993a
2021-12-24 11:18:39 -08:00
Adeeb Shihadeh 8f09da4407 bump cereal
old-commit-hash: 256c51e16afdf4a8fa7089cc9c318c07b15504a7
2021-12-20 23:04:27 -08:00
Adeeb Shihadeh 55d6972d08 Revert "Mazda: alert when LKAS is disabled (#23273)"
This reverts commit e67713edb1f62957974f20a0f7eceb2fc9efb1f4.

old-commit-hash: c92199ab1a94d2ea565e68e513bf4f9e3e81d489
2021-12-20 23:02:02 -08:00
Jafar Al-Gharaibeh 9b7dd754c4 Mazda: alert when LKAS is disabled (#23273)
* Mazda: alert when LKAS is disabled

Signed-off-by: Jafar Al-Gharaibeh <to.jafar@gmail.com>

* Update selfdrive/controls/lib/events.py

* Update selfdrive/car/mazda/interface.py

* bump cereal

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: f25121b7364a2babef5022e852cf97570bee6da2
2021-12-20 14:58:46 -08:00
George Hotz 6bac4f1c4a build for mac (#23048)
old-commit-hash: 16dd7ce1fe2a2b0537fefd5ad131d1494d0d09ad
2021-12-18 22:00:09 -08:00
HaraldSchafer f64c2974b4 Road Roll Compensation Rebased (#23251)
* first commit

* update refs
old-commit-hash: cf466222f623df5fac325b86b71dc4e181b40d55
2021-12-16 17:34:12 -08: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: 55390d273f36f49da3896e687ac5530f40c1d150
2021-12-16 14:58:17 +01:00
Willem Melching 7b3e330def Log actuators after applying rate limits in CarController (#23230)
* return actuators from carcontroller

* log it

* pass to latcontrol

* chrysler

* gm

* honda

* more brands

* rest of the brands

* gm cleanup

* hyundai cleanup

* update ref

* rename field

* fix subaru

* add types

* more subaru fixes #23240

* consistent whitespace

* bump cereal
old-commit-hash: 4f1eb4278a83a3abebebef67a081961e27594d90
2021-12-16 13:08:20 +01:00
Shane Smiskol 91ff6918e5 Remove minSpeedCan (#22991)
* Remove minCanSpeed

Remove minCanSpeed

* it actually only goes out to 2.5 seconds, this is okay to remove

* test to see if this preserves behavior

add minSpeedCan

* Revert "test to see if this preserves behavior"

This reverts commit 31b11f017f7e9da7654fc8064b5983d4a6cc22e5.

* preserve behavior (don't enter stopping as early)

* vEgoStopping needs to be less than or equal to vEgoStarting to avoid state oscillation
old-commit-hash: 2799ef52928126d4b704a6ad83e25a35d0b56da3
2021-12-14 12:09:32 -08:00
Adeeb Shihadeh 06a9b3448d alerts: escalate soft disable alert near disengagement (#23198)
* alerts: escalate soft disable alert if resulted in disengagement

* show 0.5s before disengagement
old-commit-hash: 8068df0b2a35eb8fcef809f4ce9a6cb7bfc75fdc
2021-12-11 17:07:37 -08:00
Adeeb Shihadeh 700ad9ec50 alerts: handle min duration properly (#23191)
* alerts: handle min duration properly

* add active

* tests

* cleanup test

* update refs
old-commit-hash: 07b971d4735d891cc59f404095812f5d001b3092
2021-12-10 19:20:07 -08:00
Adeeb Shihadeh 853dc0d016 alert text simplification (#23186)
* alert text simplification

* little more

* user triggered

* little more

* less annoying ldw

* Update selfdrive/controls/lib/events.py

* update refs

* revert
old-commit-hash: 4627d201b68b670c4d4c29f3ce7523daf8ddc732
2021-12-10 15:21:37 -08:00
Harald Schafer cf3c8cd301 fix max speed comments
old-commit-hash: 44adea73ce2281cd0d0117c7ef6d1609031be2b9
2021-12-08 17:13:43 -08:00
HaraldSchafer 00749bd3cd XVA long policy: prev_a becomes numpy anyway (#23175)
old-commit-hash: c41a0cae4b6feaf87c6e85bf4ef7a71a17671cff
2021-12-08 16:06:09 -08:00
Harald Schafer 3ee06e92ed Long mpc: fix xva policy for sim
old-commit-hash: 7e20fe7ca2a75110d8918b2d38c37dbc9e56b6de
2021-12-08 15:42:30 -08:00
HaraldSchafer 0dbf0a0106 Cruise speed: up to 90mph max (#23161)
* Cruise speed: up to 90mph max

* update ref
old-commit-hash: d1b003c5d22fa7db9763886b08a2b8294aba5a30
2021-12-07 15:47:57 -08:00
HaraldSchafer b19b5fdb98 long planner: no reset when starting (#23149)
* long planner: no reset when starting

* let go to 2m/s

* update ref
old-commit-hash: 77a99e7d6dc021a69078f21923ad0fa2fae1a278
2021-12-06 23:10:16 -08:00
Harald Schafer 3a6a87ffe0 add a change cost
old-commit-hash: 9afc95474d34925d23f94484a680b117ab0a5b3c
2021-12-06 16:17:11 -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: 0dcdf9c30fdb14e907015cb2b0195238e6121b05
2021-12-03 16:12:30 -08:00
Willem Melching 23ef06428a add desired angle to log (#23115)
* add desired angle to log

* update ref

* bump cereal
old-commit-hash: bbd0f94d9d72e86fec79269b9decd424d0050872
2021-12-03 21:35:34 +01:00
HaraldSchafer c6964152bb Reaction buffer on follow distance (#23112)
* Reaction time buffer

* new ref
old-commit-hash: 5b0e10ea33e89fb1c8132cf9014a3a927e93bd6f
2021-12-02 23:56:02 -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: 46fd5892bf41add3dc15d413bced81693d0f8853
2021-12-02 14:42:13 -08:00
Adeeb Shihadeh 6c2182c026 Newer sounds (#23091)
* new prompt sound

* padding

* prompt distracted

* debug

* fix spelling

* lower min volume

* better volume at low speeds

* revert debug

* revert that

* fix tests

* update refs

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 3b367e68728c29eea057d99f3948d64ed6cbfa92
2021-12-02 00:28:25 -08:00
HaraldSchafer e3f9919b5c Set accel trajectory to a_ego when not engaged (#23100)
* Set accel trajectory to a_ego when not engaged

* update ref
old-commit-hash: 68015f75ed7f60a5901af728d31b6c11b98edbf4
2021-12-01 23:12:11 -08:00
Adeeb Shihadeh dccb8b4010 New sounds (#22652)
* new engage/disengage + amp config

* first family

* cleanup audible alerts

* tici isn't special

* fix up debug cycle alerts

* these were better

* extend range

* use distracted sound

* log scaling

* getting closer

* slightly louder

* prompt

* update tests

* update refs

* fix c2 test

* resolve todo

* adjust tolerance

* revert for now

* should work

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: e679d05d9e98e267047c21c0b6b67fe9d61f8ed6
2021-11-30 19:47:33 -08:00
HaraldSchafer fb1cf5b1bf Longcontrol : pid error should be 0 when plan is followed (#23066)
* v_pid error should be 0 when plan is followed

* update ref
old-commit-hash: 048cc3ac9f86ed2b3b9fe82cb28ec243cc8e7bac
2021-11-29 15:22:02 -08:00
Shane Smiskol 996594fa29 longitudinal: only apply overshoot prevention when braking (#22986)
* only if braking is desired

* use v_target to determine stopping

* more clear?
old-commit-hash: 113988ae31bd32db1576d88d5160be01faa63cb5
2021-11-29 11:29:32 +01:00
Shane Smiskol 1b79236fa0 Clean up planner files (#23031)
* clean up planner files

clean up planner files

* fix plant instance
old-commit-hash: 93fd662adf91eda4a17a0ebedbf9dfba61c09901
2021-11-26 14:57:39 +01:00
Adeeb Shihadeh 2bcaee3678 add offroad alerts for car unrecognized (#22934)
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: Chris McCammon <chrismccammon123@gmail.com>
old-commit-hash: 2a72e2a5140a7b02c3a13f167e91b4238a01eba0
2021-11-17 20:29:00 -08:00
HaraldSchafer 6eb5dce881 Lateral planner: lower max cost (#22960)
* prevent ping pong when tuning is not so great

* update refs
old-commit-hash: 24aadaf1f35d61f26637377bc353539d25989f94
2021-11-17 20:24:10 -08:00
Adeeb Shihadeh 1ffe047666 improve crc camera error (#22943)
old-commit-hash: 5296ca8d73573a59a5198b73770d2a4f20cbc9c2
2021-11-16 22:57:22 -08:00
HaraldSchafer 345d52e957 Add cost to long plan change for smoother lag comp (#22923)
* add plan changing cost

* fix compile

* set weights

* try this cost

* horizon problem

* looks pretty good

* update refs

* update refs

* smoother plan changes
old-commit-hash: b3b45c8d29d0afb741c829fea8145fb47ffa7462
2021-11-16 17:57:55 -08:00
Adeeb Shihadeh 8a66c54064 Revert "add offroad alerts for car unrecognized"
This reverts commit 2ffaadb4d2eaabf6e8d86423fbc25328e81dfff0.

old-commit-hash: d8a5c415cd73b50a3424a28f644466fee263e09c
2021-11-16 13:31:10 -08:00
Adeeb Shihadeh 08bfdb151b add offroad alerts for car unrecognized
old-commit-hash: fb1e8ce086ec5e2dc7b2150b62fdd99368eb7e66
2021-11-16 13:30:33 -08:00
Adeeb Shihadeh d1eacc4619 alerts: make soft disables an orange alert (#22925)
old-commit-hash: 833399e9418db26df70169d37c2dff90051d89c7
2021-11-16 13:11:32 -08:00
Adeeb Shihadeh 9f84f9ad97 put cruiseMismatch event in logging only mode
old-commit-hash: 33022390138df73199ac626cb7b5ab7fac1a89a6
2021-11-15 21:16:54 -08:00
Adeeb Shihadeh ee15159a3b alert cleanup (#22919)
old-commit-hash: 5265c36de7be6a2519488fa4a46462f13918b1fb
2021-11-15 16:14:31 -08:00
Joost Wooning 9042f18afd cython wrapper for acados (#22784)
* cython wrapper for acados

* fix building

* sconscript cleanup

* no cython numpy

* cleanup

* upgrade build script

* try without slices

* new acados commit

* c3 update acados libs

* c2 libs

* make faster

* undo profiling

* fix build

* somewhat faster

* tryout cost_set_slice

* Revert "tryout cost_set_slice"

This reverts commit d358d93a133270e4edab9e7c07ffb6f577c52bd6.

* cleanup

* undo t_renderer change

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 89d0a52d16872c403c69426ab32e5788a41ee2ec
2021-11-12 17:09:08 +01:00
Adeeb Shihadeh 29f6b5cb98 allow update snoozing (#22876)
* allow update snoozing

* not immediately visible

* dismiss and close

* grey button
old-commit-hash: e528e2e3e2760c52266b126a803a0f7bb872cf3d
2021-11-11 15:32:25 -08:00
Adeeb Shihadeh 731d85c522 alerts: use repeating warning2 sound for steerSaturated (#22874)
old-commit-hash: 308219c5b1850da4e947ea587e131df29024a402
2021-11-11 11:55:34 -08:00
sshane 9c994173ed Longcontrol: do not clip vEgo to minSpeedCan (#22832)
* fix tss2 slow reacceleration in sng

(should) preserve stopping behavior

add comments since it's confusing

fix

* Revert "fix tss2 slow reacceleration in sng"

This reverts commit 42abde0eb945d8bc5ad9b502d1d89b3e3dc16f8a.

* don't max(vEgo)

* update ref

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: bdaea086f8bd5ea079c4ea98abc5a3d48ca08401
2021-11-11 13:24:38 +01:00
Adeeb Shihadeh a142638899 increase engagement alerts duration
old-commit-hash: 327464fb845dd01533f390ac89d9fd78fbfb02d7
2021-11-10 22:11:14 -08:00
Adeeb Shihadeh d6c42f11f4 controlsd: alert on cruise mismatch for >1s (#22841)
* controlsd: alert on cruise mismatch for >1s

* bump cereal

* update refs

* bump allowed soundd cpu

* bump cereal
old-commit-hash: 035bc0c20fd27490cc353a33f3c373201288a10a
2021-11-10 13:01:42 -08:00
Adeeb Shihadeh 448d5f9e93 alerts: use a single duration for sound, text, and HUD (#22856)
* alerts: use a single duration for sound, text, and HUD

* little cleanup

* update refs
old-commit-hash: c5d6b85c9014386b8d1cb2a17f8767abef3afd57
2021-11-10 11:54:12 -08:00