Force Drive State

This commit is contained in:
James
2025-12-01 12:00:00 -07:00
parent 0e7491ff12
commit 30db7d12df
7 changed files with 39 additions and 5 deletions
+1 -1
View File
@@ -344,7 +344,7 @@ class SelfdriveD:
self.events.add(EventName.usbError)
if CS.canTimeout:
self.events.add(EventName.canBusMissing)
elif not CS.canValid:
elif not CS.canValid and not self.frogpilot_toggles.force_onroad:
self.events.add(EventName.canError)
# generic catch-all. ideally, a more specific event should be added above instead
+1 -1
View File
@@ -51,7 +51,7 @@ OnroadAlerts::Alert OnroadAlerts::getAlert(const SubMaster &sm, const SubMaster
}
}
if (!sm.updated("selfdriveState") && (sm.frame - started_frame) > 5 * UI_FREQ) {
if (!sm.updated("selfdriveState") && (sm.frame - started_frame) > 5 * UI_FREQ && !frogpilot_toggles.value("force_onroad").toBool()) {
const int SELFDRIVE_STATE_TIMEOUT = 5;
const int ss_missing = (nanos_since_boot() - sm.rcv_time("selfdriveState")) / 1e9;
+2
View File
@@ -77,6 +77,8 @@ static void update_state(UIState *s, FrogPilotUIState *fs) {
if (scene.started) {
frogpilot_scene.started_timer += 1;
}
scene.started |= frogpilot_scene.frogpilot_toggles.value("force_onroad").toBool();
scene.started &= !frogpilot_scene.frogpilot_toggles.value("force_offroad").toBool();
}
void ui_update_params(UIState *s) {