Commit Graph

738 Commits

Author SHA1 Message Date
Mitchell Goff b470bef140
Fix low-speed allow_throttle behavior in long planner (#33894)
* Misc fixes

* don't check allow_throttle slowdown for e2e

* Removed unused variable

* believe this clip is still necessary

* Update process replay refs

---------

Co-authored-by: Bruce Wayne <harald.the.engineer@gmail.com>
2024-10-30 14:15:19 -07:00
Shane Smiskol b943cbd421
Reapply "Remove steering wheel offset for planner slow down for curves" (#33848) (#33849)
* Reapply "Remove steering wheel offset for planner slow down for curves" (#33848)

This reverts commit 4f8b11257e.

* careless

* Update ref_commit
2024-10-24 19:24:11 -07:00
Kacper Rączy 0ff498cc83
longitudinal_planner: allow for zero actuator delay (#33855)
Allow zero actuator delay
2024-10-22 20:49:10 -07:00
Shane Smiskol 4f8b11257e
Revert "Remove steering wheel offset for planner slow down for curves" (#33848)
Revert "Remove steering wheel offset for planner slow down for curves (#33827)"

This reverts commit d26730ffd5.
2024-10-22 12:58:06 -07:00
Tim Wilson d26730ffd5
Remove steering wheel offset for planner slow down for curves (#33827)
* long planner: use vehicle model w/ avg steer offset for limit accel in turns

* remove unused CP in limit_accel_in_turns

* revert use of vehicle model, keeping angle offset in limit accel in turns

* only the offset fix, check valid, and fix process replay

* update refs (valid two frames later)

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2024-10-22 12:50:06 -07:00
Shane Smiskol af727d41bb
long planner: allow throttle reflects usage (#33792)
* UI is now accurate

* update refs
2024-10-14 20:54:42 -07:00
Shane Smiskol 7556233cca
Reapply "move car.capnp to opendbc (#33722)" (#33728)
* Reapply "move car.capnp to opendbc" (#33725)

This reverts commit 9d52a5b485.

* why can't i repro?!

* Revert "why can't i repro?!"

This reverts commit 0435d218f7.

* does this cause card to try and read it?

* better place

* wtf

* Reapply "why can't i repro?!"

This reverts commit d24fd5a0ab.

* also here
2024-10-03 22:47:03 -07:00
Shane Smiskol 9d52a5b485
Revert "move car.capnp to opendbc" (#33725)
Revert "move car.capnp to opendbc (#33722)"

This reverts commit 8149f7cb11.
2024-10-03 16:57:45 -07:00
Shane Smiskol 8149f7cb11
move car.capnp to opendbc (#33722)
* move car.capnp to opendbc

* bump

* do card

* fix some more tests

* rm helpers

* format fp

* more

* whoops

* bump

* bump to master
2024-10-03 16:40:24 -07:00
Mitchell Goff 47cc314b14
Gate acceleration on model gas press predictions (#33643)
* no ui squash

* already calibrated

* Already calibrated

* Add longitudinal maneuver tests

* Fix linter errors

* Added get_coast_accel function

---------

Co-authored-by: Bruce Wayne <harald.the.engineer@gmail.com>
2024-09-30 18:13:51 -07:00
YassineYousfi 36a9687d5d
long planner: use temporalPose for v_model_error calibration (#33655)
* long planner: add flag to disable v_model_error calibration

* use temporal pose instead of flag

* udpate model replay ref
2024-09-26 11:01:56 -07:00
Harald Schäfer e8bea2c78f
Tomb Raider Model (#33629)
* 69acff08-5383-4103-beea-822f0d228c76/160

* 53f39907-4763-4d19-ba26-e757527c2b61/200

* 21afb89f-1397-4652-b423-abc2da32417a/200

* 21afb89f-1397-4652-b423-abc2da32417a/400

* 53f39907-4763-4d19-ba26-e757527c2b61/400

* 3fb967fd-16a8-4569-ba57-359e54deeab3/395

* Try other policy again

* 3fb967fd-16a8-4569-ba57-359e54deeab3/400

* 0136cabf-539a-4a43-bc7f-06c3654a493c/4400

* 473c0686-1ac9-4c05-9b0b-d1f1afdb6cc3/400

* 83b7993d-51a9-4e3f-904e-3fcd5763c231/400

* 021566c7-cff3-431d-8da2-17a96c888c5f/400

* Fix bugs

* Update longitudinal_planner.py

* Update fill_model_msg.py

* 8be6b59d-4449-42fd-b8e0-93c48387070f/400

* f670a748-3591-4489-a0b3-215118ddad01/400

* 790a2950-c713-4eec-838b-4f55f4fe0ccb/400

* Update model ref

* Plans start at ego

* Update ref
2024-09-23 14:26:28 -07:00
Shane Smiskol 2e6e977c93
Longitudinal planner: wait for valid cruise speed (#33568)
* Revert "only vCruise changes here"

This reverts commit 4f5659b5d5.

* less nonsense
2024-09-16 16:06:02 -07:00
Adeeb Shihadeh e04455cbaa
selfdrived: controlsd only does controls (#33485)
* selfdrived

* process replay

* lil more

* set the valids

* rename that
2024-09-06 17:16:32 -07:00
Adeeb Shihadeh aef650013e
controlsd: split up publishing and logic (#33483)
* split up the pubs

* move all event adds

* split out alerts

* lil more

* clenaup

* update test

* cleanup
2024-09-05 16:28:57 -07:00
Adeeb Shihadeh 73d31d50c4
controlsd: pull out LDW (#33479)
* controlsd: pull out LDW

* cleanup

* good ol mypy
2024-09-04 17:45:09 -07:00
Adeeb Shihadeh 77f4f57e73
controlsd: pull out selfdrive state machine (#33477)
* controlsd: pull out selfdrive state machine

* cleanup test

* cleanup
2024-09-04 16:44:28 -07:00
Shane Smiskol d0f0632f78 interfaces returns RadarInterfaces (#33444)
* interfaces returns radarinterface

* bump

* bump

* bump
old-commit-hash: f94ef10df7
2024-09-03 19:17:25 -07:00
Adeeb Shihadeh bd2b09c7b6 Deprecate controlsState state fields (#33437)
* Deprecate controlsState state fields

* sim works

* update refs

* one more

* these too

* update sim
old-commit-hash: 3924ac587b
2024-09-03 14:40:23 -07:00
Adeeb Shihadeh 53288d4dbf Move vCruise to card (#33439)
* Move vCruise to card

* cleanup drive_helpers

* works in sim

* update refs

* update that

* too slow :(
old-commit-hash: 2f3256ed8b
2024-09-02 17:18:43 -07:00
Adeeb Shihadeh 7575c707f1 carEvent -> onroadEvent (#33432)
old-commit-hash: c481f11833
2024-09-01 11:31:39 -07:00
royjr dbe0866a6f ui: show personality updates (#33406)
* personality-alerts

* Update events.py

* Update car.capnp

* no AudibleAlert

* shorter

* no VisualAlert

* one liner

* smaller

* normal

* what am I doing wrong?

* it works, but is it messy?

* arg all

* lil more

* update that

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 35da93fa95
2024-08-31 20:38:34 -07:00
Adeeb Shihadeh 1b2bc44227 controlsd: split out state/alerts into selfdriveState (#33421)
* setup selfdriveState

* little more

* update refs

* migration

* all too slow
old-commit-hash: 87051803ab
2024-08-31 18:48:17 -07:00
Adeeb Shihadeh 60549c9557 controlsd: deprecate alertBlinkingRate (#33422)
* controlsd: deprecate alertBlinkingRate

* simplify

* update refs
old-commit-hash: f4e101c67d
2024-08-31 17:58:02 -07:00
Adeeb Shihadeh fecf6134ef move PID controller to common/ (#33419)
old-commit-hash: f59a1bf003
2024-08-31 16:49:29 -07:00
Dean Lee 2871822bd2 drive_helpers.py: iterate button_timers with items() (#33351)
iterate button_timers with items()
old-commit-hash: 13e58d33db
2024-08-21 11:03:55 -07:00
Shane Smiskol 4f019b5f60 move selfdrive/car to opendbc (#32630)
* move most of /car

* move some car tests

move some car tests

* fix selfdrive/car/tests

* fix selfdrive/controls tests

* fix the rest of the selfdrive tests

* bump opendbc

* fix all tests

* few more non-test references

* remove opcar and move docs to car

fix these debugging scripts

fix docs

* bump opendbc and panda

forgot panda
old-commit-hash: e735a7f379
2024-08-17 00:54:51 -07:00
Shane Smiskol 95224db413 selfdrive/car: ban cereal and capnp (#33208)
* ban cereal and msgq

* common too

* do toyota/values.py

* do all fingerprints

* example without builder

* this still works, but no type checking anymore

* stash

* wtf, how does this work

* okay actually not bad

* safe

* epic!

* stash data_structures.py

* some clean up

* hell yeah

* clean up old file

* add to delete

* delete

This reverts commit 90239b7797.

* switch more CarParams stuff over

remove unused

* fix car tests by removing cereal! mypy forgets about dataclass if we wrap it :(

* fix this too

* fix this too

* remove more cereal and add some good hyundai tests

* bunch more typing

* override default with 20hz radar

* temp capnp converter helper

* more lateralTuning

* small union replicator is better than what i was trying, and fixes mypy dynamic typing issues

* can keep all this the same now!

* type ret: CarParams, add more missing structs, revert lateralTuning changes (smaller diff!)

* revert more

* get first enum automatically, but ofc mypy doesn't pick up the new metaclass so can't use :(

would have been `CarParams.NetworkLocation()`

* Revert "get first enum automatically, but ofc mypy doesn't pick up the new metaclass so can't use :("

This reverts commit bb28b228be.

* remove cereal from car_helpers (TODO: caching)

* remove a bunch of temp lines

* use dataclass_transform!

* remove some car.CarParams from the interfaces

* remove rest of car.CarParams from the interfaces

* same which() API

* sort

* from cereal/cache from fingerprinting!

* more typing

* dataclass to capnp helper for CarParams, cached it since it's kinda slow

* (partial) fix process replay fingerprintig for new API

* latcontrollers take capnp

* forgot this

* fix test_models

* fix unit tests

* not here

* VehicleModel and controller still takes capnp CP since they get it from Params()

* fix modeld test

* more fix

* need to namespace to structs, since CarState is both class and struct

* this was never in the base class?!

* clean that up again

* fix import error

fix import error

* cmts and more structs

* remove some more cereal from toyota + convert CarState to capnp

* bruh this was wrong

* replace more cereal

* EventName is one of the last things...

* replace a bunch more cereal.car

* missing imports

* more

* can fix this typing now

* proper toyota+others CS typing!

* mypy can detect return type of CS.update() now

* fix redeclaration of cruise_buttons type

* mypy is only complaining about events now

* temp fix

* add carControl struct

* replace CarControl

i hope there's no circular imports in hyundai's CC

* fine now

* lol this was wrong too

* fix crash

* include my failed attempts at recursively converting to dataclass (doesn't implicitly convert types/recursively :( )

but attrs does, maybe will switch in the future

* clean up

* try out attr.s for its converter (doesn't work recursively yet, but interesting!)

* Revert "try out attr.s for its converter (doesn't work recursively yet, but interesting!)"

This reverts commit ff2434f7bb.

* test processes doesn't fail anymore (on toyota)!

* fix honda crash

* stash

* Revert "stash"

This reverts commit c1762af4e7.

* remove a bunch more cereal!

* LET'S GOOO

* fix these tests

* and these

* and that

* stash, something is wrong with hyundai enable

* Revert "stash, something is wrong with hyundai enable"

This reverts commit 39cf327def.

* forgot these

* remove cereal from fw_versions

* Revert "remove cereal from fw_versions"

This reverts commit 232b37cd40.

* remove rest of the cereal exceptions!

* fix that

* add typing to radard since I didn't realize RI.update() switched from cereal to structs

* and here too!

* add TODO for slots

* needed CS to be capnp, fix comparisons, and type hint car_specific so it's easier to catch type issues (capnp isn't detected by mypy :( )

* remove the struct converter

* save ~4-5% CPU at 100hz, we don't modify after so no need to deepcopy

btw pickle.loads(pickle.dumps()) is faster by ~1% CPU

* deepcopy -> copy: we can technically make a reference, but copy is almost free and less error-prone

saves ~1% CPU

* add non-copying asdict function

* should save ~3% CPU (still 4% above baseline)

* fix that, no dict support

* ~27% decrease in time for 20k iterations on 3X (3.37857 -> 2.4821s)

* give a better name

* fix

* dont support none, capitalize

* sheesh, this called type() on every field

* remove CS.events, clean up

* bump card %

* this was a bug on master!

* add a which enum

* default to pid

* revert

* update refs

* not needed, but consistent

* just Ecu

* don't need to do this in this pr

* clean up

* no cast

* consistent typing

* rm

* fix

* can do this if we're desperate for the last few %

* Revert "can do this if we're desperate for the last few %"

This reverts commit 18e11ac788.

* type this

* don't need to convert carControl

* i guess don't support set either

* fix CP type hint

* simplify that
old-commit-hash: 6a15c42143
2024-08-16 15:13:00 -07:00
Kacper Rączy 80bc61dc6c controlsd: use livePose (#33283)
* Pose calibrator

* Fix static analysis

* Fix static

* Fix test_latcontrol

* Fix test_latcontrol

* Update services in process replay

* Fix static

* Matmul not mul

* Add assertion

* Move pose calibration to data_sample

* Update ref commit

* Remove llk from cycle alerts

* Deprecated nogps event

* Switch power_draw to lp

* Bring back noGps alert

* Add handling code back

* get_bool

* Bring inputsok back
old-commit-hash: 9734015bbb
2024-08-13 21:11:16 -07:00
Hoang Bui 025395ca43 tools/sim: resolve import error on MacOS running Metadrive (#33244)
fix dynamic lib linking on mac
old-commit-hash: c06d975ec4
2024-08-09 23:12:40 -07:00
Shane Smiskol c45e72dd2f remove more car import exceptions (#33193)
* remove another exception (remove mention of events from car stack)

* guess this should've been here all along

* reorganize exceptions

* fix
old-commit-hash: 06216d43bb
2024-08-05 17:27:28 -07:00
Shane Smiskol 799fabd707 Reapply "update to new opendbc API (#32009)" (#33151)
This reverts commit f2f01e3afaeaa267af61c8d7ab918da04d3411f2.
old-commit-hash: 7c112341c3
2024-07-31 15:37:39 -07:00
Shane Smiskol 2c11e7b49a Revert "update to new opendbc API (#32009)"
This reverts commit d21755b2e216c3f547db0b55b7088357c4368801.

old-commit-hash: ac130001cc
2024-07-31 02:38:44 -07:00
Dean Lee 2f1ee6e832 update to new opendbc API (#32009)
* use new opendbc api

* export pandad_python

* merge master

* merge master

* bump opendbc

* bump opendbc

* improve func

* keep interface unchanged

* fix test_car_interfaces

* bump opendbc

* bump opendbc

* fix test_models

* the interface now has to convert from can capnp to list, so we should include this time

* goes from ~210 to ~240 mean ms real time

* remoe busTime

* lowercase sendcan

* consistent msgtype

* bump

* bump

* not used in lat_mpc

* space

* bump to master

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
old-commit-hash: 0dddc97dca
2024-07-31 00:24:46 -07:00
Shane Smiskol 2cb381997f cars: remove some external imports (#33133)
* ford and gm

* clean that up

* also this

* honda

* temp fix

* move into selfdrive.car

* clean up

* more
old-commit-hash: 0739d79a51
2024-07-30 14:27:27 -07:00
Maxime Desroches 6c1d7358f0 unpin numpy (#33132)
* unlock numpy

* remove old cache

* sheel

* lock

* remove temp

* depends

* export

* put this back

* use __version__

* move this

---------

Co-authored-by: quebec <quebec@quebec.attlocal.net>
old-commit-hash: 9536dd07c6
2024-07-30 13:11:05 -07:00
Maxime Desroches a78c63cf7b Remove control usage (#33103)
* manual matrix exp

* remove control
old-commit-hash: 01c0756974
2024-07-29 11:52:33 -07:00
Harald Schäfer 543e691203 Longcontrol: engage into stopped state when needed (#33042)
test stay stopped
old-commit-hash: 3bc1b173d2
2024-07-23 13:55:30 -07:00
Jason Wen 0a667d79d0 espActive: `IMMEDIATE_DISABLE` -> `SOFT_DISABLE` (#33003)
* espActive: `IMMEDIATE_DISABLE` -> `SOFT_DISABLE`

* only stock long

* just soft disable for now

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
old-commit-hash: a654e5bd05
2024-07-22 13:09:00 -07:00
Greg Hogan a3aa8c5eaf use rounded constant instead of hard-coded value for incrementing set speed (#32992)
* use rounded constant instead of hard-coded value for incrementing set speed

* better comment
old-commit-hash: 4b794773b0
2024-07-16 18:24:01 -07:00
Shane Smiskol a878118b00 Revert "selfdrive/car: ban imports from external modules" (#32993)
Revert "selfdrive/car: ban imports from external modules (#32973)"

This reverts commit c1e8ff2dbc47ccb07fb41a4e88bfb66af2669254.
old-commit-hash: 35a4a773f1
2024-07-15 11:14:04 -07:00
Dean Lee 58df39a2ba selfdrive/car: ban imports from external modules (#32973)
* lint import

* Update selfdrive/car/__init__.py

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
old-commit-hash: 83d4623590
2024-07-15 11:12:24 -07:00
Shane Smiskol 68fc530eca long planner: formatting
old-commit-hash: 71dd1e2ff6
2024-07-11 14:06:51 -07:00
Shane Smiskol 3953eba4ac controlsd: no mutable carParams (#32381)
* no as builder

* fix car int test

* more
old-commit-hash: c95b58401a
2024-07-02 13:27:45 -07:00
James 7606bf60ad Cleanup "longitudinalPlan" fields (#32845)
old-commit-hash: 046ed7e9f8
2024-06-26 14:51:27 -07:00
Jason Wen ecb9dfecff Hyundai CAN: Log ABS/ESP Activation to `espActive` (#32743)
* Hyundai CAN: Log active ABS to accFaulted

* Add comments

* `espActive` to CarState and CarEvent.EventName

* re-order

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
old-commit-hash: 36eafc0dc6
2024-06-24 20:14:57 -07:00
Harald Schäfer b4a0c211f0 Long planner: small cleanup (#32804)
old-commit-hash: 442e9f4ae4
2024-06-20 16:33:06 -07:00
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: bc303df6a0
2024-06-14 00:08:58 -07:00
Harald Schäfer d9fb61da16 Long control: Double delay is super complicated (#32694)
* Double delay is super complicated

* No more upper bound

* DEAD

* Update ref
old-commit-hash: 965415135a
2024-06-10 22:29:17 -07:00
Harald Schäfer 7e4edcc8d5 MSGQ refactor: cleanup outstanding issues (#32685)
* Rm sim dockerfile from bad merge

* Add watch back

* Fix watch3 compilation
old-commit-hash: 1b2bd205b8
2024-06-10 13:18:47 -07:00