|
|
@ -1,8 +1,8 @@ |
|
|
|
from collections import namedtuple |
|
|
|
from collections import namedtuple |
|
|
|
from enum import StrEnum |
|
|
|
from dataclasses import dataclass, field |
|
|
|
|
|
|
|
|
|
|
|
from cereal import car |
|
|
|
from cereal import car |
|
|
|
from openpilot.selfdrive.car import AngleRateLimit, dbc_dict |
|
|
|
from openpilot.selfdrive.car import AngleRateLimit, CarSpecs, DbcDict, PlatformConfig, Platforms, dbc_dict |
|
|
|
from openpilot.selfdrive.car.docs_definitions import CarInfo |
|
|
|
from openpilot.selfdrive.car.docs_definitions import CarInfo |
|
|
|
from openpilot.selfdrive.car.fw_query_definitions import FwQueryConfig, Request, StdQueries |
|
|
|
from openpilot.selfdrive.car.fw_query_definitions import FwQueryConfig, Request, StdQueries |
|
|
|
|
|
|
|
|
|
|
@ -11,21 +11,23 @@ Ecu = car.CarParams.Ecu |
|
|
|
Button = namedtuple('Button', ['event_type', 'can_addr', 'can_msg', 'values']) |
|
|
|
Button = namedtuple('Button', ['event_type', 'can_addr', 'can_msg', 'values']) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class CAR(StrEnum): |
|
|
|
@dataclass |
|
|
|
AP1_MODELS = 'TESLA AP1 MODEL S' |
|
|
|
class TeslaPlatformConfig(PlatformConfig): |
|
|
|
AP2_MODELS = 'TESLA AP2 MODEL S' |
|
|
|
dbc_dict: DbcDict = field(default_factory=lambda: dbc_dict('tesla_powertrain', 'tesla_radar', chassis_dbc='tesla_can')) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CAR_INFO: dict[str, CarInfo | list[CarInfo]] = { |
|
|
|
class CAR(Platforms): |
|
|
|
CAR.AP1_MODELS: CarInfo("Tesla AP1 Model S", "All"), |
|
|
|
AP1_MODELS = TeslaPlatformConfig( |
|
|
|
CAR.AP2_MODELS: CarInfo("Tesla AP2 Model S", "All"), |
|
|
|
'TESLA AP1 MODEL S', |
|
|
|
} |
|
|
|
CarInfo("Tesla AP1 Model S", "All"), |
|
|
|
|
|
|
|
specs=CarSpecs(mass=2100., wheelbase=2.959, steerRatio=15.0) |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
AP2_MODELS = TeslaPlatformConfig( |
|
|
|
|
|
|
|
'TESLA AP2 MODEL S', |
|
|
|
|
|
|
|
CarInfo("Tesla AP2 Model S", "All"), |
|
|
|
|
|
|
|
specs=AP1_MODELS.specs |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
DBC = { |
|
|
|
|
|
|
|
CAR.AP2_MODELS: dbc_dict('tesla_powertrain', 'tesla_radar', chassis_dbc='tesla_can'), |
|
|
|
|
|
|
|
CAR.AP1_MODELS: dbc_dict('tesla_powertrain', 'tesla_radar', chassis_dbc='tesla_can'), |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FW_QUERY_CONFIG = FwQueryConfig( |
|
|
|
FW_QUERY_CONFIG = FwQueryConfig( |
|
|
|
requests=[ |
|
|
|
requests=[ |
|
|
@ -88,3 +90,7 @@ class CarControllerParams: |
|
|
|
|
|
|
|
|
|
|
|
def __init__(self, CP): |
|
|
|
def __init__(self, CP): |
|
|
|
pass |
|
|
|
pass |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CAR_INFO = CAR.create_carinfo_map() |
|
|
|
|
|
|
|
DBC = CAR.create_dbc_map() |
|
|
|