From 4cddcdd879e69e81ce8d8a3c26d5186d0d82145c Mon Sep 17 00:00:00 2001 From: Landon Orr Date: Fri, 18 Jan 2019 07:58:05 -0700 Subject: [PATCH] Separate events and alerts for blinker signals. (#105) * Add separate events for left and right turn signals. * Break out events for left and right blinker signals. * Created separate alerts for right and left blinker signals. --- cereal/car.capnp | 3 ++- selfdrive/car/honda/interface.py | 6 ++++-- selfdrive/controls/lib/alerts.py | 21 ++++++++++++++------- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/cereal/car.capnp b/cereal/car.capnp index 9a5d0198e45089..be7c908facbfd2 100644 --- a/cereal/car.capnp +++ b/cereal/car.capnp @@ -73,7 +73,8 @@ struct CarEvent @0x9b1657f34caf3ad3 { lowBattery @48; invalidGiraffeHonda @49; manualSteeringRequired @50; - manualSteeringRequiredBlinkersOn @51; + manualSteeringRequiredBlinkerOnLeft @51; + manualSteeringRequiredBlinkerOnRight @52; } } diff --git a/selfdrive/car/honda/interface.py b/selfdrive/car/honda/interface.py index 2f6052e6e020bc..10efaee3da9fea 100755 --- a/selfdrive/car/honda/interface.py +++ b/selfdrive/car/honda/interface.py @@ -522,8 +522,10 @@ def update(self, c): if not self.CS.lkMode: events.append(create_event('manualSteeringRequired', [ET.WARNING])) - elif self.CS.lkMode and (self.CS.left_blinker_on or self.CS.right_blinker_on): - events.append(create_event('manualSteeringRequiredBlinkersOn', [ET.WARNING])) + elif self.CS.lkMode and self.CS.left_blinker_on: + events.append(create_event('manualSteeringRequiredBlinkerOnLeft', [ET.WARNING])) + elif self.CS.lkMode and self.CS.right_blinker_on: + events.append(create_event('manualSteeringRequiredBlinkerOnRight', [ET.WARNING])) elif self.CS.steer_error: events.append(create_event('steerUnavailable', [ET.NO_ENTRY, ET.IMMEDIATE_DISABLE, ET.PERMANENT])) elif self.CS.steer_warning: diff --git a/selfdrive/controls/lib/alerts.py b/selfdrive/controls/lib/alerts.py index fb3473a4a62f1c..13ebf7f3f460d7 100644 --- a/selfdrive/controls/lib/alerts.py +++ b/selfdrive/controls/lib/alerts.py @@ -107,13 +107,20 @@ def __gt__(self, alert2): "Steering is Off - Press LKAS button to turn On", AlertStatus.userPrompt, AlertSize.mid, Priority.LOW, VisualAlert.none, AudibleAlert.none, .2, .2, .2), - - Alert( - "manualSteeringRequiredBlinkersOn", - "MANUAL STEERING REQUIRED", - "Left or Right Signal is On", - AlertStatus.userPrompt, AlertSize.mid, - Priority.LOW, VisualAlert.none, AudibleAlert.none, .2, .2, .2), + + Alert( + "manualSteeringRequiredBlinkerOnLeft", + "MANUAL STEERING REQUIRED", + "Left Turn Signal is On", + AlertStatus.userPrompt, AlertSize.mid, + Priority.LOW, VisualAlert.none, AudibleAlert.none, .2, .2, .2), + + Alert( + "manualSteeringRequiredBlinkerOnRight", + "MANUAL STEERING REQUIRED", + "Right Turn Signal is On", + AlertStatus.userPrompt, AlertSize.mid, + Priority.LOW, VisualAlert.none, AudibleAlert.none, .2, .2, .2), Alert( "preDriverDistracted",