mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-09-18 05:23:57 +08:00
Force Drive State
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user