Commit Graph

130 Commits

Author SHA1 Message Date
Harald Schäfer
8960f76597 K1FD: generate kalman gain at init (#29610)
* K1FD: generate kalman gain at init

* Update interfaces.py

* Update interfaces.py

* Update interfaces.py

* Update ref_commit
old-commit-hash: f1b8a86464
2023-08-25 13:44:03 -07:00
Adeeb Shihadeh
16ec56398c add openpilot prefix to imports (#29498)
* add openpilot prefix to imports

* more

* more

* fix docs

* fix linter

* bump submodules

* fix patched tests

* update dynamic imports

* debug

* Revert "debug"

This reverts commit db5e13b9911cc74438bee123bc3430da6c31b24b.

* fix pm test
old-commit-hash: a9626f95b6
2023-08-20 20:49:55 -07:00
Shane Smiskol
1a2818d775 Revert "radard: tie radard frequency to modelV2 vol. 2 (#29240)" (#29474)
* Revert "static analysis fixes"

This reverts commit 2271d0adf9a02aee1359717c47cb6280893a6b9b.

* Revert "radard: tie radard frequency to modelV2 vol. 2 (#29240)"

This reverts commit 6757e90415766e84ad1b6c921a2edb29ceb3bbbe.

* update refs
old-commit-hash: 1a08c2986e
2023-08-18 22:56:43 -07:00
Jason Young
ac83f87b36 interfaces: add common STD_CARGO_KG to mass (#29416)
* cleanup std_cargo_kg

* fix Sonata mass

* remove snowflake construct

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
old-commit-hash: f76ffbdbbc
2023-08-17 21:06:07 -07:00
Jason Young
b4614b3c28 car interfaces: cleanup tire stiffness calculation (#28263)
* cleanup tire stiffness calculation

* bump cereal

* think these todos still apply

* gm: same default

* revert comments

* bump

* update refs

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
old-commit-hash: 90c4bbe8e4
2023-08-15 14:17:08 -07:00
Kacper Rączy
4017b1707c radard: tie radard frequency to modelV2 vol. 2 (#29240)
* radard: tie radard frequency to modelV2

Accumulate parsed messages until state is updated (toyota)

Same for honda

Rename rr to something more descriptive

* Change _update method name, since signature has changed

* Update ref commit

* Some renames

* Check for number of cans
old-commit-hash: 460f5c8e0b
2023-08-11 18:07:06 -07:00
Justin Newberry
7b677910df Linter: Fix >160 line length test (#29287)
* test

* fix line length

* fix line length

* fix file size

* revert poetry

* cleanup for PR
old-commit-hash: cf64b27168
2023-08-08 17:13:35 -07:00
Kacper Rączy
c92e7265a6 Revert "radard: tie radard frequency to modelV2 (#29063)" (#29243)
This reverts commit 4b221cb4fd271664ab7d39c5cfefb4225ca07c2a.
old-commit-hash: 1774b4fc61
2023-08-04 20:25:40 -07:00
Kacper Rączy
79fa322d4a radard: tie radard frequency to modelV2 (#29063)
old-commit-hash: 255f5c13f2
2023-08-03 22:10:21 -07:00
Vivek Aithal
ad986b39cf [GMC ACADIA DENALI 2018] Move to torque control, non-linear feed-forward (#28923)
* move GMC ACADIA to torque control, with a Bolt-like feedforward

* update offline values

* update offline values

* reduce friction

* update values

* update values

* cleanup
old-commit-hash: 3612c12b14
2023-07-21 11:28:48 -07:00
Shane Smiskol
d916e0ed2d Car docs: pass docs flag to car interfaces (#27311)
* docs

* docs

* docs

* docs

* use docs in gm
old-commit-hash: 5aebdb0ad0
2023-04-18 12:22:22 -07:00
Adeeb Shihadeh
fd8e3d180d don't show temp steering faults while overriding (#27797)
Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: e7c0db457a
2023-04-04 11:28:13 -07:00
Vivek Aithal
b6909a65e7 Bolt EUV: Non-linear torque function (#27696)
* add erf based ff

* silly bug; diff of nonlinear != nonlinear of diff

* add sigmoid based ff, ensure slope at 0 > 1

* reduce steer down limit and increase driver allowance

* rebase panda

* atry without friction, and with tanh nonlinear

* finalize the nonlinear function

* do not disable friction compensation in the ff

* bump panda

* bump panda

* update refs

* update refs

* resolve comments

* Add type hints

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 15b880c0ea
2023-03-29 15:10:39 -07:00
Adeeb Shihadeh
956918eb1d GM: revert custom Bolt torque tune (#27403)
* Revert "GM: cleanup torque feedforward function (#27347)"

This reverts commit cdd8f003e3571d4b33fc71c4bc23744cea02140c.

* Revert "Chevrolet Bolt: Non-linear torque tune (#27344)"

This reverts commit b6737ca5903ecaac3d6322b92112ccb67116b149.

* update refs
old-commit-hash: 2008332bd4
2023-02-21 15:27:48 -08:00
Vivek Aithal
5edcf1380e Chevrolet Bolt: Non-linear torque tune (#27344)
* add non linear tune

* update refs

* rerun tests
old-commit-hash: e49748d571
2023-02-14 16:20:28 -08:00
Shane Smiskol
acc8e38111 GM: enforce steering command message timing (#27250)
* draft

* bump opendbc

* still draft

* that's not right

* superset of the changes, 33hz

* cleanup

* this should work

* remove line

* pass it in again

* actually no need to check updated now

* now_nanos

* consistent name

* fix replay

* one line isn't that bad

switch

switch

* fix CarController tests

* Update ref_commit
old-commit-hash: 8f5057ff2d
2023-02-09 15:37:39 -08:00
Cameron Clough
363f26f80c Ford: add Lincoln Aviator 2021 to Ford Explorer platform (#27095)
* add Lincoln Aviator 2021 to Ford Explorer platform

Based on the Ford Explorer, the Aviator has very similar firmware
versions. Add these to the Explorer platform and create a new CarInfo
for the Aviator.

f0709d2bc6ca451f|2022-12-10--12-36-59--0

VIN: 5LM5J7XC8MGL09541

* Ford: new gear shifter signal to support Aviator

* probably don't need these

* don't need to pass None here, it defaults to None

* will rename in DBC

* bump opendbc

* bump process replay ref
old-commit-hash: b1e744987f
2023-02-02 22:00:49 -08:00
Shane Smiskol
0ceb423ccc Car interface: require fingerprint and FW versions to get params (#26932)
* require fingerprint and FW versions

* add get_non_essential_params()

* comment

* all required

* classmethod, need to allow subclasses to override _get_params

* fix that

* fix

* fix

* wrong fix 🤦
old-commit-hash: b00bc4f57e
2023-01-12 12:25:24 -08:00
Adeeb Shihadeh
b67646e1ab Revert "Car interface: require fingerprint and FW versions to get params (#26766)"
This reverts commit ff80ac0f7525916211da2cd0fce2c9c5f35ef89d.

old-commit-hash: f14deae475
2023-01-12 11:28:04 -08:00
Shane Smiskol
28ceb52c33 Car interface: require fingerprint and FW versions to get params (#26766)
* require fingerprint and FW versions

* add get_non_essential_params()

* comment

* all required

* classmethod, need to allow subclasses to override _get_params

* fix that

* fix
old-commit-hash: b68dabb689
2023-01-11 23:44:50 -08:00
Shane Smiskol
82be7d0b1b HKG CAN-FD: steering pressed filter (#26789)
* steering pressed filter

* use a counter

* parameterize

* double

* filter doesn't instantly reset on falling edge of true steering pressed

* Update selfdrive/car/interfaces.py

* Update selfdrive/car/interfaces.py

* Update selfdrive/car/hyundai/carstate.py

* add comment

* the pain of committing without pycharm

* more like a filter

* Update ref_commit
old-commit-hash: 9be7e527a9
2022-12-13 14:33:20 -08:00
Shane Smiskol
d6f6b0de91 Car interface: set tire stiffness in common function (#26625)
* common stiffness

* GM uses factors
old-commit-hash: 712b9014d7
2022-11-29 12:50:27 -08:00
Vivek Aithal
238e63bc2a [controlsd] Refactor apply_deadzone in Lateral Torque Control (#26626)
rename apply_slack to apply_center_deadzone, remove unused prius offline values
old-commit-hash: 3a4f19f0ee
2022-11-29 12:46:08 -08:00
Shane Smiskol
8aadc8dda6 Car interface: set common params after port (#26613)
* remove pylint exception, _get_params takes no defaults

* clean up

* mock uses it too

* unused

* unused

* fix that

* bump

* Update selfdrive/car/interfaces.py
old-commit-hash: 860f441e2f
2022-11-29 11:49:13 -08:00
Vivek Aithal
5bc529bf20 [controlsd] Toyota Prius 2017 (#26455)
* increase lag on prius

* better offline values computation

* split prius ecu more, set deadzone to 0

* add deadzone back

* replace deadzone with slack

* reduce deadzone to 0.2

* update refs
old-commit-hash: 0706b03e8c
2022-11-29 10:47:13 -08:00
Shane Smiskol
a570984aa3 interfaces: disable on falling edge of cancel button (#26493)
* both

* Update ref_commit
old-commit-hash: ca37d0c8cc
2022-11-13 20:50:28 -08:00
Vivek Aithal
3029919422 [torqued] Fix high speed oscillations (#26338)
* modify low speed factor during high speeds and rescale friction

* update refs
old-commit-hash: e9eb5d99ff
2022-11-07 17:01:24 -08:00
Jason Young
914c75d9ea Allow car port to define enable buttons (#25793)
* Allow car port to define enable buttons

* simplify

* oops
old-commit-hash: 135270f65c
2022-10-12 16:27:23 -07:00
Vivek Aithal
51d25b2011 Live torque (#25456)
* wip torqued

* add basic logic

* setup in manager

* check sanity and publish msg

* add first order filter to outputs

* wire up controlsd, and update gains

* rename intercept to offset

* add cloudlog, live values are not updated

* fix bugs, do not reset points for now

* fix crashes

* rename to main

* fix bugs, works offline

* fix float in cereal bug

* add latacc filter

* randomly choose points, approx for iid

* add variable decay

* local param to capnp instead of dict

* verify works in replay

* use torqued output in controlsd

* use in controlsd; use points from past routes

* controlsd bugfix

* filter before updating gains, needs to be replaced

* save all points to ensure smooth transition across routes, revert friction factor to 1.5

* add filters to prevent noisy low-speed data points; improve fit sanity

* add engaged buffer

* revert lat_acc thresh

* use paramsd realtime process config

* make latacc-to-torque generic, and overrideable

* move freq to 4Hz, avoid storing in np.array, don't publish points in the message

* float instead of np

* remove constant while storing pts

* rename slope, offset to lat_accet_factor, offset

* resolve issues

* use camelcase in all capnp params

* use camelcase everywhere

* reduce latacc threshold or sanity, add car_sane todo, save points properly

* add and check tag

* write param to disk at end of route

* remove args

* rebase op, cereal

* save on exit

* restore default handler

* cpu usage check

* add to process replay

* handle reset better, reduce unnecessary computation

* always publish raw values - useful for debug

* regen routes

* update refs

* checks on cache restore

* check tuning vals too

* clean that up

* reduce cpu usage

* reduce cpu usage by 75%

* cleanup

* optimize further

* handle reset condition better, don't put points in init, use only in corolla

* bump cereal after rebasing

* update refs

* Update common/params.cc

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

* remove unnecessary checks

* Update RELEASES.md

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 4fa62f1464
2022-09-19 15:19:26 -07:00
Vivek Aithal
3326487104 Torque Refactor (#25822)
* add torque gains refactor

* update refs

* avoid dict, use cereal struct

* bugfix

* no as_builder

* address final comments
old-commit-hash: 85ed5c4cb5
2022-09-17 00:07:54 -07:00
Shane Smiskol
cfc3213ac1 ui: support ego speed hysteresis (#25702)
* toyota: match set speed from dash

* Use unit bit

* Use RSA2

* flip this

* Universal unit signal, set vEgoCluster

* remove this and bump opendbc

* detect if car interface sets cluster fields

* revert

* needs to be cp

* UI_SPEED is actually always in kph?

* forgot to actually convert it

* same in onroad

* try conv factor only for imperial

* Seems like UI_SPEED is not the UI speed at all

* the dash might floor it

* same openpilot behavior

* bump

* ego speed factor is dynamic across speeds, handle Lexus exceptions with
diff msg

* remove test, bump opendbc

* secret formula

* secret formula v2

* 1.03 is sufficient

* try short press

* bump opendbc

* surely this can be cleaned up

surely this can be cleaned up

* use filter

* redo factors

* try UI_SPEED again with a factor

try UI_SPEED again with a factor

* dash applies hysteresis to speed. this matches pretty well, but not exactly

* make hysteresis generic

* clean up

* revert this

* try this

* read from fake params

* should be mostly good for imperial now

* revert

* revert

* remove toyota stuff

* common function for everyone

* rm line

* fix

* an example with Toyota

* use CS.out

* one mph

* 1 kph

* cmt

* remove cmt

* abs it

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: ef26abcf65
2022-09-13 23:34:51 -07:00
Shane Smiskol
c1b9a202aa controls: enter overriding state for steering override (#25617)
* lateral overriding is overriding

* Update test

* remove

* also could do something like this and only have one OVERRIDE ET

* Revert "also could do something like this and only have one OVERRIDE ET"

This reverts commit 5c381641c08961676a56a9718fbdaa84989ac249.

* full names

* bump cereal

* test every event type

* update refs
old-commit-hash: 992707c172
2022-09-13 23:20:45 -07:00
Adeeb Shihadeh
e4f9781c17 single longitudinal toggle for e2e and disable radar (#25688)
* single longitudinal toggle for e2e and disable radar

* write disable radar param

* rename

* better param name

* clean that up

* update refs

* update translations

* not live for experimental

* write it out

* vanish
old-commit-hash: 655a64b603
2022-09-07 17:12:49 -07:00
HaraldSchafer
754fb9306b Faster a_ego filter (#25646)
* Faster a_ego filter

* :x
Update ref

* typo

* update ref
old-commit-hash: 593dfd0aed
2022-09-02 16:19:06 -07:00
Shane Smiskol
1fcc31aac6 Car docs: add auto-resume column (#25572)
* Move auto resume in sng to car interface

* Update docs

* shorter name, star

* order

* resumes?

* add hidden detail sentence

* good to know this works, but revert

* VW auto resume

* bump cereal to master

* Update ref_commit

* match cereal

* try this

* ?

?

* like this
old-commit-hash: 452d5e42ec
2022-08-30 17:54:40 -07:00
Shane Smiskol
c3342795f2 Common button enable/cancel event creation (#25445)
* handle button presses in create_common_events

* remove from imports

* Handle

* Fix Honda (it hardcodes pcmCruise)

* Update selfdrive/car/volkswagen/interface.py

* Update selfdrive/car/volkswagen/interface.py
old-commit-hash: e3d3fd0230
2022-08-18 23:40:24 -07:00
Shane Smiskol
83ff495062 vEgoCluster: fix starting from stop (#25350)
* we can't switch back and forth

* update translations
old-commit-hash: b6910923d1
2022-08-03 21:03:53 -07:00
Cameron Clough
92d21da552 Ford: fix gear parsing (#25267)
* Ford: fix gear shifter state

* Ford: manumatic is drive

* add full gear names to CarStateBase

* fix for unrecognised gears

* Update interfaces.py

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 2351ae48b9
2022-07-25 13:02:27 -07:00
Willem Melching
95fb15aa5f prereq for matching speeds shown on cars dash (#25222)
* prereq for matching speeds shown on cars dash

* also handle fallback in the ui for replay

* update translations

* update ref
old-commit-hash: c3e95d5e19
2022-07-21 14:48:08 +02:00
HaraldSchafer
be57ba1b0f Ram 1500 torque tune (#25117)
* torque control again

* 3mss per s

* no bad sensors

* tweaks

* Need more checks before we can do this

* update refs

* only ram for now

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: bdfaa1d1ee
2022-07-11 15:19:55 -07:00
Shane Smiskol
275b7eac20 Speed up YAML parsing with CSafeLoader (#24958)
Use CSafeLoader
old-commit-hash: 10fb2b9456
2022-06-24 15:16:46 -07:00
Adeeb Shihadeh
145f3c96ba cleanup torque tuning config (#24951)
old-commit-hash: 062a8bcdbd
2022-06-24 13:01:49 -07:00
HaraldSchafer
ce87f9af2f Cleanup car interfaces (#24948)
* remove interface overrides

* Fix test

* set torque tune for ev6
old-commit-hash: d8bfe2f005
2022-06-22 19:20:07 -07:00
HaraldSchafer
0282b746f4 Refactor torque stuff (#24921)
* Refactor torque stuff

* Add to release

* Add substitute and override

* Maxlataccel is required

* Add to asserts

* add ideal car

* Need china too

* yamls already linted

* Fixed some bugs

* Fixup

* Unreliable data

* Add cehck

* Better comment

* ref commit update
old-commit-hash: 2deaf69789
2022-06-22 15:58:06 -07:00
HaraldSchafer
f7edd5f3d3 Car interface: set max lateral torque from table (#24789)
* json

* better naem

* Read from table

* formatting and default to nan

* Generate docs

* Read from table

* this should be the same

* Prius v is full

* test we always set the tunes correctly

add to release files

* Set for all cars

Set for all cars

* Revert tuning changes

Revert tuning changes

* remove that

* fixes

* update ref commit for new maxLateralAccels

Co-authored-by: Shane Smiskol <shane@smiskol.com>
old-commit-hash: 3066ad81a8
2022-06-10 17:57:23 -07:00
Shane Smiskol
1a2bf8412c Car documentation: set steering torque star using car interface (#24709)
* Set good torque using torque controller tuning

* should be equal to

* save lateral accel to car params

* use maxLateralAccel

* always

* same convention

* nan will always evaluate to false

* The great good torque purge

* adjust default friction

* Add data for more cars

* adjust name

* Welcome back, guys. Only adjust good torque if maxLatAccel is set

* Update refs (1.7 is 1.7000001...)
old-commit-hash: c6bc03311c
2022-06-03 17:41:20 -07:00
Shane Smiskol
c0c0250077 Common interface attribute function (#24731)
* replace get_attr_from_cars with get_interface_attr

* and not combining the brands

* explicit check

* minimize diff

* values
old-commit-hash: 3fbbb7f4b0
2022-06-03 04:16:39 -07:00
Shane Smiskol
e63294da62 Add ACC faulted status to carState (#24399)
* add accFaulted bool to carState

* same for VW

* remove import

* bump

* move to common

* bump cereal to master
old-commit-hash: 5b105facae
2022-05-02 18:05:00 -07:00
Shane Smiskol
754b93997a Support RAV4 Hybrid 2022 with stock longitudinal (#23969)
* add panda flag for toyota stock long with camera

* clean up

* Add 2022 RAV4 Hybrid from Philly

* fix wrong fw in interface, did this ever work?

* Must be a hybrid

* no radar parsing

* fix can error

* move to own platform

* generate docs

* fix

* Add 2022 Rav4 XSE Australia fingerprint parameters (#24303)

* Update values.py

Add 2022 Rav4 XSE Australia

* add commas

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

* bump panda

* wait, the camera doesn't even send 0x343, right?

* use a set instead, more obvious

* don't test without a parser

* bump panda

* flip panda flag

* bump panda

* add commas

* regen and update refs

* set to none by default

* revert parenthesis

* update comment

* bump panda

* regen and update refs

* add test models and update readme

* bump to master

Co-authored-by: BrettLynch123 <34538435+BrettLynch123@users.noreply.github.com>
old-commit-hash: c1caca104f
2022-04-28 22:37:46 -07:00
Shane Smiskol
5469375c91 HKG: only allow engagement on user button press (#24140)
* use deque for prev_cruise_buttons

* stash

* disallow engagement if resume or decel isn't pressed

* fix buttons

* reduce chances of causing 30-frame fault

Fix clu11

drive down cancel times

* Revert "reduce chances of causing 30-frame fault"

This reverts commit 0f54c051bf5a22b1f584718ec46e78bc3a82a0dd.

* consider pause/resume button

* stash

* Revert "stash"

This reverts commit 551ca7be6c45729f0747abc81cd81894cd621c32.

* sadly some cars need 8 op frames (identical to 4 updates from CLU11)

* add main button

* 6 should be safe

* use max

* clean up

* change to 4 samples and process all messages received, like panda

* bump panda

* test: replay segments with known re-engagements on-device

* Revert "test: replay segments with known re-engagements on-device"

This reverts commit 9730c3c14f942b82b6ed5ef2e81b8ae0126f3006.

* need prev_cruise_buttons as we don't run every CAN message through carstate

* more generic

* extend

* Update selfdrive/car/interfaces.py

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

* 3% faster at 1000000 loops

* update refs

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: efa98d2a06
2022-04-26 13:27:28 -07:00