Commit Graph

467 Commits

Author SHA1 Message Date
HaraldSchafer
4814c30667 ACADOS fix non-convergence when long_plan changes (#22495)
* debug commit

* cleanup

* some indexing bugs

* need more its

* BALANCE is way better it seems

* fix test

* this converges in 2000segs

* new ref

* less cpu
old-commit-hash: 04cf12cb0064f42e507fd6ae907564cecf140d28
2021-10-10 00:05:29 -07:00
Robbe Derks
58c99158a1 Make pandaState and safetyMode a list (#22454)
* wip: move to pandaStates

* bump cereal

* wip: SafetyMode struct

* move to safetyMode

* fix typo

* this can be None

* fix potential empty pandaStates list

* fix thermald

* fix controlsd

* rename safetyModes to safetyConfigs

* update process_replay

* fix test_models

* bump cereal
old-commit-hash: 91987f38d425e2a5dc61d09571933cffb9536113
2021-10-08 17:54:34 +02:00
Willem Melching
627c6260cf Fix cruise button mph increment (#22487)
old-commit-hash: 5587964d589761142bd23eef8e08b0134b30ed6e
2021-10-08 11:10:29 +02:00
HaraldSchafer
5a1e44c417 Long MPC cleanup (#22462)
* cleaner extrapolation

* some comments

* new ref

* more comments

* new ref
old-commit-hash: a4bc1bbb74a1560d196a8e5f207c4e39f4464130
2021-10-06 17:51:23 -07:00
HaraldSchafer
f495134be4 Retune long mpc (#22445)
* first try

* looks decent

* finalize retune

* back to 3 its

* may need 4 still

* misc cleanup

* new ref

* SPEEEED

* new ref
old-commit-hash: 9ab09f5ae98362a31c23593ba3ab8f4f6fcb3a0f
2021-10-06 09:37:53 -07:00
Willem Melching
79d5c6107b Set CarControl.active (#22442)
* Set CarControl.active

* update ref
old-commit-hash: e636f03c7a9ad963f728e400cb1bfced4d37a5ac
2021-10-05 14:32:39 -07:00
speedking456
ca46acfd64 accel/decel button metric increments (#22399)
* add metric values

Freedom units have weird multiples compared to metric. Modified so that it increments by 10 km/h on long press and 1 km/h on short press, rather than 8 and 1.6 km/h. This mimics stock hyundai behaviour on metric vehicles.

* use is_metric from controlsd

* use actual mph value instead of rounded

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: 23b931660336b7fdd21b8942cedb5f79401aa357
2021-10-04 21:11:17 +02:00
Willem Melching
11066c6236 Split pandaState into peripheralState and pandaState (#22385)
* publish peripheralState from boardd

* refactor consumers

* rename thread

* peripheralState has panda type too

* add to process replay

* fix device build

* properly remove hardware unsupported alert

* latest peripheralState

* remove pandaState from thermal_monitor

* put that back

* add back harness check

* fix cloudlog

* needs pandaState

* Update selfdrive/thermald/tests/test_power_monitoring.py

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* dont conflate

* Update selfdrive/thermald/tests/test_power_monitoring.py

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* pigeon is peripheral

* cleanup

* less global

* comment

* move rtc to peripheral_control_thread

* better diff?

* whitespace

* get msg

* bump cereal

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: f4e2537b124d3d1c0d697a12d8b243b54b76501b
2021-10-04 11:30:11 +02:00
qadmus
810e859169 Lateral PID: move steer feedforward to CarInterface (#22411)
* move steer feedforward to car interface, in car parameters

* LatControlPID.get_steer_feedforward()
old-commit-hash: 3461e25944ae4f4ba4f55960a9748c0f57236c76
2021-10-04 10:03:53 +02:00
Greg Hogan
a131767d0b accel/decel button short/long press 1mph/5mph (#22013)
old-commit-hash: 92895f1e68f76f1092d2fcea8e672eef7309aaf2
2021-10-01 11:09:56 +02:00
HaraldSchafer
d91e0604e8 Change radar-based FCW to model-based FCW (#22379)
* just use MPC for fcw checking

* thats already bad

* model FCW is always good

* better fcw

* should be good for now

* comment

* linting

* cleaner

* unused
old-commit-hash: a8b4249ebcf21c2868e298ef86ee37ac96d2715e
2021-09-29 11:55:54 -07:00
HaraldSchafer
f02787eb75 Small long MPC optimizations (#22360)
* Revert "temporarily relax camerad timings"

This reverts commit 59b8293b70e0cbd43567275dc2c6c1d29308fb84.

* cleanup

* wrong weight size

* changes ever so slightly

* seems enough

* Revert "seems enough"

This reverts commit 24f64e9b18583462206bb77c37ba7727b9e47245.

* new ref
old-commit-hash: 85dc43d166f6ad8286dfbed39c609959195fbac0
2021-09-28 17:37:31 -07:00
Adeeb Shihadeh
a4194021bd controls: only send cruise cancel while cruise is enabled (#22359)
* controls: only send cruise cancel while cruise is enabled

* cleanup

* might actually do something

* update refs

* update refs again

* update refs
old-commit-hash: 3b8fa4b7fdc9bdd262faca457c478e9d388eae38
2021-09-28 12:30:50 -07:00
HaraldSchafer
2b470f4e38 acados long merged (#22224)
* rebased

* cleaner, seems to drive better?

* more stable

* wrong import

* new way of thinking

* reports look nice

* start move back

* works at leas

* good timestamps

* step by step

* somewhat work

* tests pass

* ALL CARS STOPPED

* should work

* fake a cruise obstacle

* cleaner costs

* pretty good except cruise braking

* works pretty well now!

* cleanup

* add source

* add source

* that is needed for unit tests

* nan recovery

* little cleaner

* stop wasting arrays

* unreasonable without unfair init

* this isnt needed without the exponential

* that works too

* unused

* uses less

* new ref

* long enough

* e2e long api

* DONT PUT IN A VIEW INTO ACADOS

* new ref for outside weights

* remove debug prints
old-commit-hash: fe983a7b8ce7ad63c73663284d8b8e093a280308
2021-09-27 19:48:28 -07:00
Adeeb Shihadeh
18097d7c06 change reverse gear event from immediate to user disable (#22337)
old-commit-hash: 2fe91e6085072db547c34bb603da1164aac6a1fe
2021-09-24 10:27:51 -07:00
Adeeb Shihadeh
821f1f6cb6 remove community supported cars from community features (#22330)
* remove community supported cars from community features

* remove bosch and hkg long

* remove test case

* update refs
old-commit-hash: 649af76fd4ade524df8eb6c56cc8bb09b3772e7c
2021-09-23 17:34:52 -07:00
Willem Melching
b3601ce43b Remove fuzzy fingerprint startup alert (#22328)
* deprecate fuzzy fingerprint startup alert

* bump cereal
old-commit-hash: 88d248a5af55a5b184b313e3c3223edd77461db9
2021-09-23 17:15:33 -07:00
HaraldSchafer
498e0f4212 Fix cruise MPC convergence bug and add test (#22295)
* fix tests

* fix cruise convergence bug

* update refs

* Update selfdrive/controls/tests/test_cruise_speed.py

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

* Update selfdrive/controls/tests/test_cruise_speed.py

* add msgh

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: fcda55fbf1371e95c82755da2069ccb547d47983
2021-09-21 12:19:05 -07:00
HaraldSchafer
0512c89d34 various cleanup (#22289)
old-commit-hash: cc6af379ce0930ec3b635fda9d441654d2ac0c03
2021-09-20 16:26:10 -07:00
Mitchell Goff
aa4b201b96 Added update_with_xva method to long_mpc so it can be used in sim (#22284)
old-commit-hash: 485afda79db7b65d00eb03553511c14f4b2f5301
2021-09-20 14:20:01 -07:00
HaraldSchafer
bc1882e3fb More extreme lead init for lead mpc (#22273)
* More harsh lead init for lead mpc

* update refs
old-commit-hash: 7495100177acd53f06e553a49207b8413db9e2e2
2021-09-20 09:35:55 -07:00
Harald Schafer
b1e2f219c9 Clip radar acceleration for mpc stability
old-commit-hash: a1fcedda21d1ff7d53bd647dc4359c5e5941bf47
2021-09-18 22:21:03 -07:00
HaraldSchafer
e190dfaf13 Dont run plannerd for long tests (#22260)
old-commit-hash: f0be9a57ac1cf4931d7ebbfeb80a25e5d185167b
2021-09-16 20:45:13 -07:00
HaraldSchafer
8f84b2421a sane lead clips to prevent reset (#22255)
old-commit-hash: 5e995e5aff9f6b25b8c0a0e9d898add039294019
2021-09-16 17:31:32 -07:00
HaraldSchafer
3305024cfc remove ACADO (#22247)
* remove acado

* not relevant anymore
old-commit-hash: 42d93e94df410dc38b7f96e8061cff462a97d646
2021-09-15 21:14:11 -07:00
HaraldSchafer
2d4b64ed04 Acados long fast (#22233)
* acados long

* new ref

* SPPEEEEEDDD

* less iterations

* this shouldn't be so high

* reset only essentials

* minimal reset for long mpc

* more cpu usage plannerd

* Use lead mpc even when going to crash

* reset to current state

* Use open loop speed for lead mpc

* 1 iteration is too little for cruise mpc

* add whitespace

* update refs
old-commit-hash: 66c275b71128355d634d4daf0f5c18891d4fb047
2021-09-15 19:00:12 -07:00
Willem Melching
d688b62c62 Add upper/lower bounds for longitudinal lag (#22235)
* Add upper/lower bounds for longitudinal lag

* add ref

* update ref

* bump cereal

* bump cereal
old-commit-hash: 417e229624583a3a618aaf7fe6bd48162dfc35b6
2021-09-14 18:57:16 -07:00
HaraldSchafer
8877772a95 Less QP iterations for lateral acados (#22231)
* Less QP iterations for lateral acados

* update ref
old-commit-hash: 96a8f8a831a2e72e195d5b384723644e8499c531
2021-09-14 13:55:30 -07:00
Willem Melching
a8ce1288fd Hyundai longitudinal prerequisites (#22121)
* panda

* bring over changes

* dont check car model

* remove comment

* fix typo

* more stuff gated behind long

* not

* not used

* gate that too

* try honda tuning

* clip accel values

* fix up merge

* fix stopping

* add retry logic around knockout

* increase timeout

* keep flipping lead bit

* true for now

* less tuning

* update comment

* 0.1 s is fine now

* merge honda and hyundai knockout

* more lead fields

* another obj bit

* increase timeout

* fix stopping flag

* only lag compensate for braking

* no lead

* less tuning

* only do knockout if not readonly

* try controlling using jerk

* tuning

* try higher stopping rate

* set stopping flag at higher speed

* clip upper jerk when stopping

* remove comments

* tester present 1hz

* use positive start accel

* 1.0 to maybe improve low speed stuff

* no point going over 0

* bump panda

* bump panda

* revert that change

* update ref
old-commit-hash: c4bac6bd68ce2a91beb15bb4f4472d76525288e0
2021-09-13 22:03:08 -07:00
HaraldSchafer
65a1b386dc Fix 0 init bug for acados lateral (#22225)
* this is needed somehow

* new ref
old-commit-hash: 0dc45eaf1cebc4247b59a4508b4ef192ea7b0e56
2021-09-13 21:23:22 -07:00
HaraldSchafer
c422cce205 Port lateral planning to ACADOS (#22080)
* lateral acados

* looks good!

* add another solve, needed for init somehow

* use copy

* init correctly

* cleanup sconstruct

* Update files_common

* update cpu usage

* reset when invalid

* fix cpu usage

* cost_set doesnt leak

* new ref

* non leaky reset

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 7081ab4fb7473a5be424db4b63e6bdaacf62157f
2021-09-13 19:06:54 -07:00
Willem Melching
523219c678 Parameterize longitudinal control using carParams (#22200)
* use CP.startAccel

* missing values

* order

* update ref

* cereal
old-commit-hash: b7d1aac1972d8317e77d1f48edb22156b2c67bd6
2021-09-11 18:01:54 -07:00
Willem Melching
b079219b93 Use CP.vEgoStopping and clean up CP.startAccel (#22199)
* use CP.vEgoStopping and clean up

* update ref
old-commit-hash: 1e62b09e5dd70cae6721d2da9f7bcef59aa87c10
2021-09-11 17:13:30 -07:00
HaraldSchafer
cb1cd01bdf cleanup old nidec accel override logic (#22181)
* cleanup old nidec accel override logic

* add ref without deprecated fields

* no more override
old-commit-hash: 74b6c872545ac64055a914789a89ccc173168d8b
2021-09-10 10:34:18 -07:00
Adeeb Shihadeh
52aaad7cad plannerd: remove last of liveMpc
old-commit-hash: da74a6cf73ab94999c6cb17d2598cdad2f1a27e0
2021-09-09 14:09:09 -07:00
Adeeb Shihadeh
7fc6a76f04 reduce startup alert duration to 10s (#22163)
* reduce startup alert duration to 10s

* update refs

* update refs

* update refs
old-commit-hash: 1c750975fc179185b270f2063831431538d075d8
2021-09-07 13:40:31 -07:00
Willem Melching
83ce6c65bb actually set longControlState in actuators packet (#22155)
* actually set longControlState in actuators packet

* update ref
old-commit-hash: 4f84e1b2ad689fb43b06d28def2bd58abf722748
2021-09-06 20:14:01 -07:00
Willem Melching
ab7d2f1d08 put LongControlState in CarControl.Actuators (#22154)
old-commit-hash: 21ae64868e2ab2d75cf77fa816087847b0496ade
2021-09-06 18:45:59 -07:00
Willem Melching
977cf8ca02 parameterize longitudinal actuator delay (#22153)
* paremetrize longitudinal actuator delay

* update ref
old-commit-hash: b39f6efa3fc91b3df851a133109ec18f598dce68
2021-09-06 17:56:52 -07:00
Willem Melching
6f5c9d5ad1 Clean up PID controller ACCEL_MIN/ACCEL_MAX (#22148)
* use ISO 15622:2018 limits in PID controller

* allow more for nidec

* limit PID inputs

* CP is not needed

* add GM

* not used

* update ref

* fix honda bosch
old-commit-hash: f941111dcdc9d651fe7169044fb7f52fd70f94ab
2021-09-06 17:29:32 -07:00
Adeeb Shihadeh
50ea63cb76 no battery (#22124)
* no battery

* little more

* used for power monitoriong
old-commit-hash: 69fd26623846e6b82bfa4cb022bc84a8f2df1771
2021-09-03 22:17:57 -07:00
HaraldSchafer
1b98341932 Prevent PID windup on Honda NIDEC (#22112)
* add higher set speed

* freeze when close to cruise

* dont bias this

* higher set speed

* start high

* 2mph might be needed

* better condition

* limit accel windup like this

* wrong name
old-commit-hash: ebf2a2279d837feb3ce55a7bc44c7f0053e77f27
2021-09-02 14:16:44 -07:00
Harald Schafer
4e7cca187c unused
old-commit-hash: a4ae99a489911bcaa0fe86633b7c6e21ae2a09fe
2021-09-01 16:46:17 -07:00
Willem Melching
a06ffc48c1 Smarter longitudinal lag compensations (#22094)
* smarter lag compensations

* need to use speed from plan

* update ref

Co-authored-by: Harald Schafer <harald.the.engineer@gmail.com>
old-commit-hash: edae2218d76e3fb81839eabab344c9dabc852fe9
2021-09-01 15:28:16 -07:00
grekiki
afe4df11dd Add angleError to pid_log (#21611)
* add angleError

* Log all the time

* update refs

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 21fad4d1adcaea1fd802f8dcb80f267d6d5b19d3
2021-09-01 13:45:22 -07:00
robbederks
f8085a47ef Smarter thermal controls for tici (#21923)
* dumb controller 'tuned' on a desk

* reduce Ki

* fix prev_time bug

* reset integral on going onroad

* cleanup thermal detection logic

* more minor tuning

* use controls' PI controller

* get rid of bat_temp

* change if once more

* cleanup

* cleanup import order

* add back bat temp in this PR

* move to constructor

* consistency

* add bp

Co-authored-by: Comma Device <device@comma.ai>
Co-authored-by: Willem Melching <willem.melching@gmail.com>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: f539cd45c99034d379c797bb7faeb0e0dc44899e
2021-08-31 12:29:53 -07:00
Adeeb Shihadeh
1244074094 add TSS2 replay route (#21953)
* add TSS2 replay route

* skip on sim

* do not set on import time

* update ref

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: 86f68ff22ed184dc40bfe58761a554aea1e3995e
2021-08-31 10:48:21 -07:00
HaraldSchafer
a73a820338 Change car controller interface from gas/brake to acceleration (#21911)
* retune civic

* seems smooth

* back to normal

* new ref

* fix conflict

* runs

* rm

* accel scale is 4

* toyota should be good

* more cleanup

* fixup

* better naming

* update ref

* deprecated

* sending brake when not enable causes a fault

* rm gas and brake

* unused

* update ref

* acura logic is no more

* wrong before

* revert tuning cleanup

* adress comments

* update ref

* already on master

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: 1ac89f14aa7c45c56049e8dbb0d6c5bb83a0fc6b
2021-08-30 09:32:52 -07:00
Adeeb Shihadeh
d0dce9a166 don't check cpu usage in simulation mode
old-commit-hash: 9afa0eec6451a37a0dc0c39bf4837edd2ad53531
2021-08-28 14:55:12 -07:00
Adeeb Shihadeh
9de66112fb remove deprecated mpc logging code
old-commit-hash: 9be7cf2cdaa4c274cc4fd55797ac5d6421fc9652
2021-08-26 13:33:43 -07:00