Skip to content

Commit 87849f9

Browse files
better steer fault names (commaai#23890)
* better steer fault names * bump cereal
1 parent 825c924 commit 87849f9

File tree

16 files changed

+23
-23
lines changed

16 files changed

+23
-23
lines changed

cereal

selfdrive/car/chrysler/carstate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def update(self, cp, cp_cam):
5858
ret.steeringTorqueEps = cp.vl["EPS_STATUS"]["TORQUE_MOTOR"]
5959
ret.steeringPressed = abs(ret.steeringTorque) > STEER_THRESHOLD
6060
steer_state = cp.vl["EPS_STATUS"]["LKAS_STATE"]
61-
ret.steerError = steer_state == 4 or (steer_state == 0 and ret.vEgo > self.CP.minSteerSpeed)
61+
ret.steerFaultPermanent = steer_state == 4 or (steer_state == 0 and ret.vEgo > self.CP.minSteerSpeed)
6262

6363
ret.genericToggle = bool(cp.vl["STEERING_LEVERS"]["HIGH_BEAM_FLASH"])
6464

selfdrive/car/ford/carstate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def update(self, cp):
2323
ret.standstill = not ret.vEgoRaw > 0.001
2424
ret.steeringAngleDeg = cp.vl["Steering_Wheel_Data_CG1"]["SteWhlRelInit_An_Sns"]
2525
ret.steeringPressed = not cp.vl["Lane_Keep_Assist_Status"]["LaHandsOff_B_Actl"]
26-
ret.steerError = cp.vl["Lane_Keep_Assist_Status"]["LaActDeny_B_Actl"] == 1
26+
ret.steerFaultPermanent = cp.vl["Lane_Keep_Assist_Status"]["LaActDeny_B_Actl"] == 1
2727
ret.cruiseState.speed = cp.vl["Cruise_Status"]["Set_Speed"] * CV.MPH_TO_MS
2828
ret.cruiseState.enabled = not (cp.vl["Cruise_Status"]["Cruise_State"] in (0, 3))
2929
ret.cruiseState.available = cp.vl["Cruise_Status"]["Cruise_State"] != 0

selfdrive/car/gm/carcontroller.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def update(self, c, enabled, CS, frame, actuators,
4141
if CS.lka_steering_cmd_counter != self.lka_steering_cmd_counter_last:
4242
self.lka_steering_cmd_counter_last = CS.lka_steering_cmd_counter
4343
elif (frame % P.STEER_STEP) == 0:
44-
lkas_enabled = c.active and not (CS.out.steerWarning or CS.out.steerError) and CS.out.vEgo > P.MIN_STEER_SPEED
44+
lkas_enabled = c.active and not (CS.out.steerFaultTemporary or CS.out.steerFaultPermanent) and CS.out.vEgo > P.MIN_STEER_SPEED
4545
if lkas_enabled:
4646
new_steer = int(round(actuators.steer * P.STEER_MAX))
4747
apply_steer = apply_std_steer_torque_limits(new_steer, self.apply_steer_last, CS.out.steeringTorque, P)

selfdrive/car/gm/carstate.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ def update(self, pt_cp, loopback_cp):
4545

4646
# 0 inactive, 1 active, 2 temporarily limited, 3 failed
4747
self.lkas_status = pt_cp.vl["PSCMStatus"]["LKATorqueDeliveredStatus"]
48-
ret.steerWarning = self.lkas_status == 2
49-
ret.steerError = self.lkas_status == 3
48+
ret.steerFaultTemporary = self.lkas_status == 2
49+
ret.steerFaultPermanent = self.lkas_status == 3
5050

5151
# 1 - open, 0 - closed
5252
ret.doorOpen = (pt_cp.vl["BCMDoorBeltStatus"]["FrontLeftDoor"] == 1 or

selfdrive/car/honda/carstate.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,11 @@ def update(self, cp, cp_cam, cp_body):
197197
ret.seatbeltUnlatched = bool(cp.vl["SEATBELT_STATUS"]["SEATBELT_DRIVER_LAMP"] or not cp.vl["SEATBELT_STATUS"]["SEATBELT_DRIVER_LATCHED"])
198198

199199
steer_status = self.steer_status_values[cp.vl["STEER_STATUS"]["STEER_STATUS"]]
200-
ret.steerError = steer_status not in ("NORMAL", "NO_TORQUE_ALERT_1", "NO_TORQUE_ALERT_2", "LOW_SPEED_LOCKOUT", "TMP_FAULT")
200+
ret.steerFaultPermanent = steer_status not in ("NORMAL", "NO_TORQUE_ALERT_1", "NO_TORQUE_ALERT_2", "LOW_SPEED_LOCKOUT", "TMP_FAULT")
201201
# NO_TORQUE_ALERT_2 can be caused by bump OR steering nudge from driver
202202
self.steer_not_allowed = steer_status not in ("NORMAL", "NO_TORQUE_ALERT_2")
203203
# LOW_SPEED_LOCKOUT is not worth a warning
204-
ret.steerWarning = steer_status not in ("NORMAL", "LOW_SPEED_LOCKOUT", "NO_TORQUE_ALERT_2")
204+
ret.steerFaultTemporary = steer_status not in ("NORMAL", "LOW_SPEED_LOCKOUT", "NO_TORQUE_ALERT_2")
205205

206206
if self.CP.openpilotLongitudinalControl:
207207
self.brake_error = cp.vl["STANDSTILL"]["BRAKE_ERROR_1"] or cp.vl["STANDSTILL"]["BRAKE_ERROR_2"]

selfdrive/car/hyundai/carcontroller.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def update(self, c, enabled, CS, frame, actuators, pcm_cancel_cmd, visual_alert,
5454
self.steer_rate_limited = new_steer != apply_steer
5555

5656
# disable when temp fault is active, or below LKA minimum speed
57-
lkas_active = c.active and not CS.out.steerWarning and CS.out.vEgo >= CS.CP.minSteerSpeed
57+
lkas_active = c.active and not CS.out.steerFaultTemporary and CS.out.vEgo >= CS.CP.minSteerSpeed
5858

5959
if not lkas_active:
6060
apply_steer = 0

selfdrive/car/hyundai/carstate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def update(self, cp, cp_cam):
4747
ret.steeringTorque = cp.vl["MDPS12"]["CR_Mdps_StrColTq"]
4848
ret.steeringTorqueEps = cp.vl["MDPS12"]["CR_Mdps_OutTq"]
4949
ret.steeringPressed = abs(ret.steeringTorque) > STEER_THRESHOLD
50-
ret.steerWarning = cp.vl["MDPS12"]["CF_Mdps_ToiUnavail"] != 0 or cp.vl["MDPS12"]["CF_Mdps_ToiFlt"] != 0
50+
ret.steerFaultTemporary = cp.vl["MDPS12"]["CF_Mdps_ToiUnavail"] != 0 or cp.vl["MDPS12"]["CF_Mdps_ToiFlt"] != 0
5151

5252
# cruise state
5353
if self.CP.openpilotLongitudinalControl:

selfdrive/car/interfaces.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def create_common_events(self, cs_out, extra_gears=None, pcm_enable=True):
143143

144144
# Handle permanent and temporary steering faults
145145
self.steering_unpressed = 0 if cs_out.steeringPressed else self.steering_unpressed + 1
146-
if cs_out.steerWarning:
146+
if cs_out.steerFaultTemporary:
147147
# if the user overrode recently, show a less harsh alert
148148
if self.silent_steer_warning or cs_out.standstill or self.steering_unpressed < int(1.5 / DT_CTRL):
149149
self.silent_steer_warning = True
@@ -152,7 +152,7 @@ def create_common_events(self, cs_out, extra_gears=None, pcm_enable=True):
152152
events.add(EventName.steerTempUnavailable)
153153
else:
154154
self.silent_steer_warning = False
155-
if cs_out.steerError:
155+
if cs_out.steerFaultPermanent:
156156
events.add(EventName.steerUnavailable)
157157

158158
# Disable on rising edge of gas or brake. Also disable on brake when speed > 0.

selfdrive/car/mazda/carstate.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def update(self, cp, cp_cam):
8888
# Check if LKAS is disabled due to lack of driver torque when all other states indicate
8989
# it should be enabled (steer lockout). Don't warn until we actually get lkas active
9090
# and lose it again, i.e, after initial lkas activation
91-
ret.steerWarning = self.lkas_allowed_speed and lkas_blocked
91+
ret.steerFaultTemporary = self.lkas_allowed_speed and lkas_blocked
9292

9393
self.acc_active_last = ret.cruiseState.enabled
9494

@@ -98,7 +98,7 @@ def update(self, cp, cp_cam):
9898
self.lkas_disabled = cp_cam.vl["CAM_LANEINFO"]["LANE_LINES"] == 0
9999
self.cam_lkas = cp_cam.vl["CAM_LKAS"]
100100
self.cam_laneinfo = cp_cam.vl["CAM_LANEINFO"]
101-
ret.steerError = cp_cam.vl["CAM_LKAS"]["ERR_BIT_1"] == 1
101+
ret.steerFaultPermanent = cp_cam.vl["CAM_LKAS"]["ERR_BIT_1"] == 1
102102

103103
return ret
104104

selfdrive/car/subaru/carstate.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ def update(self, cp, cp_cam):
6262
cp.vl["BodyInfo"]["DOOR_OPEN_RL"],
6363
cp.vl["BodyInfo"]["DOOR_OPEN_FR"],
6464
cp.vl["BodyInfo"]["DOOR_OPEN_FL"]])
65-
ret.steerError = cp.vl["Steering_Torque"]["Steer_Error_1"] == 1
65+
ret.steerFaultPermanent = cp.vl["Steering_Torque"]["Steer_Error_1"] == 1
6666

6767
if self.car_fingerprint in PREGLOBAL_CARS:
6868
self.cruise_button = cp_cam.vl["ES_Distance"]["Cruise_Button"]
6969
self.ready = not cp_cam.vl["ES_DashStatus"]["Not_Ready_Startup"]
7070
else:
71-
ret.steerWarning = cp.vl["Steering_Torque"]["Steer_Warning"] == 1
71+
ret.steerFaultTemporary = cp.vl["Steering_Torque"]["Steer_Warning"] == 1
7272
ret.cruiseState.nonAdaptive = cp_cam.vl["ES_DashStatus"]["Conventional_Cruise"] == 1
7373
self.es_lkas_msg = copy.copy(cp_cam.vl["ES_LKAS_State"])
7474
self.es_distance_msg = copy.copy(cp_cam.vl["ES_Distance"])

selfdrive/car/tesla/carstate.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ def update(self, cp, cp_cam):
4343
ret.steeringRateDeg = -cp.vl["STW_ANGLHP_STAT"]["StW_AnglHP_Spd"] # This is from a different angle sensor, and at different rate
4444
ret.steeringTorque = -cp.vl["EPAS_sysStatus"]["EPAS_torsionBarTorque"]
4545
ret.steeringPressed = (self.hands_on_level > 0)
46-
ret.steerError = steer_status == "EAC_FAULT"
47-
ret.steerWarning = self.steer_warning != "EAC_ERROR_IDLE"
46+
ret.steerFaultPermanent = steer_status == "EAC_FAULT"
47+
ret.steerFaultTemporary = self.steer_warning != "EAC_ERROR_IDLE"
4848

4949
# Cruise state
5050
cruise_state = self.can_define.dv["DI_state"]["DI_cruiseState"].get(int(cp.vl["DI_state"]["DI_cruiseState"]), None)

selfdrive/car/toyota/carstate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def update(self, cp, cp_cam):
8181
ret.steeringTorqueEps = cp.vl["STEER_TORQUE_SENSOR"]["STEER_TORQUE_EPS"] * self.eps_torque_scale
8282
# we could use the override bit from dbc, but it's triggered at too high torque values
8383
ret.steeringPressed = abs(ret.steeringTorque) > STEER_THRESHOLD
84-
ret.steerWarning = cp.vl["EPS_STATUS"]["LKA_STATE"] not in (1, 5)
84+
ret.steerFaultTemporary = cp.vl["EPS_STATUS"]["LKA_STATE"] not in (1, 5)
8585

8686
if self.CP.carFingerprint in (CAR.LEXUS_IS, CAR.LEXUS_RC):
8787
ret.cruiseState.available = cp.vl["DSU_CRUISE"]["MAIN_ON"] != 0

selfdrive/car/volkswagen/carcontroller.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def update(self, c, enabled, CS, frame, ext_bus, actuators, visual_alert, left_l
3939
# torque value. Do that anytime we happen to have 0 torque, or failing that,
4040
# when exceeding ~1/3 the 360 second timer.
4141

42-
if c.active and CS.out.vEgo > CS.CP.minSteerSpeed and not (CS.out.standstill or CS.out.steerError or CS.out.steerWarning):
42+
if c.active and CS.out.vEgo > CS.CP.minSteerSpeed and not (CS.out.standstill or CS.out.steerFaultPermanent or CS.out.steerFaultTemporary):
4343
new_steer = int(round(actuators.steer * P.STEER_MAX))
4444
apply_steer = apply_std_steer_torque_limits(new_steer, self.apply_steer_last, CS.out.steeringTorque, P)
4545
self.steer_rate_limited = new_steer != apply_steer

selfdrive/car/volkswagen/carstate.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ def update(self, pt_cp, cam_cp, ext_cp, trans_type):
4141

4242
# Verify EPS readiness to accept steering commands
4343
hca_status = self.hca_status_values.get(pt_cp.vl["LH_EPS_03"]["EPS_HCA_Status"])
44-
ret.steerError = hca_status in ("DISABLED", "FAULT")
45-
ret.steerWarning = hca_status in ("INITIALIZING", "REJECTED")
44+
ret.steerFaultPermanent = hca_status in ("DISABLED", "FAULT")
45+
ret.steerFaultTemporary = hca_status in ("INITIALIZING", "REJECTED")
4646

4747
# Update gas, brakes, and gearshift.
4848
ret.gas = pt_cp.vl["Motor_20"]["MO_Fahrpedalrohwert_01"] / 100.0

selfdrive/controls/controlsd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ def state_control(self, CS):
496496
actuators.accel = self.LoC.update(self.active, CS, self.CP, long_plan, pid_accel_limits, t_since_plan)
497497

498498
# Steering PID loop and lateral MPC
499-
lat_active = self.active and not CS.steerWarning and not CS.steerError and CS.vEgo > self.CP.minSteerSpeed
499+
lat_active = self.active and not CS.steerFaultTemporary and not CS.steerFaultPermanent and CS.vEgo > self.CP.minSteerSpeed
500500
desired_curvature, desired_curvature_rate = get_lag_adjusted_curvature(self.CP, CS.vEgo,
501501
lat_plan.psis,
502502
lat_plan.curvatures,

0 commit comments

Comments
 (0)