Skip to content

Commit

Permalink
Separate events and alerts for blinker signals. (#105)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
metroshica authored and kegman committed Jan 18, 2019
1 parent 0260633 commit 4cddcdd
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 10 deletions.
3 changes: 2 additions & 1 deletion cereal/car.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ struct CarEvent @0x9b1657f34caf3ad3 {
lowBattery @48;
invalidGiraffeHonda @49;
manualSteeringRequired @50;
manualSteeringRequiredBlinkersOn @51;
manualSteeringRequiredBlinkerOnLeft @51;
manualSteeringRequiredBlinkerOnRight @52;
}
}

Expand Down
6 changes: 4 additions & 2 deletions selfdrive/car/honda/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
21 changes: 14 additions & 7 deletions selfdrive/controls/lib/alerts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 4cddcdd

Please sign in to comment.