Skip to content

Commit

Permalink
enable experimental long
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasloetkolben committed Jan 21, 2025
1 parent 780101e commit b912744
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions opendbc/car/rivian/carstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ def update(self, can_parsers) -> structs.CarState:
ret.steerFaultTemporary = cp.vl["EPAS_AdasStatus"]["EPAS_EacErrorCode"] != 0

# Cruise state
# speed = min(int(cp_adas.vl["ACM_tsrCmd"]["ACM_tsrSpdDisClsMain"]), 85)
# self.last_speed = speed if speed != 0 else self.last_speed
speed = min(int(cp_adas.vl["ACM_tsrCmd"]["ACM_tsrSpdDisClsMain"]), 85)
self.last_speed = speed if speed != 0 else self.last_speed
ret.cruiseState.enabled = cp_cam.vl["ACM_Status"]["ACM_FeatureStatus"] == 1
ret.cruiseState.speed = 15 # self.last_speed * CV.MPH_TO_MS # detected speed limit
ret.cruiseState.speed = self.last_speed * CV.MPH_TO_MS # detected speed limit
ret.cruiseState.available = True # cp.vl["VDM_AdasSts"]["VDM_AdasInterfaceStatus"] == 1
ret.cruiseState.standstill = False # cp.vl["VDM_AdasSts"]["VDM_AdasAccelRequestAcknowledged"]

Expand Down
11 changes: 6 additions & 5 deletions opendbc/car/rivian/interface.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
from opendbc.car import get_safety_config, structs
from opendbc.car.interfaces import CarInterfaceBase
from opendbc.car.rivian.values import CAR
from panda import Panda


class CarInterface(CarInterfaceBase):
Expand All @@ -20,14 +20,15 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experime
ret.steerLimitTimer = 0.4
CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning)


ret.steerControlType = structs.CarParams.SteerControlType.torque
ret.radarUnavailable = True

# ret.safetyConfigs[0].safetyParam |= Panda.FLAG_RIVIAN_LONG_CONTROL
ret.experimentalLongitudinalAvailable = True
if experimental_long:
ret.openpilotLongitudinalControl = True
ret.safetyConfigs[0].safetyParam |= Panda.FLAG_RIVIAN_LONG_CONTROL

ret.vEgoStopping = 0.25
ret.stopAccel = 0

ret.openpilotLongitudinalControl = False

return ret

0 comments on commit b912744

Please sign in to comment.