Skip to content

Commit

Permalink
Disable HSO for 3 seconds after blinker has been active (#111)
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
tb205gti authored and BogGyver committed Oct 31, 2019
1 parent 0ef304e commit e1f23b8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion selfdrive/car/tesla/HSO_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit e1f23b8

Please sign in to comment.