mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-05 21:42:05 +08:00
don't wait for 4 seconds before it starts steering again after steering fault (#19520)
old-commit-hash: 89a600884138c59397670f2513bc5d0ba0ebc2b1
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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.),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user