Platform config small cleanup (#31638)

no field, label mass, correct spacing
old-commit-hash: 85150c0289
chrysler-long2
Shane Smiskol 1 year ago committed by GitHub
parent 5b69d84a7e
commit d8c7b75973
  1. 10
      selfdrive/car/__init__.py
  2. 8
      selfdrive/car/volkswagen/values.py

@ -1,6 +1,6 @@
# functions common among cars # functions common among cars
from collections import namedtuple from collections import namedtuple
from dataclasses import dataclass, field from dataclasses import dataclass
from enum import IntFlag, ReprEnum from enum import IntFlag, ReprEnum
from dataclasses import replace from dataclasses import replace
@ -250,12 +250,12 @@ CarInfos = CarInfo | list[CarInfo]
@dataclass(frozen=True, kw_only=True) @dataclass(frozen=True, kw_only=True)
class CarSpecs: class CarSpecs:
mass: float mass: float # kg, curb weight
wheelbase: float wheelbase: float
steerRatio: float steerRatio: float
centerToFrontRatio: float = field(default=0.5) centerToFrontRatio: float = 0.5
minSteerSpeed: float = field(default=0.) minSteerSpeed: float = 0.0
minEnableSpeed: float = field(default=-1.) minEnableSpeed: float = -1.0
@dataclass(order=True) @dataclass(order=True)

@ -112,17 +112,21 @@ class CANBUS:
class VolkswagenFlags(IntFlag): class VolkswagenFlags(IntFlag):
STOCK_HCA_PRESENT = 1 STOCK_HCA_PRESENT = 1
@dataclass @dataclass
class VolkswagenMQBPlatformConfig(PlatformConfig): class VolkswagenMQBPlatformConfig(PlatformConfig):
dbc_dict: DbcDict = field(default_factory=lambda: dbc_dict('vw_mqb_2010', None)) dbc_dict: DbcDict = field(default_factory=lambda: dbc_dict('vw_mqb_2010', None))
@dataclass @dataclass
class VolkswagenPQPlatformConfig(PlatformConfig): class VolkswagenPQPlatformConfig(PlatformConfig):
dbc_dict: DbcDict = field(default_factory=lambda: dbc_dict('vw_golf_mk4', None)) dbc_dict: DbcDict = field(default_factory=lambda: dbc_dict('vw_golf_mk4', None))
@dataclass(frozen=True, kw_only=True) @dataclass(frozen=True, kw_only=True)
class VolkswagenCarSpecs(CarSpecs): class VolkswagenCarSpecs(CarSpecs):
steerRatio: float = field(default=15.6) steerRatio: float = 15.6
class Footnote(Enum): class Footnote(Enum):
KAMIQ = CarFootnote( KAMIQ = CarFootnote(
@ -158,6 +162,7 @@ class VWCarInfo(CarInfo):
if CP.carFingerprint in (CAR.CRAFTER_MK2, CAR.TRANSPORTER_T61): if CP.carFingerprint in (CAR.CRAFTER_MK2, CAR.TRANSPORTER_T61):
self.car_parts = CarParts([Device.threex_angled_mount, CarHarness.j533]) self.car_parts = CarParts([Device.threex_angled_mount, CarHarness.j533])
# Check the 7th and 8th characters of the VIN before adding a new CAR. If the # Check the 7th and 8th characters of the VIN before adding a new CAR. If the
# chassis code is already listed below, don't add a new CAR, just add to the # chassis code is already listed below, don't add a new CAR, just add to the
# FW_VERSIONS for that existing CAR. # FW_VERSIONS for that existing CAR.
@ -353,6 +358,7 @@ class CAR(Platforms):
specs=VolkswagenCarSpecs(mass=1505, wheelbase=2.84), specs=VolkswagenCarSpecs(mass=1505, wheelbase=2.84),
) )
PQ_CARS = {CAR.PASSAT_NMS, CAR.SHARAN_MK2} PQ_CARS = {CAR.PASSAT_NMS, CAR.SHARAN_MK2}
# All supported cars should return FW from the engine, srs, eps, and fwdRadar. Cars # All supported cars should return FW from the engine, srs, eps, and fwdRadar. Cars

Loading…
Cancel
Save