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.
37 lines
1.3 KiB
37 lines
1.3 KiB
from opendbc.car import get_safety_config, structs
|
|
from opendbc.car.interfaces import CarInterfaceBase
|
|
from opendbc.car.rivian.carcontroller import CarController
|
|
from opendbc.car.rivian.carstate import CarState
|
|
from opendbc.car.rivian.radar_interface import RadarInterface
|
|
from opendbc.car.rivian.values import RivianSafetyFlags
|
|
|
|
|
|
class CarInterface(CarInterfaceBase):
|
|
CarState = CarState
|
|
CarController = CarController
|
|
RadarInterface = RadarInterface
|
|
|
|
@staticmethod
|
|
def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, alpha_long, docs) -> structs.CarParams:
|
|
ret.brand = "rivian"
|
|
|
|
ret.safetyConfigs = [get_safety_config(structs.CarParams.SafetyModel.rivian)]
|
|
|
|
ret.steerActuatorDelay = 0.15
|
|
ret.steerLimitTimer = 0.4
|
|
CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning)
|
|
|
|
ret.steerControlType = structs.CarParams.SteerControlType.torque
|
|
ret.radarUnavailable = True
|
|
|
|
# TODO: pending finding/handling missing set speed and fixing up radar parser
|
|
ret.alphaLongitudinalAvailable = False
|
|
if alpha_long:
|
|
ret.openpilotLongitudinalControl = True
|
|
ret.safetyConfigs[0].safetyParam |= RivianSafetyFlags.LONG_CONTROL.value
|
|
|
|
ret.longitudinalActuatorDelay = 0.35
|
|
ret.vEgoStopping = 0.25
|
|
ret.stopAccel = 0
|
|
|
|
return ret
|
|
|