Commit Graph

214 Commits

Author SHA1 Message Date
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 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
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
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
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
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
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
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 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
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 ac8b08fa0c alert for per-core cpu usage (#21983)
* thermald: per-core cpu usage

* add alert

* better alert text

* list

* fix process replay
old-commit-hash: fc8b571a847f1a89abb331eef8f85f310453fd77
2021-08-19 19:14:51 -07:00
Willem Melching f92f51d2b5 controlsd: ensure actuators packet is finite (#21958)
* controlsd: ensure actuators packet is finite

* do not hardcode fields

* cleaner way to get fields

* move line up
old-commit-hash: 4fcd51e0215d5f81a343d2f12108ad1528ab496e
2021-08-19 19:00:03 +02:00
Adeeb Shihadeh 13b3649211 add that back
old-commit-hash: 8aafbc78f65a398b7d354a68453df15c1324eb9d
2021-08-06 15:48:16 -07:00
Adeeb Shihadeh 8e8edfe185 increase controls initializing timeout a bit
old-commit-hash: 03255d83bea80c92d3bd5739ea20f7c510417646
2021-07-28 15:50:40 -07:00
Adeeb Shihadeh 4df47022d5 increase timeout for controls init (#21680)
Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 7c3b7b53485069e1402f7351d9f032909c581021
2021-07-22 00:04:00 -07:00
Jafar Al-Gharaibeh 26990b19b9 Car Port: Mazda CX-9 2021 (#20864)
* Mazda CX-9 no steer lockout, and newer cars can use more torque

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

* Mazda CX-9 2021 test route

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

* cleanup

* more cleanup

* don't show community features alert if dashcam only

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: ff704e18b7797d093191950825e8c76623b9f5a6
2021-07-10 23:50:03 -07:00
Adeeb Shihadeh b7c1b9a6e8 rename enableCruise -> pcmCruise (#21546)
old-commit-hash: cb7e96f99d59cc56ac532d4b5e08e03c013cf946
2021-07-10 13:56:11 -07:00
Adeeb Shihadeh db852728a2 move fuzzy fingerprinting out of community features (#21542)
old-commit-hash: b4fc20816664f76d0b3ba0070f37d4f738021025
2021-07-10 13:23:39 -07:00
HaraldSchafer 96d4bfbff3 Refactor long (#21433)
* refactor

* needs casting

* tests pass

* fix that test

* refactor in controls

* lets not go crazy

* change of names

* use constants

* better naming

* renamed

* soft constraints

* compile slack variables

* rm git conflict

* add slack variables

* unused

* new edition

* fcw

* fix tests

* dividing causes problems

* was way too slow

* take a step back

* byeeee

* for another time

* bad idxs

* little more cpu for cruise mpc

* update refs

* these limits seem fine

* rename

* test model timings fails sometimes

* add default

* save some cpu

* Revert "little more cpu for cruise mpc"

This reverts commit f0a8163ec90e8dc1eabb3c4a4268ad330d23374d.

* Revert "test model timings fails sometimes"

This reverts commit d259d845710ed2cbeb28b383e2600476527d4838.

* update refs

* less cpu

* Revert "Revert "test model timings fails sometimes""

This reverts commit e0263050d9929bfc7ee70c9788234541a4a8461c.

* Revert "less cpu"

This reverts commit 679007472bc2013e7fafb7b17de7a43d6f82359a.

* cleanup

* not too much until we clean up mpc

* more cost on jerk

* change ref

* add todo

* new ref

* indentation
old-commit-hash: be5ddd25cd3f4c8b7e46cdeecf303e2c73301003
2021-07-07 19:42:26 -07:00
Adeeb Shihadeh dce54b460d improved commIssue logging (#21515)
old-commit-hash: 685e33c067da47699919be86508ea2ac419fcd38
2021-07-07 18:43:41 -07:00
Adeeb Shihadeh 691ea8553f deprecate CP.enableCamera (#21509)
* deprecate CP.enableCamera

* more removal

* one more

* update refs
old-commit-hash: c72d163e142d90edac5086892c0cd297bdc636fe
2021-07-07 14:59:18 -07:00
HaraldSchafer 7e87930a20 Refactor lateral lag compensation (#21334)
* add T_IDXS

* refactor

* fix test

* unused

* typo

* needs casting

* Update selfdrive/controls/lib/drive_helpers.py

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

* deprecate field

* regen all

* new segs

* add todo

* split back

* clean

* bad names

* do in controls

* add arg

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 6838e1c82c5abb9f347228006219d96744b3fbb5
2021-06-30 14:19:39 -07:00
Adeeb Shihadeh 784601c8e1 remove lte toggle (#21392)
* remove lte toggle

* little more
old-commit-hash: a420c7ad50eec716e53537957b1439b2ce44d73e
2021-06-23 17:01:17 -07:00
Willem Melching 5bc0d28708 Honda Bosch longitudinal prerequisites (#21217)
* untested changes

* set compute_gb

* community feature for good measure

* add code for rolling backwards

* init needs CarParams

* stay in elm mode until carParams is written

* fix tester present bus number

* fix can errors

* fix enableCruise flag

* print when radar disable is done

* move retry logic to controlsd

* move lookup table into carcontroller params

* cleanup brake error values

* make init return

* that should be 1

* floats

* back to no failure handling

* try simplify knockout

* bump panda

* Move flags to panda

* add warnings

* Revert "try simplify knockout"

This reverts commit 4f496245791ea6bd041d4412b96035c6b434b91c.

* add note about LoC.long_control_state

* update ref
old-commit-hash: a8fac002ae8e7c6ab37e9b1a5deb8cfcea2a71ac
2021-06-22 16:28:11 +02:00
Willem Melching 8d345a26f6 Don't check RAM/disk in simulation (#21261)
* Don't check RAM/disk on PC

* simulation
old-commit-hash: 7b0d27e61243feb9dd82834a21dc72f4d045fb25
2021-06-16 11:59:15 +02:00
ShaneSmiskol 23ea456f4f Fixup joystick (#21129)
* some common changes

* rename to joystick

* add alert and update controlsd to work with joystick

* update joystickd

* Update Joystick readme

* assume we have inputs

* only send gb or steer when engaged_toggle is true

* Update instructions

* fix --ip

* Easier to understand at a glance

* much better

* -a

* receive events and send msg in same loop

* always import

* Update selfdrive/controls/lib/events.py

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

* Update selfdrive/controls/lib/events.py

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

* combine logic and clean up

* use argparse

* outdated, and use normal class

* rm

* bit of a refactor

* refactor part 2 / 3

* much better (3 / 3)

* Simplify

* bump cereal and update readme

* capitalize

* Update tools/joystick/joystickd.py

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

* Update tools/joystick/joystickd.py

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

* make joystick abstraction class clearer

* use interp, clearer without comments

* no need to use apply_deadzone

* more explicit

* define btns and axes once

* split function by use_keyboard again, but simpler

* we can use handle_button as a reset function

* need to flip sign

* remove

* invert axes map for kb, easier to read the button mapping

* apply changes from review

* new lateral log for debug mode

* bump

* add saturated

* static alert

* joystick_mode

* conditionally subscribe

* Update selfdrive/controls/controlsd.py

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

* move params instantiation

* Spoof active and enabled

* Only allow car to engage

* no startup alert if joystick

* Update controlsd.py

* Should be orange not enabled, green enabled

* no more button states

* should work

* blue

* submaster conflates, so only send when we have an update

* final change

* remove msg

* clean up a bit

sort of clean up

clean up a bit

remove msg

* this was right

* Apply suggestions from code review

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

* lowercase

* suggestions from code review

* forgot laptop

* bump to latest

* fixes

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: vanillagorillaa <31773928+vanillagorillaa@users.noreply.github.com>
old-commit-hash: ae77f693a26527ffbee044f852cc4185718c2433
2021-06-11 14:33:17 -07:00
Adeeb Shihadeh 5dfc430d47 startup alert for no fw returned (#21177)
old-commit-hash: d4ab1f1e274bc5e36b47fb9e6f76a977e04d1f1a
2021-06-07 14:15:09 -07:00
HaraldSchafer f0f36a0a06 Many localizer resets alert (#21116)
* add excessive reset

* add alert

* add event
old-commit-hash: 1c926d23da0c73ceb246ca6d61db6ed1c48a1ab9
2021-06-03 09:26:53 -07:00
Adeeb Shihadeh d9026b7660 fix camera error indices
old-commit-hash: 6fa573a2d6e64cd37afd6218e6676acbe625a4c1
2021-06-01 16:56:33 -07:00
Adeeb Shihadeh bf9f1f3871 fix low memory on tici
old-commit-hash: e1d7a1af10c1a4a5efe2fe6f278f2af0dbc25718
2021-05-26 19:47:10 -07:00
Adeeb Shihadeh bb70ddcbfe Move CAN fingerprinting behind community features (#20993)
* Move CAN fingerprinting behind community features

* fix typo

* fix startup test

* fix
old-commit-hash: 726fb9d50135d2469fe87ff50d0540965955e37f
2021-05-24 19:21:58 -07:00
Adeeb Shihadeh 41f8f5c7ce per camera alerts (#20992)
* per camera alert

* bump cereal

* cleanup

* space
old-commit-hash: 12ed986333856086c774b3142659dfbaecdf654b
2021-05-21 14:53:30 -07:00
Adeeb Shihadeh d7a2931a1f stricter memory usage check (#20985)
old-commit-hash: c04b47938d34e8f320e6483a47509ca5d7ff9d1b
2021-05-21 11:25:11 +02:00
Adeeb Shihadeh a4550fec27 show alert for rest of drive
old-commit-hash: fa1df5f78395677451d6244d33b786ca74a2fe37
2021-05-20 20:03:39 -07:00
Mitchell Goff 78927e4ebb New model outputs (#20933)
* New model: 51a237cd-9c43-4281-9072-802325e6744d/950

* Added new meta outputs and proper interp for plan_t_arr

* Added meta-based trigger for FCW

* No nans in planner, separate alert for model FCW

* Cleaned up plan_t interp logic

* Added empty cameraError alert to fix unit tests

* Use the normal FCW event

* Updated filter logic

* Updated model replay ref

* Moved disengage predictions into their own cereal struct

* Updated model replay ref for new cereal structs

* Apparently this breaks stuff?

* Bumped cereal commit and model replay ref
old-commit-hash: 29cc3500a5161b4d2245b8d041f190533be4ee8e
2021-05-19 22:30:23 -07:00
Adeeb Shihadeh 340a080c3b alert for errors in camera stack (#20932)
* camera error alert

* check crcs

* cleanup

* bump cereal

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 2defc730db18f7f9c0b08b0c8b0f6806cc513ac4
2021-05-19 21:28:16 -07:00
Adeeb Shihadeh 3fbeb1299e boardd: set can and pandaState valid flags (#20899)
* boardd: set can and pandaState valid flags

* add event

* bump cereal

* consistency
old-commit-hash: e694f0b4d6f8cfe55e2c8d36a78cf86fe0c86f1a
2021-05-14 21:26:02 -07:00
Adeeb Shihadeh ec7913cbe5 delay controls start (#20761)
* delay controls start

* shouldn't need this stuff anymore

* only delay board

* bail after 2s

* fix loopback test

* fix process replay

* update refs

* bump cereal

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: f9a961f6fb69f36f8a113246920b2d71e6af8ae1
2021-04-30 13:55:17 -07:00
qadmus 99d3a5e553 ignore_avg_freq of longitudinalPlan, which is triggered by radarState (#20743)
old-commit-hash: 0d10f9c4ad0e11ecd25e0c29355e1c825333f740
2021-04-29 11:06:44 -07:00
Willem Melching 5ec437bb6e Ignore radarState average frequency
old-commit-hash: 64d2ec38f290f7146af4196d240fb70cc11653b0
2021-04-21 10:59:26 +02:00