Skip to content

Commit

Permalink
Proper alerts on Eon and disable flashing HUD alert when blinkers on …
Browse files Browse the repository at this point in the history
…or LKAS off (commaai#63)

* Disable steer alert when LKAS off

* Display steering unavailable on Eon when LKAS off

* Revert chime disable in favor of new method

* x_lead < 6 or (x_lead < 17.5 and self.v_rel < 0.5)

* logic correction on HUD alert

* blinkers on disables HUD alarm

* Add Manual Steering alert for LKAS Off mode

* Call manual steering alert when LKAS off

* Call blinkers alert when blinkers on

* Add blinkers alert

* Adjust Blinkers alert logic to include LKAS mode

* Fix blinker logic

* Add new steering required alerts to capnp

* Trace LKAS / LDW error

* Disable hud alert when LKAS off or blinkers on

* Disable HUD alerts if LKAS off or blinkers on

* Disable other ACC alert if LKAS off or blinkers on

* Revert testing of steering required alert override

* Disable steer saturate alert if blinkers on or LKAS off

* Disable steer sat alert if LKAS off or blinkers on

* Revert steerSaturated logic

* disable steer limit alert when LKAS off or blinkers on

* Fix Syntax error

* Revert  steerLimit alert disable

* Disable steerSat alert when blinkers on or LKAS off

* Revert stopping distance to default for pedal lurch

* Re-intro 2m stopping distance
  • Loading branch information
NeonGalaxy75 committed Dec 13, 2018
1 parent a78102b commit 72ccad5
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 5 deletions.
2 changes: 2 additions & 0 deletions cereal/car.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ struct CarEvent @0x9b1657f34caf3ad3 {
calibrationProgress @47;
lowBattery @48;
invalidGiraffeHonda @49;
manualSteeringRequired @50;
manualSteeringRequiredBlinkersOn @51;
}
}

Expand Down
7 changes: 4 additions & 3 deletions selfdrive/car/honda/carcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def process_hud_alert(hud_alert):
fcw_display = 0
steer_required = 0
acc_alert = 0

if hud_alert == AH.NONE: # no alert
pass
elif hud_alert == AH.FCW: # FCW
Expand All @@ -64,7 +65,7 @@ def process_hud_alert(hud_alert):
steer_required = hud_alert[1]
else: # any other ACC alert
acc_alert = hud_alert[1]

return fcw_display, steer_required, acc_alert


Expand Down Expand Up @@ -124,8 +125,8 @@ def update(self, sendcan, enabled, CS, frame, actuators, \
snd_beep = snd_beep if snd_beep is not 0 else snd_chime

# Do not send audible alert when steering is disabled or blinkers on
if not CS.lkMode or CS.left_blinker_on or CS.right_blinker_on:
snd_chime = 0
#if not CS.lkMode or CS.left_blinker_on or CS.right_blinker_on:
# snd_chime = 0

#print chime, alert_id, hud_alert
fcw_display, steer_required, acc_alert = process_hud_alert(hud_alert)
Expand Down
6 changes: 5 additions & 1 deletion selfdrive/car/honda/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,11 @@ def update(self, c):
else:
self.cam_can_invalid_count = 0

if self.CS.steer_error:
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.steer_error:
events.append(create_event('steerUnavailable', [ET.NO_ENTRY, ET.IMMEDIATE_DISABLE, ET.PERMANENT]))
elif self.CS.steer_warning:
events.append(create_event('steerTempUnavailable', [ET.WARNING]))
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/controls/controlsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def state_control(plan, CS, CP, state, events, v_cruise_kph, v_cruise_kph_last,
CS.steeringPressed, plan.dPoly, angle_offset, CP, VM, PL)

# Send a "steering required alert" if saturation count has reached the limit
if LaC.sat_flag and CP.steerLimitAlert:
if LaC.sat_flag and CP.steerLimitAlert and CS.lkMode and not CS.leftBlinker and not CS.rightBlinker:
AM.add("steerSaturated", enabled)

# Parse permanent warnings to display constantly
Expand Down
14 changes: 14 additions & 0 deletions selfdrive/controls/lib/alerts.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,20 @@ def __gt__(self, alert2):
"Steering Temporarily Unavailable",
AlertStatus.userPrompt, AlertSize.mid,
Priority.LOW, VisualAlert.none, AudibleAlert.none, .2, .2, .2),

Alert(
"manualSteeringRequired",
"MANUAL STEERING REQUIRED",
"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(
"preDriverDistracted",
Expand Down

0 comments on commit 72ccad5

Please sign in to comment.