Skip to content

Commit e5a4cb4

Browse files
enable experimental long
1 parent 780101e commit e5a4cb4

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

opendbc/car/rivian/carstate.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ def update(self, can_parsers) -> structs.CarState:
4242
ret.steerFaultTemporary = cp.vl["EPAS_AdasStatus"]["EPAS_EacErrorCode"] != 0
4343

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

@@ -96,7 +96,7 @@ def get_can_parsers(CP):
9696

9797
adas_messages = [
9898
("IndicatorLights", 10),
99-
# ("ACM_tsrCmd", 10),
99+
("ACM_tsrCmd", 10),
100100
]
101101

102102
return {

opendbc/car/rivian/interface.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python3
22
from opendbc.car import get_safety_config, structs
33
from opendbc.car.interfaces import CarInterfaceBase
4-
from opendbc.car.rivian.values import CAR
4+
from panda import Panda
55

66

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

23-
2423
ret.steerControlType = structs.CarParams.SteerControlType.torque
2524
ret.radarUnavailable = True
2625

27-
# ret.safetyConfigs[0].safetyParam |= Panda.FLAG_RIVIAN_LONG_CONTROL
26+
ret.experimentalLongitudinalAvailable = True
27+
if experimental_long:
28+
ret.openpilotLongitudinalControl = True
29+
ret.safetyConfigs[0].safetyParam |= Panda.FLAG_RIVIAN_LONG_CONTROL
30+
2831
ret.vEgoStopping = 0.25
2932
ret.stopAccel = 0
3033

31-
ret.openpilotLongitudinalControl = False
32-
3334
return ret

0 commit comments

Comments
 (0)