@ -4,7 +4,7 @@ from typing import List
from cereal import car
from cereal import car
from panda . python import uds
from panda . python import uds
from openpilot . selfdrive . car import DbcDict , PlatformConfig , Platforms , dbc_dict
from openpilot . selfdrive . car import CarSpecs , DbcDict , PlatformConfig , Platforms , dbc_dict
from openpilot . selfdrive . car . docs_definitions import CarFootnote , CarHarness , CarInfo , CarParts , Tool , Column
from openpilot . selfdrive . car . docs_definitions import CarFootnote , CarHarness , CarInfo , CarParts , Tool , Column
from openpilot . selfdrive . car . fw_query_definitions import FwQueryConfig , Request , StdQueries , p16
from openpilot . selfdrive . car . fw_query_definitions import FwQueryConfig , Request , StdQueries , p16
@ -100,14 +100,17 @@ class CAR(Platforms):
ASCENT = SubaruPlatformConfig (
ASCENT = SubaruPlatformConfig (
" SUBARU ASCENT LIMITED 2019 " ,
" SUBARU ASCENT LIMITED 2019 " ,
SubaruCarInfo ( " Subaru Ascent 2019-21 " , " All " ) ,
SubaruCarInfo ( " Subaru Ascent 2019-21 " , " All " ) ,
specs = CarSpecs ( mass = 2031 , wheelbase = 2.89 , steerRatio = 13.5 ) ,
)
)
OUTBACK = SubaruPlatformConfig (
OUTBACK = SubaruPlatformConfig (
" SUBARU OUTBACK 6TH GEN " ,
" SUBARU OUTBACK 6TH GEN " ,
SubaruCarInfo ( " Subaru Outback 2020-22 " , " All " , car_parts = CarParts . common ( [ CarHarness . subaru_b ] ) ) ,
SubaruCarInfo ( " Subaru Outback 2020-22 " , " All " , car_parts = CarParts . common ( [ CarHarness . subaru_b ] ) ) ,
specs = CarSpecs ( mass = 1568 , wheelbase = 2.67 , steerRatio = 17 ) ,
)
)
LEGACY = SubaruPlatformConfig (
LEGACY = SubaruPlatformConfig (
" SUBARU LEGACY 7TH GEN " ,
" SUBARU LEGACY 7TH GEN " ,
SubaruCarInfo ( " Subaru Legacy 2020-22 " , " All " , car_parts = CarParts . common ( [ CarHarness . subaru_b ] ) ) ,
SubaruCarInfo ( " Subaru Legacy 2020-22 " , " All " , car_parts = CarParts . common ( [ CarHarness . subaru_b ] ) ) ,
specs = OUTBACK . specs ,
)
)
IMPREZA = SubaruPlatformConfig (
IMPREZA = SubaruPlatformConfig (
" SUBARU IMPREZA LIMITED 2019 " ,
" SUBARU IMPREZA LIMITED 2019 " ,
@ -116,6 +119,7 @@ class CAR(Platforms):
SubaruCarInfo ( " Subaru Crosstrek 2018-19 " , video_link = " https://youtu.be/Agww7oE1k-s?t=26 " ) ,
SubaruCarInfo ( " Subaru Crosstrek 2018-19 " , video_link = " https://youtu.be/Agww7oE1k-s?t=26 " ) ,
SubaruCarInfo ( " Subaru XV 2018-19 " , video_link = " https://youtu.be/Agww7oE1k-s?t=26 " ) ,
SubaruCarInfo ( " Subaru XV 2018-19 " , video_link = " https://youtu.be/Agww7oE1k-s?t=26 " ) ,
] ,
] ,
specs = CarSpecs ( mass = 1568 , wheelbase = 2.67 , steerRatio = 15 ) ,
)
)
IMPREZA_2020 = SubaruPlatformConfig (
IMPREZA_2020 = SubaruPlatformConfig (
" SUBARU IMPREZA SPORT 2020 " ,
" SUBARU IMPREZA SPORT 2020 " ,
@ -124,55 +128,66 @@ class CAR(Platforms):
SubaruCarInfo ( " Subaru Crosstrek 2020-23 " ) ,
SubaruCarInfo ( " Subaru Crosstrek 2020-23 " ) ,
SubaruCarInfo ( " Subaru XV 2020-21 " ) ,
SubaruCarInfo ( " Subaru XV 2020-21 " ) ,
] ,
] ,
specs = CarSpecs ( mass = 1480 , wheelbase = 2.67 , steerRatio = 17 ) ,
)
)
# TODO: is there an XV and Impreza too?
# TODO: is there an XV and Impreza too?
CROSSTREK_HYBRID = SubaruPlatformConfig (
CROSSTREK_HYBRID = SubaruPlatformConfig (
" SUBARU CROSSTREK HYBRID 2020 " ,
" SUBARU CROSSTREK HYBRID 2020 " ,
SubaruCarInfo ( " Subaru Crosstrek Hybrid 2020 " , car_parts = CarParts . common ( [ CarHarness . subaru_b ] ) ) ,
SubaruCarInfo ( " Subaru Crosstrek Hybrid 2020 " , car_parts = CarParts . common ( [ CarHarness . subaru_b ] ) ) ,
dbc_dict ( ' subaru_global_2020_hybrid_generated ' , None ) ,
dbc_dict ( ' subaru_global_2020_hybrid_generated ' , None ) ,
specs = CarSpecs ( mass = 1668 , wheelbase = 2.67 , steerRatio = 17 ) ,
)
FORESTER = SubaruPlatformConfig (
" SUBARU FORESTER 2019 " ,
SubaruCarInfo ( " Subaru Forester 2019-21 " , " All " ) ,
specs = CarSpecs ( mass = 1668 , wheelbase = 2.67 , steerRatio = 17 ) ,
)
)
FORESTER_HYBRID = SubaruPlatformConfig (
FORESTER_HYBRID = SubaruPlatformConfig (
" SUBARU FORESTER HYBRID 2020 " ,
" SUBARU FORESTER HYBRID 2020 " ,
SubaruCarInfo ( " Subaru Forester Hybrid 2020 " ) ,
SubaruCarInfo ( " Subaru Forester Hybrid 2020 " ) ,
dbc_dict ( ' subaru_global_2020_hybrid_generated ' , None ) ,
dbc_dict ( ' subaru_global_2020_hybrid_generated ' , None ) ,
)
specs = FORESTER . specs ,
FORESTER = SubaruPlatformConfig (
" SUBARU FORESTER 2019 " ,
SubaruCarInfo ( " Subaru Forester 2019-21 " , " All " ) ,
)
)
# Pre-global
# Pre-global
FORESTER_PREGLOBAL = SubaruPlatformConfig (
FORESTER_PREGLOBAL = SubaruPlatformConfig (
" SUBARU FORESTER 2017 - 2018 " ,
" SUBARU FORESTER 2017 - 2018 " ,
SubaruCarInfo ( " Subaru Forester 2017-18 " ) ,
SubaruCarInfo ( " Subaru Forester 2017-18 " ) ,
dbc_dict ( ' subaru_forester_2017_generated ' , None ) ,
dbc_dict ( ' subaru_forester_2017_generated ' , None ) ,
specs = CarSpecs ( mass = 1568 , wheelbase = 2.67 , steerRatio = 20 ) ,
)
)
LEGACY_PREGLOBAL = SubaruPlatformConfig (
LEGACY_PREGLOBAL = SubaruPlatformConfig (
" SUBARU LEGACY 2015 - 2018 " ,
" SUBARU LEGACY 2015 - 2018 " ,
SubaruCarInfo ( " Subaru Legacy 2015-18 " ) ,
SubaruCarInfo ( " Subaru Legacy 2015-18 " ) ,
dbc_dict ( ' subaru_outback_2015_generated ' , None ) ,
dbc_dict ( ' subaru_outback_2015_generated ' , None ) ,
specs = CarSpecs ( mass = 1568 , wheelbase = 2.67 , steerRatio = 12.5 ) ,
)
)
OUTBACK_PREGLOBAL = SubaruPlatformConfig (
OUTBACK_PREGLOBAL = SubaruPlatformConfig (
" SUBARU OUTBACK 2015 - 2017 " ,
" SUBARU OUTBACK 2015 - 2017 " ,
SubaruCarInfo ( " Subaru Outback 2015-17 " ) ,
SubaruCarInfo ( " Subaru Outback 2015-17 " ) ,
dbc_dict ( ' subaru_outback_2015_generated ' , None ) ,
dbc_dict ( ' subaru_outback_2015_generated ' , None ) ,
specs = FORESTER_PREGLOBAL . specs ,
)
)
OUTBACK_PREGLOBAL_2018 = SubaruPlatformConfig (
OUTBACK_PREGLOBAL_2018 = SubaruPlatformConfig (
" SUBARU OUTBACK 2018 - 2019 " ,
" SUBARU OUTBACK 2018 - 2019 " ,
SubaruCarInfo ( " Subaru Outback 2018-19 " ) ,
SubaruCarInfo ( " Subaru Outback 2018-19 " ) ,
dbc_dict ( ' subaru_outback_2019_generated ' , None ) ,
dbc_dict ( ' subaru_outback_2019_generated ' , None ) ,
specs = FORESTER_PREGLOBAL . specs ,
)
)
# Angle LKAS
# Angle LKAS
FORESTER_2022 = SubaruPlatformConfig (
FORESTER_2022 = SubaruPlatformConfig (
" SUBARU FORESTER 2022 " ,
" SUBARU FORESTER 2022 " ,
SubaruCarInfo ( " Subaru Forester 2022-24 " , " All " , car_parts = CarParts . common ( [ CarHarness . subaru_c ] ) ) ,
SubaruCarInfo ( " Subaru Forester 2022-24 " , " All " , car_parts = CarParts . common ( [ CarHarness . subaru_c ] ) ) ,
specs = FORESTER . specs ,
)
)
OUTBACK_2023 = SubaruPlatformConfig (
OUTBACK_2023 = SubaruPlatformConfig (
" SUBARU OUTBACK 7TH GEN " ,
" SUBARU OUTBACK 7TH GEN " ,
SubaruCarInfo ( " Subaru Outback 2023 " , " All " , car_parts = CarParts . common ( [ CarHarness . subaru_d ] ) ) ,
SubaruCarInfo ( " Subaru Outback 2023 " , " All " , car_parts = CarParts . common ( [ CarHarness . subaru_d ] ) ) ,
specs = OUTBACK . specs ,
)
)
ASCENT_2023 = SubaruPlatformConfig (
ASCENT_2023 = SubaruPlatformConfig (
" SUBARU ASCENT 2023 " ,
" SUBARU ASCENT 2023 " ,
SubaruCarInfo ( " Subaru Ascent 2023 " , " All " , car_parts = CarParts . common ( [ CarHarness . subaru_d ] ) )
SubaruCarInfo ( " Subaru Ascent 2023 " , " All " , car_parts = CarParts . common ( [ CarHarness . subaru_d ] ) ) ,
specs = ASCENT . specs ,
)
)