don't wait for 4 seconds before it starts steering again after steering fault (#19520)

old-commit-hash: 89a600884138c59397670f2513bc5d0ba0ebc2b1
This commit is contained in:
Shane Smiskol
2020-12-16 14:24:42 -06:00
committed by GitHub
parent 625a59c22a
commit aa326065b8
2 changed files with 3 additions and 8 deletions
+2 -7
View File
@@ -38,7 +38,6 @@ class CarController():
self.last_standstill = False
self.standstill_req = False
self.last_fault_frame = -200
self.steer_rate_limited = False
self.fake_ecus = set()
@@ -73,12 +72,8 @@ class CarController():
apply_steer = apply_toyota_steer_torque_limits(new_steer, self.last_steer, CS.out.steeringTorqueEps, SteerLimitParams)
self.steer_rate_limited = new_steer != apply_steer
# only cut torque when steer state is a known fault
if CS.steer_state in [9, 25]:
self.last_fault_frame = frame
# Cut steering for 2s after fault
if not enabled or (frame - self.last_fault_frame < 200):
# Cut steering while we're in a known fault state (2s)
if not enabled or CS.steer_state in [9, 25]:
apply_steer = 0
apply_steer_req = 0
else:
+1 -1
View File
@@ -519,7 +519,7 @@ EVENTS: Dict[int, Dict[str, Union[Alert, Callable[[Any, messaging.SubMaster, boo
"TAKE CONTROL",
"Steering Temporarily Unavailable",
AlertStatus.userPrompt, AlertSize.mid,
Priority.LOW, VisualAlert.steerRequired, AudibleAlert.chimeWarning1, .4, 2., 3.),
Priority.LOW, VisualAlert.steerRequired, AudibleAlert.chimeWarning1, .4, 2., 1.),
ET.NO_ENTRY: NoEntryAlert("Steering Temporarily Unavailable",
duration_hud_alert=0.),
},