You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1.1 KiB
35 lines
1.1 KiB
2 months ago
|
from opendbc.car import get_safety_config, structs
|
||
|
from opendbc.car.interfaces import CarInterfaceBase
|
||
|
from opendbc.car.tesla.carcontroller import CarController
|
||
|
from opendbc.car.tesla.carstate import CarState
|
||
|
from opendbc.car.tesla.values import TeslaSafetyFlags
|
||
|
|
||
|
|
||
|
class CarInterface(CarInterfaceBase):
|
||
|
CarState = CarState
|
||
|
CarController = CarController
|
||
|
|
||
|
@staticmethod
|
||
|
def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experimental_long, docs) -> structs.CarParams:
|
||
|
ret.brand = "tesla"
|
||
|
ret.dashcamOnly = True
|
||
|
|
||
|
ret.safetyConfigs = [get_safety_config(structs.CarParams.SafetyModel.tesla)]
|
||
|
|
||
|
ret.steerLimitTimer = 1.0
|
||
|
ret.steerActuatorDelay = 0.1
|
||
|
|
||
|
ret.steerControlType = structs.CarParams.SteerControlType.angle
|
||
|
ret.radarUnavailable = True
|
||
|
|
||
|
ret.experimentalLongitudinalAvailable = True
|
||
|
if experimental_long:
|
||
|
ret.openpilotLongitudinalControl = True
|
||
|
ret.safetyConfigs[0].safetyParam |= TeslaSafetyFlags.LONG_CONTROL.value
|
||
|
|
||
|
ret.vEgoStopping = 0.1
|
||
|
ret.vEgoStarting = 0.1
|
||
|
ret.stoppingDecelRate = 0.3
|
||
|
|
||
|
return ret
|