openpilot crashed alert

This commit is contained in:
FrogAi
2024-02-27 16:34:47 -07:00
parent bf662b69ba
commit 4004dbed00
4 changed files with 24 additions and 3 deletions

View File

@@ -76,7 +76,12 @@ struct Alert {
const int controls_missing = (nanos_since_boot() - sm.rcv_time("controlsState")) / 1e9;
// Handle controls timeout
if (controls_frame < started_frame) {
if (std::ifstream("/data/community/crashes/error.txt")) {
alert = {"openpilot crashed", "Please post the error log in the FrogPilot Discord!",
"controlsWaiting", cereal::ControlsState::AlertSize::MID,
cereal::ControlsState::AlertStatus::NORMAL,
AudibleAlert::NONE};
} else if (controls_frame < started_frame) {
// car is started, but controlsState hasn't been seen at all
alert = {"openpilot Unavailable", "Waiting for controls to start",
"controlsWaiting", cereal::ControlsState::AlertSize::MID,