Skip to content

Commit

Permalink
fix speed too low (#1628)
Browse files Browse the repository at this point in the history
  • Loading branch information
adeebshihadeh authored Jun 3, 2020
1 parent 682dc5d commit db7ea2a
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions cereal/car.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ struct CarEvent @0x9b1657f34caf3ad3 {
whitePandaUnsupported @81;
startupWhitePanda @82;
canErrorPersistent @83;
belowEngageSpeed @84;
}
}

Expand Down
2 changes: 1 addition & 1 deletion selfdrive/car/gm/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def update(self, c, can_strings):
events = self.create_common_events(ret, pcm_enable=False)

if ret.vEgo < self.CP.minEnableSpeed:
events.add(EventName.speedTooLow)
events.add(EventName.belowEngageSpeed)
if self.CS.park_brake:
events.add(EventName.parkBrake)
if ret.cruiseState.standstill:
Expand Down
4 changes: 2 additions & 2 deletions selfdrive/car/honda/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,12 +476,12 @@ def update(self, c, can_strings):
events.add(EventName.parkBrake)

if self.CP.enableCruise and ret.vEgo < self.CP.minEnableSpeed:
events.add(EventName.speedTooLow)
events.add(EventName.belowEngageSpeed)

# it can happen that car cruise disables while comma system is enabled: need to
# keep braking if needed or if the speed is very low
if self.CP.enableCruise and not ret.cruiseState.enabled \
and (c.actuators.brake <= 0. or not self.CP.openpilotLongitudinalControl) and (self.CP.minEnableSpeed > 0):
and (c.actuators.brake <= 0. or not self.CP.openpilotLongitudinalControl):
# non loud alert if cruise disables below 25mph as expected (+ a little margin)
if ret.vEgo < self.CP.minEnableSpeed + 2.:
events.add(EventName.speedTooLow)
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/car/mazda/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def update(self, c, can_strings):
events = self.create_common_events(ret)

if self.CS.low_speed_lockout:
events.add(EventName.speedTooLow)
events.add(EventName.belowEngageSpeed)

if self.CS.low_speed_alert:
events.add(EventName.belowSteerSpeed)
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/car/toyota/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ def update(self, c, can_strings):
if self.CS.low_speed_lockout and self.CP.openpilotLongitudinalControl:
events.add(EventName.lowSpeedLockout)
if ret.vEgo < self.CP.minEnableSpeed and self.CP.openpilotLongitudinalControl:
events.add(EventName.speedTooLow)
events.add(EventName.belowEngageSpeed)
if c.actuators.gas > 0.1:
# some margin on the actuator to not false trigger cancellation while stopping
events.add(EventName.speedTooLow)
Expand Down
5 changes: 4 additions & 1 deletion selfdrive/controls/lib/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,10 @@ def calibration_incomplete_alert(CP, sm, metric):
duration_hud_alert=0.),
},

EventName.belowEngageSpeed: {
ET.NO_ENTRY: NoEntryAlert("Speed Too Low"),
},

EventName.sensorDataInvalid: {
ET.PERMANENT: Alert(
"No Data from Device Sensors",
Expand Down Expand Up @@ -677,7 +681,6 @@ def calibration_incomplete_alert(CP, sm, metric):
"Speed too low",
AlertStatus.normal, AlertSize.mid,
Priority.HIGH, VisualAlert.none, AudibleAlert.chimeDisengage, .4, 2., 3.),
ET.NO_ENTRY: NoEntryAlert("Speed Too Low"),
},

EventName.speedTooHigh: {
Expand Down

0 comments on commit db7ea2a

Please sign in to comment.