1
0
forked from IQ.Lvbs/IQ.Pilot
Files
IQ.Pilot/iqdbc_repo/iqdbc/car/psa/values.py
2026-08-22 23:42:42 -05:00

55 lines
1.4 KiB
Python

from dataclasses import dataclass, field
from iqdbc.car.structs import CarParams
from iqdbc.car import Bus, CarSpecs, DbcDict, PlatformConfig, Platforms
from iqdbc.car.lateral import AngleSteeringLimits
from iqdbc.car.docs_definitions import CarDocs, CarHarness, CarParts
from iqdbc.car.fw_query_definitions import FwQueryConfig, Request, StdQueries
Ecu = CarParams.Ecu
class CarControllerParams:
STEER_STEP = 1
ANGLE_LIMITS: AngleSteeringLimits = AngleSteeringLimits(
390, # deg
([0., 5., 25.], [2.5, 1.5, .2]),
([0., 5., 25.], [5., 2., .3]),
)
STEER_DRIVER_ALLOWANCE = 5 # Driver intervention threshold, 0.5 Nm
@dataclass
class PSACarDocs(CarDocs):
package: str = "Adaptive Cruise Control (ACC) & Lane Assist"
car_parts: CarParts = field(default_factory=CarParts.common([CarHarness.psa_a]))
@dataclass
class PSAPlatformConfig(PlatformConfig):
dbc_dict: DbcDict = field(default_factory=lambda: {
Bus.pt: 'psa_aee2010_r3',
})
class CAR(Platforms):
PSA_PEUGEOT_208 = PSAPlatformConfig(
[PSACarDocs("Peugeot 208 2019-25")],
CarSpecs(mass=1530, wheelbase=2.54, steerRatio=17.6),
)
# Placeholder, FW Query will be added in separate PR
FW_QUERY_CONFIG = FwQueryConfig(
requests=[
Request(
[StdQueries.TESTER_PRESENT_REQUEST, StdQueries.UDS_VERSION_REQUEST],
[StdQueries.TESTER_PRESENT_RESPONSE, StdQueries.UDS_VERSION_RESPONSE],
bus=0,
),
],
)
DBC = CAR.create_dbc_map()