38 lines
1.3 KiB
Python
Raw Normal View History

from opendbc.car import get_safety_config, structs
from opendbc.car.interfaces import CarInterfaceBase
2025-04-18 20:38:55 +09:00
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):
2025-04-18 20:38:55 +09:00
CarState = CarState
CarController = CarController
RadarInterface = RadarInterface
@staticmethod
2025-04-18 20:38:55 +09:00
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)]
2025-04-18 20:38:55 +09:00
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
2025-04-18 20:38:55 +09:00
ret.alphaLongitudinalAvailable = False
if alpha_long:
ret.openpilotLongitudinalControl = True
2025-04-18 20:38:55 +09:00
ret.safetyConfigs[0].safetyParam |= RivianSafetyFlags.LONG_CONTROL.value
ret.longitudinalActuatorDelay = 0.35
ret.vEgoStopping = 0.25
ret.stopAccel = 0
return ret