Commit Graph

44 Commits

Author SHA1 Message Date
Justin Newberry
3a6c3315ab Subaru: move to flags within PlatformConfig (#31584)
* flags

* update ref

* use the flags directly

* use post_init (don't freeze)

* we can maintain frozen with custom class

* not preglobal

* move to common

* cleanup
2024-02-28 20:12:14 -08:00
Justin Newberry
d4c497d826 add CarControllerBase base class to all CarControllers (#31630)
just base class for now
2024-02-28 17:13:44 -08:00
Justin Newberry
f845c69b43 Subaru: ignore eyesight faults when openpilot is controlling long (#30390)
ignore eyesight faults
2023-11-23 11:10:44 -08:00
Justin Newberry
60b21b55d2 Subaru: initial eyesight disable support (#30373)
* initial eyesight disable

* disable_eyesight

* comment
2023-11-06 22:13:39 -08:00
Justin Newberry
fb06b98667 Subaru: remove 2020+ temporary steering faults (#29116)
* subaru steer faults

* it takes a bool now

* Update selfdrive/car/subaru/carcontroller.py

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

* that was removed

* should be abs

* bump panda

* bump panda

* subaru faults

* add fixme

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

* review suggestions

* still want zero steer when lat not active

* bump submodules

* move it under the non-preglobal section

* better comment for steer limited

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

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-09-07 15:28:46 -07:00
Justin Newberry
338288df6e Subaru: don't copy eyesight counters, calculate manually (#29533)
* subaru manual counters

* update ref

* that isn't used

* review suggestions
2023-09-06 16:08:59 -07:00
Justin Newberry
3348cd3825 Subaru: cleanup and fix preglobal (#29690)
* cleanup and fix preglobal

* those are also duplicates
2023-08-28 19:37:04 -07:00
Shane Smiskol
3719be8b76 Subaru: Forester Hybrid 2020 dashcam (#24770)
* Add support for Forester Hybrid 2020

Co-authored-by: martinl <martin@mlp.ee>

* it's a param now

* make it work

* fix

* merge and cleanup

* remove duplicate

* should be forester

* bump submodules

* should be abs

* add missing params

* still need a test route

* still need a test route

* consitent

* here too

* todo

* more

* Update selfdrive/car/tests/routes.py

* clean up

---------

Co-authored-by: martinl <martin@mlp.ee>
Co-authored-by: Justin Newberry <jnewberry0502@gmail.com>
2023-08-23 21:30:12 -07:00
Adeeb Shihadeh
973d90be77 Subaru: Crosstrek Hybrid dashcam mode (#25378)
* Subaru: Crosstrek Hybrid support

* hybrid cars in dashcam only

* revert that

* just dashcam

* tah should be abs

* remove unused import

* use the old dbc for now

* hybrid car exceptions in carstate

* need dashstatus until we get a proper cruiseactivated bit

* missing CP

* merge conflicts

* lets be consistent about extend

* cleanup

* fix and comments

* preglobal fix

* and the rest

* and this

* added hybrid to release

---------

Co-authored-by: Justin Newberry <justin@comma.ai>
2023-08-23 18:50:55 -07:00
Justin Newberry
b20eba5f1d Subaru: longitudinal incorrect "inactive" rpm (#29496)
* fix incorrect base rpm issue

* "min" name is better
2023-08-21 14:54:42 -07:00
Justin Newberry
fc9a623d69 Subaru: remove unused backoff rate calculation (#29368)
* cancel rate

* Update selfdrive/car/subaru/carcontroller.py

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

* leave it as it was for now

* cleanup

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-08-21 13:31:57 -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
Justin Newberry
d6c682b401 Subaru: Global gen1 experimental longitudinal (#28872)
* Add longitudinal support for Subaru Crosstrek and Impreza

* Update experimentalLongitudinalAvailable check

* Update supported cars list

* bump panda

* Remove/rename es_lkas_msg to es_lkas_state_msg

* Use stockAeb for AEB passthrough

* bump panda

* bump panda

* remove stockFcw from stockAeb

* Subaru: Add FCW_Cont_Beep to stockFcw signals

* bump panda

* bump panda

* update poetry deps: shellingham

* bump panda

* bump panda

* Revert "update poetry deps: shellingham"

This reverts commit 6e9b20964890c8a5c416a17b8aaad4cc16fddcfc.

* Merge fixes

* bump panda

* bump panda

* update supported cars list

* dont use counters for long control

* fix unittests

* submodules update

* only soft disable in long control

* use common functions and cleanup

* apply hystersis correctly

* move to comma repo

* use CanBus

* cleanup

* explicit copy

* behind a flag

* remove unrequired rpm checks

* add comment

* fix flag issue

* we still need to check rpm

* update docs

* enable long for a test route

* unit tests

* inactive throttle fix

* Update subarucan.py

* Update carcontroller.py

* Update carcontroller.py

* inactive throttle fix

* Delete settings

* fix rate limit

* bump submodules

* bump panda

* bump panda

* bump panda

* bump panda

* simplify initial implementation, remove AEB

* reduce initial complexity by not intercepting cruisecontrol or brake_status

* fix fwd hook test

* show pcb off warning

* cleanup and setup for tuning

* fix sumobuldes

* revert unrelated changes

* only whats required

* only whats required

* clean that up

* better comments

* behind the flag for now

* comments and minimize diff

* align stuff

* cleanup for PR

* apply review suggestions

---------

Co-authored-by: Martin Lillepuu <martin@mlp.ee>
2023-08-16 12:58:09 -07:00
Justin Newberry
803c077dc1 Subaru: Signals Cleanup (#28602)
Co-authored-by: Cameron Clough <cameronjclough@gmail.com>
2023-06-23 21:24:27 +01:00
Shane Smiskol
bce19bf187 Subaru: use latActive for steer request bit (#28453)
* subaru: use latactive

* Update ref_commit
2023-06-12 23:03:04 -07:00
Justin Newberry
c1909df437 Subaru: frequency based messaging (#28066)
* frequency based messaging

* frequency based messaging

* frequency based messaging

* frequency based messaging

* rename better

* use frame in if statement

* syntax

* remove extra space

* put all behind one if statement

* update refs

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-05-25 22:33:04 -07:00
martinl
13c75dc138 Subaru: signals cleanup (#27946)
* Update counter in carstate checks

* Rename es_lkas to es_lkas_state to match signal

* formatting

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-04-17 22:54:27 -07:00
Justin Newberry
d59bfa5519 Subaru: infotainment status intercept and rewrite (#27829)
* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* remove compiler flag stuff

* force error for testing

* bump panda and fix mistake

* wip

* bump panda

* wip

* wip

* forgot checksum and stuff

* add to signals

* rename

* test

* test

* bump panda and opendbc

* bump cereal

* add blank filler

* test

* add steer required to infotainment

* fix missing bit

* fix missing bit

* cleanup for PR

* cleanup for PR

* bump submodules

* wip

* wip

* i wonder what 1 is

* seemed to also be obstacle detected?

* bumppanda

* only if global

* only global gen 2

* fix order

* detect and send

* detect in rest of places

* update refs

* bumpopendbc

* copy whole message (camera sometimes sets these signals)

* bumppanda

* update refs!

* bumppanda

* let's not change this

* same as all the other functions

* Revert "same as all the other functions"

This reverts commit e86dbb695ef84a18f3123720fed37a6b81391cc4.

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-04-17 19:05:16 -07:00
Shane Smiskol
581fd62d26 steer limits: rename common dist to meas function (#27453)
* rename function

* make a wrapper function (ford uses dynamic up/down limits

* make two functions consistent

* make torque function convert to int
2023-02-26 17:32:52 -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
Shane Smiskol
f36a3664b0 CarController: log steer sent to the car (#26743)
* log value sent to the car

* rename

* bump

* Update ref_commit
2022-12-10 02:03:40 -08:00
Adeeb Shihadeh
efa326e208 Subaru: 2020 Outback support (#25248)
* Subaru: 2020 Outback support

* bump panda

* bump panda

* update refs

* update refs
2022-07-31 12:43:27 -07:00
Adeeb Shihadeh
d462a08056 remove CS.steeringRateLimited (#25251)
* remove CS.steeringRateLimited

* bump cereal

* update refs
2022-07-24 14:56:55 -07:00
Adeeb Shihadeh
0ca62bf7df let can packer handle counter (#25240)
* let can packer handle counter

* diff is expected

* update refs

* clean that up

* bump opendbc

* fix sim
2022-07-21 20:54:53 -07:00
Adeeb Shihadeh
5f021ac1d6 Subaru: use CANPacker for counter (#25216)
* Subaru: use CANPacker for counter

* bump opendbc

* bump panda
2022-07-19 17:21:07 -07:00
Shane Smiskol
d2c2154a32 Clean up CarControllers (#25008)
* do VW

* Do the rest

* unused

* ford cc formatting

* final clean ups

* also just return update output
2022-06-30 17:23:12 -07:00
Adeeb Shihadeh
2219cb4478 cars: cleanup CS usage (#23957) 2022-03-18 15:39:22 -07:00
Shane Smiskol
629399a449 carControl: add long and lat active fields (#23859)
* proof of concept

* actuators packet describes which actuators are active

* bump cereal

* fixes

* not needed for this PR

* Do Toyota

* add back controlsState.active

* bump cereal

* rest of cars

* in actuators

* add active back

* which

* use controlsState.active for now

* will make an issue

* Update selfdrive/controls/controlsd.py

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

* move local lat_active checks into CC.latActive

* remove redundant checks

* move comment

move comment

* fix joystick mode

* get enabled from carcontrol

* do standstill check in controlsd

* make sure we consider the gas press case for GM

* use CC.actuators

* fix

* capitalization

* Bump cereal

Bump cereal

* make intermediate actuators

* similar convention to before

* clean that up

* update refs

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-03-13 20:58:44 -07:00
Adeeb Shihadeh
72e00a0768 No actuation while in pre-enabled state (#23658)
* No actuation while in pre-enabled state

* update refs
2022-01-28 16:03:44 -08:00
Willem Melching
4f1eb4278a Log actuators after applying rate limits in CarController (#23230)
* return actuators from carcontroller

* log it

* pass to latcontrol

* chrysler

* gm

* honda

* more brands

* rest of the brands

* gm cleanup

* hyundai cleanup

* update ref

* rename field

* fix subaru

* add types

* more subaru fixes #23240

* consistent whitespace

* bump cereal
2021-12-16 13:08:20 +01:00
martinl
7fd98757b4 Subaru: Add Impreza/Crosstrek 2020 (#21011)
* Add Subaru Impreza/Crosstrek 2020

* Update selfdrive/test/test_routes.py

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2021-12-15 15:13:31 -08:00
martinl
345fe48338 Subaru Pre-Global: Rename ES_CruiseThrottle to ES_Distance (#23024)
* Rename preglobal ES_CruiseThrottle to ES_Distance

* bump opendbc

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2021-12-14 21:55:14 -08:00
martinl
d32b1f703c Subaru: replace stock LKAS alerts with openpilot's (#21993)
* Add stock LKAS alert filters and openpilot LKAS state indicator

* Update ES_LKAS_State signals

* bump opendbc

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2021-09-03 16:53:49 -07:00
CrispinFlowerday
7458e143e3 Subaru: show LDW on dash for correct lane (#20934)
* Emit correct alerts for LDW Left & Right on Subarus

This change switches the ldw event to use VisualAlert.ldw and
alters all cars to use the prior behaviour for that alert, except
global subarus - they emit the correct warning to the dash

* Remove whitespace, and add comment about not overwriting stock alerts

Co-authored-by: Crispin Flowerday <crispin@theflowerdays.com>
2021-06-07 15:06:28 -07:00
martinl
587060bd92 Subaru signals update (#20956)
* switch to opendbc subaru-signals-2021-05-19

* update carstate signals to match dbc, rename fake_button to cruise_button

* Revert "switch to opendbc subaru-signals-2021-05-19"

This reverts commit f88d6ddcf5c10f8dd4ec37c5cb2cf9e208a56d75.

* bump opendbc

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2021-05-18 19:39:09 -07:00
Willem Melching
e4cf43c6fc Move all CarControllerParams into values.py (#19663)
* toyota

* use scale from values.py

* nissan

* subaru

* honda

* gm

* toyota combine into CarControllerParams

* nissan refactor

* chrysler refactor

* mazda refactor

* hyundai refactor

* subaru refactor
2021-01-06 11:20:44 +01:00
martinl
e37b8e5d56 Subaru pre-global: add support for Subaru Legacy 2015-18 (#1805)
* Add support for Subaru Legacy 2015-18

* syntax fix

* Add Legacy 2018 FPv1

* Add Subaru Ascent from upstream

* Use GLOBAL_CAR and LEGACY_CAR lists

* Change LEGACY_2015 to LEGACY_PREGLOBAL

* Add LEGACY_CAR to carstate

* Change LEGACY_2015 to LEGACY_PREGLOBAL in test_car_models

* Add missing SafetyModel to Ascent

* Use GLOBAL_CAR and LEGACY_CAR to set safetyModel

* Change LEGACY_CAR to PREGLOBAL_CARS, remove GLOBAL_CAR

* Fix PREGLOBAL_CARS in carstate and subarucan

* Minor cleanups

* Add accelCruise button event

* Change Preglobal Driver Torque limit to match Global

* Match comments to upstream

* Use Steer_Warning and Steer_Error_1 only for Global

* Change mph units to match upstream values

* Increase Preglobal brakePressed  threshold to 2

* Add DashcamOnly to LEGACY_PREGLOBAL

* Fix typo in variable name

* Update README, add create_preglobal_steering_control

* cleanup carcontroller

* cleanup values

* missed that one

* Update STEER_STEP

* Update STEER_MAX

* Add preglobal signal frequency checks

* remove PREGLOBAL_CARS from subarucan

* Remove whitespace

* Use common frequency checks

* cleanup carstate

* cleanup subarucan

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2020-08-06 21:55:13 -07:00
Adeeb Shihadeh
30d6d77e26 Subaru cleanup (#1809) 2020-07-02 13:37:53 -07:00
Adeeb Shihadeh
f3dcf861c7 enable flake8 E303: too many blank lines 2020-05-31 17:21:11 -07:00
Adeeb
789764945c Subaru: calculate checksum in can packer (#1356)
* subaru checksum moved to can packer

* unused
2020-04-13 15:07:59 -07:00
Adeeb
13f60eae91 Abstract CarInterface init (#1131)
* abstract CarInterface init

* unused

* subaru

* gm cleanup

* vw

* typo

* carcontroller

* more cleanup

* fix vw
2020-02-19 20:37:07 -08:00
rbiasini
0c67143c92 Carstate returns capnp struct (#1115)
* Before abstraction, adding speed init from VW as well

* strting to abstract carstate class

* fix bug and update lock?

* revert pipfile change

* another bug

* fix linter

* bug fix

* remove a bunch of diplicated kf code

* better to not have class vars. will abstract __init__ anyway later

* abstract common instance vars in carstate init and a generic gear parser static method

* abstract gear parser for chrysler

* abstract gm gear parser too

* remove unnecessary random vars

* Chrysler: carstate returns capnp struct directly

* revert ref commit

* test ref

* WIP

* more WIP

* ops, missed this conflict

* ford as well

* not sure why this got deleted

* no need to copy

* remove copy

* remove copy import

* remove unnecessary intermediate variable

* remove obsolete comments

* GM: have carstate returning capnp struct directly

* Honda carstate also outputing capnp struct

* hyundai too now returns capnp from carstate

* ops, not meant this

* Subaru carstate also returning capnp

* Toyota: capnp struct as output of carstate

* fix bool

* minor simplififcation in Honda

* no need to negate

* VW carstate returning capnp struct (#1118)

* VW carstate also returning capnp struct

* fixed typo

* Remove unused blinker button (#1119)

* remove unused blinker button

* ops, this wasn't meant

* remove blinker button for VW as well

* update ref

Co-authored-by: Willem Melching <willem.melching@gmail.com>
2020-02-18 15:28:15 -08:00
rbiasini
5c52be27ca abstract kf and gear parser as static methods (#1103)
* Before abstraction, adding speed init from VW as well

* strting to abstract carstate class

* fix bug and update lock?

* revert pipfile change

* another bug

* fix linter

* bug fix

* remove a bunch of diplicated kf code

* better to not have class vars. will abstract __init__ anyway later

* Abstract gear parser static method (#1107)

* abstract common instance vars in carstate init and a generic gear parser static method

* update opendbc (#1105)

* abstract gear parser for chrysler

* update opendbc (#1106)

* abstract gm gear parser too

* remove unnecessary random vars
2020-02-17 11:53:53 -08:00
George Hotz
71ead9adea selfdrive/car 2020-01-17 10:58:43 -08:00