Files
StarPilot/selfdrive/car/body/interface.py
T
Shane Smiskol d18a0868c6 move the body events to card (#33262)
* move the body events to card

* rm import
old-commit-hash: 093c09a7373868a77d8f9e56f7f26304601855dc
2024-08-11 20:25:08 -07:00

31 lines
917 B
Python

import math
from cereal import car
from openpilot.selfdrive.car import get_safety_config
from openpilot.selfdrive.car.interfaces import CarInterfaceBase
from openpilot.selfdrive.car.body.values import SPEED_FROM_RPM
class CarInterface(CarInterfaceBase):
@staticmethod
def _get_params(ret, candidate, fingerprint, car_fw, experimental_long, docs):
ret.notCar = True
ret.carName = "body"
ret.safetyConfigs = [get_safety_config(car.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 = car.CarParams.SteerControlType.angle
return ret
def _update(self, c):
ret = self.CS.update(self.cp)
return ret