|
|
|
@ -1,9 +1,8 @@ |
|
|
|
|
from collections import defaultdict |
|
|
|
|
from dataclasses import dataclass |
|
|
|
|
from enum import Enum, StrEnum |
|
|
|
|
from dataclasses import dataclass, field |
|
|
|
|
from enum import Enum |
|
|
|
|
|
|
|
|
|
from cereal import car |
|
|
|
|
from openpilot.selfdrive.car import dbc_dict |
|
|
|
|
from openpilot.selfdrive.car import dbc_dict, PlatformConfig, DbcDict, Platforms, CarSpecs |
|
|
|
|
from openpilot.selfdrive.car.docs_definitions import CarFootnote, CarHarness, CarInfo, CarParts, Column |
|
|
|
|
from openpilot.selfdrive.car.fw_query_definitions import FwQueryConfig, Request, StdQueries |
|
|
|
|
|
|
|
|
@ -61,23 +60,6 @@ class CarControllerParams: |
|
|
|
|
self.BRAKE_LOOKUP_V = [self.MAX_BRAKE, 0.] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class CAR(StrEnum): |
|
|
|
|
HOLDEN_ASTRA = "HOLDEN ASTRA RS-V BK 2017" |
|
|
|
|
VOLT = "CHEVROLET VOLT PREMIER 2017" |
|
|
|
|
CADILLAC_ATS = "CADILLAC ATS Premium Performance 2018" |
|
|
|
|
MALIBU = "CHEVROLET MALIBU PREMIER 2017" |
|
|
|
|
ACADIA = "GMC ACADIA DENALI 2018" |
|
|
|
|
BUICK_LACROSSE = "BUICK LACROSSE 2017" |
|
|
|
|
BUICK_REGAL = "BUICK REGAL ESSENCE 2018" |
|
|
|
|
ESCALADE = "CADILLAC ESCALADE 2017" |
|
|
|
|
ESCALADE_ESV = "CADILLAC ESCALADE ESV 2016" |
|
|
|
|
ESCALADE_ESV_2019 = "CADILLAC ESCALADE ESV 2019" |
|
|
|
|
BOLT_EUV = "CHEVROLET BOLT EUV 2022" |
|
|
|
|
SILVERADO = "CHEVROLET SILVERADO 1500 2020" |
|
|
|
|
EQUINOX = "CHEVROLET EQUINOX 2019" |
|
|
|
|
TRAILBLAZER = "CHEVROLET TRAILBLAZER 2021" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Footnote(Enum): |
|
|
|
|
OBD_II = CarFootnote( |
|
|
|
|
'Requires a <a href="https://github.com/commaai/openpilot/wiki/GM#hardware" target="_blank">community built ASCM harness</a>. ' + |
|
|
|
@ -97,28 +79,88 @@ class GMCarInfo(CarInfo): |
|
|
|
|
self.footnotes.append(Footnote.OBD_II) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CAR_INFO: dict[str, GMCarInfo | list[GMCarInfo]] = { |
|
|
|
|
CAR.HOLDEN_ASTRA: GMCarInfo("Holden Astra 2017"), |
|
|
|
|
CAR.VOLT: GMCarInfo("Chevrolet Volt 2017-18", min_enable_speed=0, video_link="https://youtu.be/QeMCN_4TFfQ"), |
|
|
|
|
CAR.CADILLAC_ATS: GMCarInfo("Cadillac ATS Premium Performance 2018"), |
|
|
|
|
CAR.MALIBU: GMCarInfo("Chevrolet Malibu Premier 2017"), |
|
|
|
|
CAR.ACADIA: GMCarInfo("GMC Acadia 2018", video_link="https://www.youtube.com/watch?v=0ZN6DdsBUZo"), |
|
|
|
|
CAR.BUICK_LACROSSE: GMCarInfo("Buick LaCrosse 2017-19", "Driver Confidence Package 2"), |
|
|
|
|
CAR.BUICK_REGAL: GMCarInfo("Buick Regal Essence 2018"), |
|
|
|
|
CAR.ESCALADE: GMCarInfo("Cadillac Escalade 2017", "Driver Assist Package"), |
|
|
|
|
CAR.ESCALADE_ESV: GMCarInfo("Cadillac Escalade ESV 2016", "Adaptive Cruise Control (ACC) & LKAS"), |
|
|
|
|
CAR.ESCALADE_ESV_2019: GMCarInfo("Cadillac Escalade ESV 2019", "Adaptive Cruise Control (ACC) & LKAS"), |
|
|
|
|
CAR.BOLT_EUV: [ |
|
|
|
|
@dataclass |
|
|
|
|
class GMPlatformConfig(PlatformConfig): |
|
|
|
|
dbc_dict: DbcDict = field(default_factory=lambda: dbc_dict('gm_global_a_powertrain_generated', 'gm_global_a_object', chassis_dbc='gm_global_a_chassis')) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class CAR(Platforms): |
|
|
|
|
HOLDEN_ASTRA = GMPlatformConfig( |
|
|
|
|
"HOLDEN ASTRA RS-V BK 2017", |
|
|
|
|
GMCarInfo("Holden Astra 2017"), |
|
|
|
|
specs=CarSpecs(mass=1363, wheelbase=2.662, steerRatio=15.7, centerToFrontRatio=0.4), |
|
|
|
|
) |
|
|
|
|
VOLT = GMPlatformConfig( |
|
|
|
|
"CHEVROLET VOLT PREMIER 2017", |
|
|
|
|
GMCarInfo("Chevrolet Volt 2017-18", min_enable_speed=0, video_link="https://youtu.be/QeMCN_4TFfQ"), |
|
|
|
|
specs=CarSpecs(mass=1607, wheelbase=2.69, steerRatio=17.7, centerToFrontRatio=0.45), |
|
|
|
|
) |
|
|
|
|
CADILLAC_ATS = GMPlatformConfig( |
|
|
|
|
"CADILLAC ATS Premium Performance 2018", |
|
|
|
|
GMCarInfo("Cadillac ATS Premium Performance 2018"), |
|
|
|
|
specs=CarSpecs(mass=1601, wheelbase=2.78, steerRatio=15.3), |
|
|
|
|
) |
|
|
|
|
MALIBU = GMPlatformConfig( |
|
|
|
|
"CHEVROLET MALIBU PREMIER 2017", |
|
|
|
|
GMCarInfo("Chevrolet Malibu Premier 2017"), |
|
|
|
|
specs=CarSpecs(mass=1496, wheelbase=2.83, steerRatio=15.8, centerToFrontRatio=0.4), |
|
|
|
|
) |
|
|
|
|
ACADIA = GMPlatformConfig( |
|
|
|
|
"GMC ACADIA DENALI 2018", |
|
|
|
|
GMCarInfo("GMC Acadia 2018", video_link="https://www.youtube.com/watch?v=0ZN6DdsBUZo"), |
|
|
|
|
specs=CarSpecs(mass=1975, wheelbase=2.86, steerRatio=14.4, centerToFrontRatio=0.4), |
|
|
|
|
) |
|
|
|
|
BUICK_LACROSSE = GMPlatformConfig( |
|
|
|
|
"BUICK LACROSSE 2017", |
|
|
|
|
GMCarInfo("Buick LaCrosse 2017-19", "Driver Confidence Package 2"), |
|
|
|
|
specs=CarSpecs(mass=1712, wheelbase=2.91, steerRatio=15.8, centerToFrontRatio=0.4), |
|
|
|
|
) |
|
|
|
|
BUICK_REGAL = GMPlatformConfig( |
|
|
|
|
"BUICK REGAL ESSENCE 2018", |
|
|
|
|
GMCarInfo("Buick Regal Essence 2018"), |
|
|
|
|
specs=CarSpecs(mass=1714, wheelbase=2.83, steerRatio=14.4, centerToFrontRatio=0.4), |
|
|
|
|
) |
|
|
|
|
ESCALADE = GMPlatformConfig( |
|
|
|
|
"CADILLAC ESCALADE 2017", |
|
|
|
|
GMCarInfo("Cadillac Escalade 2017", "Driver Assist Package"), |
|
|
|
|
specs=CarSpecs(mass=2564, wheelbase=2.95, steerRatio=17.3), |
|
|
|
|
) |
|
|
|
|
ESCALADE_ESV = GMPlatformConfig( |
|
|
|
|
"CADILLAC ESCALADE ESV 2016", |
|
|
|
|
GMCarInfo("Cadillac Escalade ESV 2016", "Adaptive Cruise Control (ACC) & LKAS"), |
|
|
|
|
specs=CarSpecs(mass=2739, wheelbase=3.302, steerRatio=17.3), |
|
|
|
|
) |
|
|
|
|
ESCALADE_ESV_2019 = GMPlatformConfig( |
|
|
|
|
"CADILLAC ESCALADE ESV 2019", |
|
|
|
|
GMCarInfo("Cadillac Escalade ESV 2019", "Adaptive Cruise Control (ACC) & LKAS"), |
|
|
|
|
specs=ESCALADE_ESV.specs, |
|
|
|
|
) |
|
|
|
|
BOLT_EUV = GMPlatformConfig( |
|
|
|
|
"CHEVROLET BOLT EUV 2022", |
|
|
|
|
[ |
|
|
|
|
GMCarInfo("Chevrolet Bolt EUV 2022-23", "Premier or Premier Redline Trim without Super Cruise Package", video_link="https://youtu.be/xvwzGMUA210"), |
|
|
|
|
GMCarInfo("Chevrolet Bolt EV 2022-23", "2LT Trim with Adaptive Cruise Control Package"), |
|
|
|
|
], |
|
|
|
|
CAR.SILVERADO: [ |
|
|
|
|
specs=CarSpecs(mass=1669, wheelbase=2.63779, steerRatio=16.8, centerToFrontRatio=0.4), |
|
|
|
|
) |
|
|
|
|
SILVERADO = GMPlatformConfig( |
|
|
|
|
"CHEVROLET SILVERADO 1500 2020", |
|
|
|
|
[ |
|
|
|
|
GMCarInfo("Chevrolet Silverado 1500 2020-21", "Safety Package II"), |
|
|
|
|
GMCarInfo("GMC Sierra 1500 2020-21", "Driver Alert Package II", video_link="https://youtu.be/5HbNoBLzRwE"), |
|
|
|
|
], |
|
|
|
|
CAR.EQUINOX: GMCarInfo("Chevrolet Equinox 2019-22"), |
|
|
|
|
CAR.TRAILBLAZER: GMCarInfo("Chevrolet Trailblazer 2021-22"), |
|
|
|
|
} |
|
|
|
|
specs=CarSpecs(mass=2450, wheelbase=3.75, steerRatio=16.3), |
|
|
|
|
) |
|
|
|
|
EQUINOX = GMPlatformConfig( |
|
|
|
|
"CHEVROLET EQUINOX 2019", |
|
|
|
|
GMCarInfo("Chevrolet Equinox 2019-22"), |
|
|
|
|
specs=CarSpecs(mass=1588, wheelbase=2.72, steerRatio=14.4, centerToFrontRatio=0.4), |
|
|
|
|
) |
|
|
|
|
TRAILBLAZER = GMPlatformConfig( |
|
|
|
|
"CHEVROLET TRAILBLAZER 2021", |
|
|
|
|
GMCarInfo("Chevrolet Trailblazer 2021-22"), |
|
|
|
|
specs=CarSpecs(mass=1345, wheelbase=2.64, steerRatio=16.8, centerToFrontRatio=0.4), |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class CruiseButtons: |
|
|
|
@ -180,11 +222,12 @@ FW_QUERY_CONFIG = FwQueryConfig( |
|
|
|
|
extra_ecus=[(Ecu.fwdCamera, 0x24b, None)], |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
DBC: dict[str, dict[str, str]] = defaultdict(lambda: dbc_dict('gm_global_a_powertrain_generated', 'gm_global_a_object', chassis_dbc='gm_global_a_chassis')) |
|
|
|
|
|
|
|
|
|
EV_CAR = {CAR.VOLT, CAR.BOLT_EUV} |
|
|
|
|
|
|
|
|
|
# We're integrated at the camera with VOACC on these cars (instead of ASCM w/ OBD-II harness) |
|
|
|
|
CAMERA_ACC_CAR = {CAR.BOLT_EUV, CAR.SILVERADO, CAR.EQUINOX, CAR.TRAILBLAZER} |
|
|
|
|
|
|
|
|
|
STEER_THRESHOLD = 1.0 |
|
|
|
|
|
|
|
|
|
CAR_INFO = CAR.create_carinfo_map() |
|
|
|
|
DBC = CAR.create_dbc_map() |
|
|
|
|