Commit Graph

448 Commits

Author SHA1 Message Date
Harald Schäfer 47d5601d8a long control: new API (#32706)
* Simplify long control

* Seperate

* Rename

* Try new api for toyota

* rm v_pid everywhere

* No speed in reset

* 0 is better default

* unassigned variable

* Update other cars

* Update gm

* SIMPLIFY

* simplify more

* fix API boundry

* Fix stopping bug

* Small fixes

* Update ref
old-commit-hash: bc303df6a0a4a9d52a2e92e5976b6c7aa5138b95
2024-06-14 00:08:58 -07:00
Shane Smiskol 0837d2512b controlsd: exit on any exception (#32730)
* exit on any exception

* finally so we don't catch
old-commit-hash: 7dbf60b4bce04a071eafcbc3eb0815e968e401be
2024-06-12 17:16:30 -07:00
Adeeb Shihadeh ba34590567 controlsd: remove last mention of CAN (#32646)
old-commit-hash: a7ed190df4665a7f972862c992455bfd7daa6eab
2024-06-06 16:46:27 -07:00
Harald Schäfer f870a968e9 Split cereal into cereal/msgq (#32631)
* squash

* fix doc

* compile device

* compile device

* Update ref

* add msgq to precommit exclusions

* No service ports

* fix compile

* address comments

* More comments

* Delete logger

* Update opendbc

* Linting

* bump msgq
old-commit-hash: e71ec4e8d7e39a56235f590227e7cb361cd8b79d
2024-06-06 14:31:56 -07:00
Adeeb Shihadeh 2c6829ed67 boardd is pandad (#32628)
* boardd is pandad

* rename tests
old-commit-hash: 34e329649d7a388d4cd1f25dac9dda9d5409bf4a
2024-06-04 19:16:55 -07:00
ZwX1616 9a7fd90cb1 controlsd: explicitly ignore camera states in process replay (#32515)
* explicitly ignore

* Update selfdrive/controls/controlsd.py

Co-authored-by: Shane Smiskol <shane@smiskol.com>

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
old-commit-hash: fa2d5bca57a10bc54667d7e5e3e2ef5fbe80992f
2024-05-22 15:18:06 -07:00
Shane Smiskol 912ae13307 card: only exit ELM once done with ECU knock outs (#32505)
* only exit elm once done with knock outs

* comments!
old-commit-hash: 9fa92c222513731a19009781ce463bb9e69158db
2024-05-21 21:23:14 -07:00
Shane Smiskol ee03d13529 card: process that abstracts car interface and CAN (#32380)
* format card

* standalone process

* no class member CS, there's no point

also can be confusing; what else could be using this?

* rename CoS

* Update selfdrive/controls/controlsd.py

* never works first time :D

* canRcvTimeout is bool

* hack

* add cpu

* see what testing closet comes up with

* first

* some clean up

* support passable CI, fix test models

* fix startup alert

* process replay changes

* test_fuzzy

* gate carOutput valid on carControl valid

* we should publish after we update carOutput

* controlsd was using actuatorsOutput from 2 frames ago for torque, not the most up to date

* check all checks for carControl in case controlsd dies

* log more timestamps

* more generic latency logger; needs some clean up

latency_logger.py was difficult to understand and modify

* card polls on can and carControl to get latest carControl possible

* temp try to send earlier

* add log

* remove latencylogger

* no mpld3!

* old loop

* detect first event

* normal send

* revert "card polls on can and carControl to get latest carControl possible"

how it was is best

* sheesh! update should be first

* first timestamp

* temp comment ( timestamp is slow :( )

* more final ordering, and make polling on/off test repeatable

* Received can

* new plot timestamps

* clean up

* no poll

* add controllers (draft)

* Revert "add controllers (draft)"

This reverts commit e2c3f01b2fadcff74347bac90c8a5cc1ef4e27b3.

* fix that

* conventions

* just use CS

* consider controlsd state machine in card: not fully done

* hmm it's just becoming controlsd

* rm debugging

* Revert "hmm it's just becoming controlsd"

This reverts commit 534a357ee95bec4ed070667186af55d59421bbc7.

* Revert "just use CS"

This reverts commit 9fa7406f30c86200f20457f7b9ff95e731201bf9.

* add vCruise

* migrate car state

* Revert "migrate car state"

This reverts commit 4ae86ca163c6920070f410f608f7644ab632850b.

* Revert "add vCruise"

This reverts commit af247a8da41c3626ada4231b98042da1a1ae4633.

* simple state machine in card (doesn't work as is)

* Revert "simple state machine in card (doesn't work as is)"

This reverts commit b4af8a9b0a2e17fdfc89d344c64678ef51305c24.

* poll carState without conflate

* bump

* remove state transition

* fix

* update refs

* ignore cumLagMs and don't ignore valid

* fix controls mismatch; controlsd used to set alt exp

* controlsd_config_callback not needed for card

* revert ref temp

* update refs

* no poll

* not builder!

* test fix

* need to migrate initialized

* CC will be a reader

* more as_reader!

* fix None

* init after publish like before - no real difference

* controlsd clean up

* remove redundant check and check passive for init

* stash

* flip

* migrate missing carOutput for controlsd

* Update ref_commit

* bump cereal

* comment

* no class params

* no class

* Revert "no class"

This reverts commit 5499b83c2dcb5462070626f8523e3aec6f4c209d.

* add todo

* regen and update refs

* fix

* update refs

* and fix that

* should be controlsstate

* remove controlsState migration

CoS.initialized isn't needed yet

* fix

* flip!

* bump

* fix that

* update refs

* fix

* if canValid goes false, controlsd would still send

* bump

* rm diff

* need to be very careful with initializing

* update refs
old-commit-hash: 71f5c441fe32184d94a9f26565a36c661e2ccf28
2024-05-21 01:18:10 -07:00
Shane Smiskol b3fc3f25ce process replay: regen routes (#32464)
* regen

* regen

* update

* undo

* update refs

* fix

* real fix

* test

* test2

* test3

* stash

* Revert "stash"

This reverts commit bf6765f526b48426f49a4b29c4042097f57fc4b0.

* rk.lagging can not be trusted. BODY segment has radarFault while modelV2 is not valid, causing radarState to not be valid

* order

* update refs again

* we never logged carOutput!

* bump

* add back checks
old-commit-hash: 220fcc16753ce87c8997275733f62bc385342a7e
2024-05-19 01:07:12 -07:00
Shane Smiskol 785d92c474 Revert "card: move all car events (#32427)" (#32439)
* Revert "card: move all car events (#32427)"

This reverts commit e1918a6270257e96d68df3ac03e884603253c8e2.

* keep the event here

* oops

* Revert "oops"

This reverts commit ea99a2768fbeb7a6123dd755585157b530e7a2a1.

* Revert "keep the event here"

This reverts commit ec089b4e1afdf09b2e6b184de8f23584ef931601.
old-commit-hash: 407791113d10d2f9fea9b68c8313271fefa1e36e
2024-05-15 14:32:52 -07:00
Shane Smiskol cd782c06d1 card: move all car events (#32427)
* move last event over

* fix
old-commit-hash: 8f46028bd4b71c619bac654d6f2a4f8006b7508d
2024-05-14 15:20:03 -07:00
Shane Smiskol c3630f813a controlsd: use already initialized params (#32429)
old-commit-hash: 6f3cd143efdec89524e603a181f2a7cbf02e8588
2024-05-14 14:01:38 -07:00
Shane Smiskol 97dc134a42 card: create pedal pressed event (#32417)
* card: create pedal pressed event (#32393)

* move pedalPressed to card

* rm

* needs to be a builder

* move these

* clean up

* reader later

* Update ref_commit

* moved to card
old-commit-hash: d0d44a51a0ff66c1b2da56b3d9864e10ecc2174d
2024-05-13 16:18:55 -07:00
Shane Smiskol 4c7c4272d0 Revert "card: create pedal pressed event" (#32414)
Revert "card: create pedal pressed event (#32393)"

This reverts commit 05be56def1f1fdddb761291e1a40cce459fc7d36.
old-commit-hash: 9287a6962479b63f1628086a73459b4e7e933d59
2024-05-13 14:25:22 -07:00
Shane Smiskol 48bb3caaac card: create pedal pressed event (#32393)
* move pedalPressed to card

* rm

* needs to be a builder

* move these

* clean up

* reader later

* Update ref_commit
old-commit-hash: d18da895d3b70dc62ee3cd8ebeb75de6cf48e7a9
2024-05-13 14:15:26 -07:00
Shane Smiskol 4a0b3c8b64 CarInterface: move stateless, common car events to car interface (#32394)
* move stateless, common car events to car interface

* try to reduce process replay diff a bit

* Revert "try to reduce process replay diff a bit"

This reverts commit b12798deabea67c5a636d6e70e80a3c21c7225ff.

* update refs
old-commit-hash: 3dfb6d7931711c51ecfe0d8c32f0ff928b17a5c9
2024-05-13 12:50:42 -07:00
Shane Smiskol c4e445e6c5 card: more final structure
old-commit-hash: d28624fe5b4145b48add862f1f29a3bcf7568b8c
2024-05-10 23:18:48 -07:00
Shane Smiskol 753dbe8f6e controlsd: use latest actuatorsOutput (#32390)
use current actuatorsOutput
old-commit-hash: ef1693433f0e89818bbc8dabf83f16841e28ec6e
2024-05-10 21:00:01 -07:00
Shane Smiskol 8708fb2a32 card: preparation (#32382)
* card prep

* also format
old-commit-hash: 2e6b2ef3c973549c5375684ba36f1b12372167a4
2024-05-08 23:54:20 -07:00
Adeeb Shihadeh a6faeb03ce adjust gps alert
old-commit-hash: 6ef95f7a91b33f7f554c0d41353c7f77fb2eb6b4
2024-05-01 11:35:20 -07:00
Armand du Parc Locmaria 938759ebd1 commabody: ignore fcw alerts (#32301)
* ignore modelV2 and longitudinalPlan on the body to avoid fcw alerts

* move joystick_mode up because ignore depends on it

* revert and ignore fcw itself instead
old-commit-hash: adabd108e26767e6ed7ff6168d16742641281509
2024-04-26 20:04:10 -07:00
Justin Newberry 76dc74787b controlsd: fix steer saturation premature warning (#31909)
fix last actuators
old-commit-hash: 4ecbaa41fae93d13fd0de805e216b670541a0084
2024-03-21 18:31:22 -07:00
Justin Newberry a5bc36ea9d move git commands to common/git.py (#31921)
move git into common/git.py
old-commit-hash: 4fbc8a389662f82018eeabd03294cc761b87ce75
2024-03-19 12:39:09 -07:00
Justin Newberry 006f216cdb controlsd: fix saturation warning (#31869)
fix saturation
old-commit-hash: 1ecbbef46b265a36bce71cc45c0fdc521d849e06
2024-03-14 18:03:39 -07:00
Shane Smiskol ebfc450fac longitudinal personality: change via steering wheel distance button (#31792)
* start at param

* start by sending personality

* change to personality

* POC: button changes personality

* what's wrong with this?

* fix

* not really possible but fuzzy test catches this

* there's always a typo

* dang, we're dropping messages

* clean up

* no comment

* bump

* rename

* not all cars yet

* works but at what cost

* clean up

* inside settings

* write param so we save the distance button changes

* setChecked activates buttonToggled and already writes param!

* don't need this, we update from longitudinalPlan on changes

* some clean up

* more

* ui

* allow some time for ui to receive and write param

* plannerd: only track changes in case no ui

* Revert "plannerd: only track changes in case no ui"

This reverts commit 2b081aa6ceb92c67a621b74592b2292756d29871.

* write in plannerd as well, I assume this is atomic?

* don't write when setting checked (only user clicks)

* better nane

* more

* Update selfdrive/controls/lib/longitudinal_planner.py

Co-authored-by: Cameron Clough <cameronjclough@gmail.com>

* doesn't write param now

* ParamWatcher is nice

* no debug

* Update translations

* fix

* odd drain sock proc replay behavior

* vanish

* Revert "odd drain sock proc replay behavior"

This reverts commit 29b70b39413e1852bb512155af6b6a94a5bd9454.

* add GM

* only if OP long

* move personality to controlsState, since eventually it won't be exclusive to long planner

more

bump

* diff without translations

* fix

* put nonblocking

* CS should start at up to date personality always (no ui flicker)

* update toggle on cereal message change

* fix

* fix that

* ubmp

* mypy doesn't know this is an int :(

* update translations

* fix the tests

---------

Co-authored-by: Cameron Clough <cameronjclough@gmail.com>
old-commit-hash: 3d63c7093afec7ba24f447a44f02f7bea1f7282b
2024-03-13 01:05:02 -07:00
Shane Smiskol f3414250a3 Move personality to controlsState (#31855)
* start at param

* start by sending personality

* change to personality

* POC: button changes personality

* what's wrong with this?

* fix

* not really possible but fuzzy test catches this

* there's always a typo

* dang, we're dropping messages

* clean up

* no comment

* bump

* rename

* not all cars yet

* works but at what cost

* clean up

* inside settings

* write param so we save the distance button changes

* setChecked activates buttonToggled and already writes param!

* don't need this, we update from longitudinalPlan on changes

* some clean up

* more

* ui

* allow some time for ui to receive and write param

* plannerd: only track changes in case no ui

* Revert "plannerd: only track changes in case no ui"

This reverts commit 2b081aa6ceb92c67a621b74592b2292756d29871.

* write in plannerd as well, I assume this is atomic?

* don't write when setting checked (only user clicks)

* better nane

* more

* Update selfdrive/controls/lib/longitudinal_planner.py

Co-authored-by: Cameron Clough <cameronjclough@gmail.com>

* doesn't write param now

* ParamWatcher is nice

* no debug

* Update translations

* fix

* odd drain sock proc replay behavior

* vanish

* Revert "odd drain sock proc replay behavior"

This reverts commit 29b70b39413e1852bb512155af6b6a94a5bd9454.

* add GM

* only if OP long

* move personality to controlsState, since eventually it won't be exclusive to long planner

more

bump

* diff without translations

* fix

* put nonblocking

* CS should start at up to date personality always (no ui flicker)

* update toggle on cereal message change

* fix

* fix that

* ubmp

* mypy doesn't know this is an int :(

* update translations

* fix the tests

* revert ui

* not here

* migrate controlsState

* Revert "migrate controlsState" - i see no reason we need to test with
any specific personality

This reverts commit 6063508f2df1a5623f113cda34dcd59a1f4b2ac9.

* Update ref_commit

---------

Co-authored-by: Cameron Clough <cameronjclough@gmail.com>
old-commit-hash: 29e55f99a54d95215aa79ecf94a22363f82913a6
2024-03-13 00:57:57 -07:00
Shane Smiskol 632fd1d20b longitudinal personality: display in Toyota instrument cluster (#31760)
* start at param

* start by sending personality

* change to personality

* POC: button changes personality

* what's wrong with this?

* fix

* not really possible but fuzzy test catches this

* there's always a typo

* dang, we're dropping messages

* clean up

* no comment

* bump

* rename

* revert longplan

* revert this

* Fix check

* more appropriate up here

* consistenet

* Update selfdrive/car/toyota/carstate.py

* Update ref_commit
old-commit-hash: 2c353a25a47a5ad6274b982c419ed21be3bfb213
2024-03-08 23:26:01 -08:00
Justin Newberry 88467a0669 move card to selfdrive/car/card (#31693)
* more obivous dif

* release
old-commit-hash: bc2407abeb68bce9c0fa94e3c7df1b1d0799e660
2024-03-04 10:45:32 -08:00
Justin Newberry 891b9a1ab4 card: prepare for separate process (#31660)
* Card

* update ref

* bump cpu

* sub to caroutput

* update ref
old-commit-hash: 8ec0d87de06c265dcb0526b9a3bce8a397248dc9
2024-03-04 09:53:42 -08:00
Adeeb Shihadeh b347145c9f controlsd: increase initializing timeout (#31535)
old-commit-hash: d8ce15a86910972bc066aa378a80c499a924de3d
2024-02-21 16:23:43 -08:00
Justin Newberry 1e13249c2a controlsd: move carParams management to card (#31534)
* card-manage

* fix

* init params

* reversed that

* can be in the init
old-commit-hash: 00315325a38b4be8a4aaa5db5db81e818c2e31ab
2024-02-21 16:11:00 -08:00
Justin Newberry 8256969d40 Split out can control into new "card" class (#31529)
* card v1

* fix car events

* fix proc replay

* lets keep that the same

* no extra space here

* move can recv timeouts to card

* organize imports

* organize imports

* slightly bump cpu

* not a card!
old-commit-hash: 837b811f9c78628a1c0ba50f9f287bf96e39144d
2024-02-21 13:18:43 -08:00
Justin Newberry 0d6c16e771 controlsd: sort imports (#31531)
sort imports
old-commit-hash: 0eba392cf24e5ebbd09d7a3ff4acd9f98daeb3bb
2024-02-21 11:58:04 -08:00
Adeeb Shihadeh 8b8677ae63 controlsd: allow mismatch while boardd reads back mode (#31505)
* controlsd: allow mismatch while boardd reads back mode

* self
old-commit-hash: b28daef34ad213670418bdbf82ae999f38ac9409
2024-02-18 14:43:42 -08:00
Adeeb Shihadeh b8b4210a68 controlsd: increase initializing timeout
old-commit-hash: b218abcaa3015e6c9202550eddbbc0eff7482729
2024-02-16 13:35:45 -08:00
Adeeb Shihadeh d167a22be5 fix no GPS alert when driving slowly in a tunnel (#31483)
old-commit-hash: d31269f6639b86405708f05c098ac1fd665c3107
2024-02-15 11:52:57 -08:00
Adeeb Shihadeh 4a713f4ff7 log all startups
old-commit-hash: 194bd85905348a66a44ba54a053424dbfcdaeb36
2024-02-14 11:44:19 -08:00
Adeeb Shihadeh adcac1f207 SubMaster: improve service aliveness checks (#31391)
* bump cereal

* fix

* fixes

* single poll

* bump

* bump

---------

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 279d2c3b2319bab73bbc9ed103911b6df3b0dc02
2024-02-12 10:11:37 -08:00
Adeeb Shihadeh b4c03185d4 bump cereal (#31392)
* bump cereal

* update those

* update refs

* bump cereal

* bump

* bump cereal

* bump

* fix

* bump

* typo:
old-commit-hash: daceb171bde5aef4ea483e8054456187772afe92
2024-02-09 21:44:23 -08:00
Adeeb Shihadeh 2da00d3142 controlsd: log initializing timeouts
old-commit-hash: 013d4bd4ce0ff7060f4366f504e1bd909d7dc117
2024-02-08 21:26:07 -08:00
Greg Hogan 14e12980f5 simplify git remote is comma check (#31284)
* simplify git remote is comma check

* cast to str

* eliminate default and always return string

* add type annotation for cache decorator

* fix up default handling
old-commit-hash: 7affba06d89b366d98f42c4ea3a2f904e6ef3357
2024-02-02 21:23:32 -08:00
Harald Schäfer 66dbadb029 Delete lat planner (#31089)
* Initial commit

* Fixup

* typo

* ignore lateral plan

* Update cereal

* Remove lateralPlan

* Fix release build

* Fix release build

* give car params

* Add carParams to include_all_types

* Write car param in powerdraw test

* add demo mode

* Update model regf

* proc replay ref commit

* Try

* Move enum definition

* Update cereal

* typo

* Write car param for modeld test

* Update ref

* Update model ref again

---------

Co-authored-by: Kacper Rączy <gfw.kra@gmail.com>
old-commit-hash: e6c97c384671b448f307a7ed91416886f2186d80
2024-01-21 12:09:48 -08:00
Adeeb Shihadeh 972650f0eb remove dashcam branch (#31081)
* remove dashcam branch

* fix

* more cleanup

* remove param

* one more
old-commit-hash: 7cd9568423a2e78187d16018b70a78f56c02027d
2024-01-19 14:05:03 -08:00
Harald Schäfer f2106e0601 No curv rate for lateral control (#31042)
* No more Curvature rate for lat control

* Update cereal

* Update

* Fix lat control test
old-commit-hash: d36103791c9432155413e1044bcca2ac37bfa852
2024-01-17 16:00:50 -08:00
Adeeb Shihadeh 6315957cf4 remove common.profiler (#30927)
* remove common.profiler

* cleanup
old-commit-hash: f0ccb84ae3ed890fdf5610573a8b8882f4e29d3e
2024-01-06 16:20:28 -08:00
Dean Lee 1d7d7b89b2 common/params: support nonblocking write (#29808)
* Safe and efficient asynchronous writing parameters

* call putNonBlocking in locationd

* remove space

* ->AsyncWriter

* remove semicolon

* use member function

* asyc write multiple times

* add test case for AsyncWriter

* merge master

* add missing include

* public

* cleanup

* create once

* cleanup

* update that

* explicit waiting

* improve test case

* pass prefix to asywriter

* move to params

* assert(queue.empty())

* add comment

* add todo

* test_power_monitoring: remove patch

* rm laikad.py

* fix import

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 3c4c4d1f7f22884f84f0f52ad45ab0412fab1eb5
2023-12-13 20:36:01 -08:00
Adeeb Shihadeh b48abb9511 read params in a thread
old-commit-hash: fe24bdc689f1e3b82e0bec92034a855fd5da78b2
2023-12-13 19:00:22 -08:00
Kacper Rączy 214b38bc69 controlsd: require joystick mode param for the body (#30680)
* Update joystick mode in step

* Stop putting the body in joystick mode by default

* Toggle JoystickDebugMode by default for notCars in process_replay

* Remove subsection about web joystick

* Update param only in non-cars

* Make joystickDebug non-static event, and add it in a loop

* Add comment
old-commit-hash: e62756596b82e4e40d02a30b34d3f3c9960bffe6
2023-12-12 14:14:51 -08:00
Kacper Rączy 9cf15f3c74 locationd: disable locationd temporary error alert on the body (#30608)
* Disable locationd temporary error alert on the body

* Disable locationd/paramsd/planner alerts on body with joystick mode

* joystick_enabled param not joystick_mode
old-commit-hash: 7f07f47302229bcc2694f7c53d1e5ed1236494c8
2023-12-07 10:53:33 -08:00
Adeeb Shihadeh 59eb2988de swaglog.py goes in common/ (#30631)
* swaglog.py goes in common/

* all of these go in release

* we'll even include the pyx
old-commit-hash: 35f819c8239b8ac3a000087a0f791b91ccea5e5e
2023-12-06 17:27:51 -08:00