2025-03-08 09:09:31 +00:00
|
|
|
import math
|
|
|
|
from opendbc.car import get_safety_config, structs
|
2025-04-18 20:38:55 +09:00
|
|
|
from opendbc.car.body.carcontroller import CarController
|
|
|
|
from opendbc.car.body.carstate import CarState
|
2025-03-08 09:09:31 +00:00
|
|
|
from opendbc.car.body.values import SPEED_FROM_RPM
|
2025-04-18 20:38:55 +09:00
|
|
|
from opendbc.car.interfaces import CarInterfaceBase
|
2025-03-08 09:09:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
class CarInterface(CarInterfaceBase):
|
2025-04-18 20:38:55 +09:00
|
|
|
CarState = CarState
|
|
|
|
CarController = CarController
|
|
|
|
|
2025-03-08 09:09:31 +00:00
|
|
|
@staticmethod
|
2025-04-18 20:38:55 +09:00
|
|
|
def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, alpha_long, docs) -> structs.CarParams:
|
2025-03-08 09:09:31 +00:00
|
|
|
ret.notCar = True
|
|
|
|
ret.brand = "body"
|
|
|
|
ret.safetyConfigs = [get_safety_config(structs.CarParams.SafetyModel.body)]
|
|
|
|
|
|
|
|
ret.minSteerSpeed = -math.inf
|
|
|
|
ret.maxLateralAccel = math.inf # TODO: set to a reasonable value
|
|
|
|
ret.steerLimitTimer = 1.0
|
|
|
|
ret.steerActuatorDelay = 0.
|
|
|
|
|
|
|
|
ret.wheelSpeedFactor = SPEED_FROM_RPM
|
|
|
|
|
|
|
|
ret.radarUnavailable = True
|
|
|
|
ret.openpilotLongitudinalControl = True
|
|
|
|
ret.steerControlType = structs.CarParams.SteerControlType.angle
|
|
|
|
|
|
|
|
return ret
|