From 808c139479d5ad9d8d6c9d655505c19846a605c8 Mon Sep 17 00:00:00 2001 From: martinl Date: Tue, 5 Apr 2022 23:04:46 +0300 Subject: [PATCH] Subaru: update supported model years and steering torque (#24118) * Subaru: update carinfo supported model years and good steering torque * update torque * model year 2020 was added to IMPREZA_2020, split out update docs * order Co-authored-by: Shane Smiskol old-commit-hash: 5e1095e88131fe7cf4555e9dcb1023f49239443c --- docs/CARS.md | 10 ++++++---- selfdrive/car/subaru/values.py | 28 +++++++++++++++++++--------- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/docs/CARS.md b/docs/CARS.md index 1be72005fd..d0cf1c88ba 100644 --- a/docs/CARS.md +++ b/docs/CARS.md @@ -109,6 +109,9 @@ How We Rate The Cars |Mazda|CX-5 2022|All|||||| |SEAT|Ateca 2018|Driver Assistance|||||| |SEAT|Leon 2014-20|Driver Assistance|||||| +|Subaru|Crosstrek 2018-19|EyeSight|||||| +|Subaru|Forester 2019-21|EyeSight|||||| +|Subaru|Impreza 2017-19|EyeSight|||||| |Škoda|Kamiq 2021[6](#footnotes)|Driver Assistance|||||| |Škoda|Karoq 2019|Driver Assistance|||||| |Škoda|Kodiaq 2018-19|Driver Assistance|||||| @@ -195,10 +198,9 @@ How We Rate The Cars |Nissan|Leaf 2018-22|ProPILOT|||||| |Nissan|Rogue 2018-20|ProPILOT|||||| |Nissan|X-Trail 2017|ProPILOT|||||| -|Subaru|Ascent 2019|EyeSight|||||| -|Subaru|Crosstrek 2018-20|EyeSight|||||| -|Subaru|Forester 2019-21|EyeSight|||||| -|Subaru|Impreza 2017-19|EyeSight|||||| +|Subaru|Ascent 2019-20|EyeSight|||||| +|Subaru|Crosstrek 2020-21|EyeSight|||||| +|Subaru|Impreza 2020-21|EyeSight|||||| |Toyota|Avalon 2016-18|TSS-P|[3](#footnotes)||||| |Toyota|Corolla 2017-19|All|[3](#footnotes)||||| |Toyota|Prius 2016-20|TSS-P|[3](#footnotes)|||[5](#footnotes)|| diff --git a/selfdrive/car/subaru/values.py b/selfdrive/car/subaru/values.py index 27210d8f52..2ae3b3f17d 100644 --- a/selfdrive/car/subaru/values.py +++ b/selfdrive/car/subaru/values.py @@ -1,3 +1,4 @@ +from dataclasses import dataclass from typing import Dict, List, Union from selfdrive.car import dbc_dict @@ -30,17 +31,26 @@ class CAR: OUTBACK_PREGLOBAL_2018 = "SUBARU OUTBACK 2018 - 2019" -CAR_INFO: Dict[str, Union[CarInfo, List[CarInfo]]] = { - CAR.ASCENT: CarInfo("Subaru Ascent 2019", "EyeSight"), +@dataclass +class SubaruCarInfo(CarInfo): + package: str = "EyeSight" + + +CAR_INFO: Dict[str, Union[SubaruCarInfo, List[SubaruCarInfo]]] = { + CAR.ASCENT: SubaruCarInfo("Subaru Ascent 2019-20"), CAR.IMPREZA: [ - CarInfo("Subaru Impreza 2017-19", "EyeSight"), - CarInfo("Subaru Crosstrek 2018-20", "EyeSight"), + SubaruCarInfo("Subaru Impreza 2017-19", good_torque=True), + SubaruCarInfo("Subaru Crosstrek 2018-19", good_torque=True), + ], + CAR.IMPREZA_2020: [ + SubaruCarInfo("Subaru Impreza 2020-21"), + SubaruCarInfo("Subaru Crosstrek 2020-21"), ], - CAR.FORESTER: CarInfo("Subaru Forester 2019-21", "EyeSight"), - CAR.FORESTER_PREGLOBAL: CarInfo("Subaru Forester 2017-18", "EyeSight"), - CAR.LEGACY_PREGLOBAL: CarInfo("Subaru Legacy 2015-18", "EyeSight"), - CAR.OUTBACK_PREGLOBAL: CarInfo("Subaru Outback 2015-17", "EyeSight"), - CAR.OUTBACK_PREGLOBAL_2018: CarInfo("Subaru Outback 2018-19", "EyeSight"), + CAR.FORESTER: SubaruCarInfo("Subaru Forester 2019-21", good_torque=True), + CAR.FORESTER_PREGLOBAL: SubaruCarInfo("Subaru Forester 2017-18"), + CAR.LEGACY_PREGLOBAL: SubaruCarInfo("Subaru Legacy 2015-18"), + CAR.OUTBACK_PREGLOBAL: SubaruCarInfo("Subaru Outback 2015-17"), + CAR.OUTBACK_PREGLOBAL_2018: SubaruCarInfo("Subaru Outback 2018-19"), }