Commit Graph

125 Commits

Author SHA1 Message Date
Harald Schäfer
f1b8a86464 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
2023-08-25 13:44:03 -07:00
Adeeb Shihadeh
a9626f95b6 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
2023-08-20 20:49:55 -07:00
Shane Smiskol
1a08c2986e Revert "radard: tie radard frequency to modelV2 vol. 2 (#29240)" (#29474)
* Revert "static analysis fixes"

This reverts commit a1e85f3661.

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

This reverts commit 460f5c8e0b.

* update refs
2023-08-18 22:56:43 -07:00
Jason Young
f76ffbdbbc 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>
2023-08-17 21:06:07 -07:00
Jason Young
90c4bbe8e4 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>
2023-08-15 14:17:08 -07:00
Kacper Rączy
460f5c8e0b 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
2023-08-11 18:07:06 -07:00
Justin Newberry
cf64b27168 Linter: Fix >160 line length test (#29287)
* test

* fix line length

* fix line length

* fix file size

* revert poetry

* cleanup for PR
2023-08-08 17:13:35 -07:00
Kacper Rączy
1774b4fc61 Revert "radard: tie radard frequency to modelV2 (#29063)" (#29243)
This reverts commit 255f5c13f2.
2023-08-04 20:25:40 -07:00
Kacper Rączy
255f5c13f2 radard: tie radard frequency to modelV2 (#29063) 2023-08-03 22:10:21 -07:00
Vivek Aithal
3612c12b14 [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
2023-07-21 11:28:48 -07:00
Shane Smiskol
5aebdb0ad0 Car docs: pass docs flag to car interfaces (#27311)
* docs

* docs

* docs

* docs

* use docs in gm
2023-04-18 12:22:22 -07:00
Adeeb Shihadeh
e7c0db457a don't show temp steering faults while overriding (#27797)
Co-authored-by: Comma Device <device@comma.ai>
2023-04-04 11:28:13 -07:00
Vivek Aithal
15b880c0ea 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>
2023-03-29 15:10:39 -07:00
Adeeb Shihadeh
2008332bd4 GM: revert custom Bolt torque tune (#27403)
* Revert "GM: cleanup torque feedforward function (#27347)"

This reverts commit 8c099dd4e5.

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

This reverts commit e49748d571.

* update refs
2023-02-21 15:27:48 -08:00
Vivek Aithal
e49748d571 Chevrolet Bolt: Non-linear torque tune (#27344)
* add non linear tune

* update refs

* rerun tests
2023-02-14 16:20:28 -08:00
Shane Smiskol
8f5057ff2d 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
2023-02-09 15:37:39 -08:00
Cameron Clough
b1e744987f 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
2023-02-02 22:00:49 -08:00
Shane Smiskol
b00bc4f57e 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 🤦
2023-01-12 12:25:24 -08:00
Adeeb Shihadeh
f14deae475 Revert "Car interface: require fingerprint and FW versions to get params (#26766)"
This reverts commit b68dabb689.
2023-01-12 11:28:04 -08:00
Shane Smiskol
b68dabb689 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
2023-01-11 23:44:50 -08:00
Shane Smiskol
9be7e527a9 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
2022-12-13 14:33:20 -08:00
Shane Smiskol
712b9014d7 Car interface: set tire stiffness in common function (#26625)
* common stiffness

* GM uses factors
2022-11-29 12:50:27 -08:00
Vivek Aithal
3a4f19f0ee [controlsd] Refactor apply_deadzone in Lateral Torque Control (#26626)
rename apply_slack to apply_center_deadzone, remove unused prius offline values
2022-11-29 12:46:08 -08:00
Shane Smiskol
860f441e2f 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
2022-11-29 11:49:13 -08:00
Vivek Aithal
0706b03e8c [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
2022-11-29 10:47:13 -08:00
Shane Smiskol
ca37d0c8cc interfaces: disable on falling edge of cancel button (#26493)
* both

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

* update refs
2022-11-07 17:01:24 -08:00
Jason Young
135270f65c Allow car port to define enable buttons (#25793)
* Allow car port to define enable buttons

* simplify

* oops
2022-10-12 16:27:23 -07:00
Vivek Aithal
4fa62f1464 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>
2022-09-19 15:19:26 -07:00
Vivek Aithal
85ed5c4cb5 Torque Refactor (#25822)
* add torque gains refactor

* update refs

* avoid dict, use cereal struct

* bugfix

* no as_builder

* address final comments
2022-09-17 00:07:54 -07:00
Shane Smiskol
ef26abcf65 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>
2022-09-13 23:34:51 -07:00
Shane Smiskol
992707c172 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
2022-09-13 23:20:45 -07:00
Adeeb Shihadeh
655a64b603 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
2022-09-07 17:12:49 -07:00
HaraldSchafer
593dfd0aed Faster a_ego filter (#25646)
* Faster a_ego filter

* :x
Update ref

* typo

* update ref
2022-09-02 16:19:06 -07:00
Shane Smiskol
452d5e42ec 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
2022-08-30 17:54:40 -07:00
Shane Smiskol
e3d3fd0230 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
2022-08-18 23:40:24 -07:00
Shane Smiskol
b6910923d1 vEgoCluster: fix starting from stop (#25350)
* we can't switch back and forth

* update translations
2022-08-03 21:03:53 -07:00
Cameron Clough
2351ae48b9 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>
2022-07-25 13:02:27 -07:00
Willem Melching
c3e95d5e19 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
2022-07-21 14:48:08 +02:00
HaraldSchafer
bdfaa1d1ee 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>
2022-07-11 15:19:55 -07:00
Shane Smiskol
10fb2b9456 Speed up YAML parsing with CSafeLoader (#24958)
Use CSafeLoader
2022-06-24 15:16:46 -07:00
Adeeb Shihadeh
062a8bcdbd cleanup torque tuning config (#24951) 2022-06-24 13:01:49 -07:00
HaraldSchafer
d8bfe2f005 Cleanup car interfaces (#24948)
* remove interface overrides

* Fix test

* set torque tune for ev6
2022-06-22 19:20:07 -07:00
HaraldSchafer
2deaf69789 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
2022-06-22 15:58:06 -07:00
HaraldSchafer
3066ad81a8 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>
2022-06-10 17:57:23 -07:00
Shane Smiskol
c6bc03311c 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...)
2022-06-03 17:41:20 -07:00
Shane Smiskol
3fbbb7f4b0 Common interface attribute function (#24731)
* replace get_attr_from_cars with get_interface_attr

* and not combining the brands

* explicit check

* minimize diff

* values
2022-06-03 04:16:39 -07:00
Shane Smiskol
5b105facae 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
2022-05-02 18:05:00 -07:00
Shane Smiskol
c1caca104f 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>
2022-04-28 22:37:46 -07:00
Shane Smiskol
efa98d2a06 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>
2022-04-26 13:27:28 -07:00