From e1f23b816ab4b2271b51cf18e201b3d475bfafe8 Mon Sep 17 00:00:00 2001 From: tb205gti Date: Thu, 31 Oct 2019 19:21:58 +0100 Subject: [PATCH] Disable HSO for 3 seconds after blinker has been active (#111) Avoid HSO will deactivate and try to take the car back into the lane during a manual lane change with blinker tapped (3 blinks mode) --- selfdrive/car/tesla/HSO_module.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/selfdrive/car/tesla/HSO_module.py b/selfdrive/car/tesla/HSO_module.py index fba539b5f..b7de9ad6a 100644 --- a/selfdrive/car/tesla/HSO_module.py +++ b/selfdrive/car/tesla/HSO_module.py @@ -18,6 +18,7 @@ def __init__(self,carcontroller): self.frame_blinker_on = 0 self.last_human_blinker_on = 0 self.frame_human_blinker_on = 0 + self.HSO_numb_period = 150 def update_stat(self,CC,CS,enabled,actuators,frame): @@ -54,7 +55,7 @@ def update_stat(self,CC,CS,enabled,actuators,frame): steer_current=(CS.angle_steers) # Formula to convert current steering angle to match apply_steer calculated number apply_steer = int(-actuators.steerAngle) angle = abs(apply_steer-steer_current) - if angle > 15.: + if frame < (self.frame_blinker_on + self.HSO_numb_period) or angle > 15.: self.frame_humanSteered = frame if enabled: if CS.enableHSO: