Skip to content

Commit

Permalink
Wake screen on experimental mode toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
keyeh committed Dec 15, 2024
1 parent 92f1a45 commit 01ae025
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ RexPilot is my personal fork of the OpenPilot driver assistance system, designed

**Enhancements:**

- Screen stays off in standby mode and will only turn on for critical alerts.
- Screen stays off while driving in standby mode, unless critical alerts happen or experimental mode is toggled.
- Integration with Toyota and Lexus instrument clusters:
- Left and right lane lines show what the driving model sees
- LTA icon and barrier graphics indicate the lateral control status and steering override.
Expand Down
6 changes: 5 additions & 1 deletion selfdrive/ui/ui.cc
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,8 @@ void UIState::updateStatus() {
if (scene.started && sm->updated("controlsState")) {
auto controls_state = (*sm)["controlsState"].getControlsState();
auto state = controls_state.getState();
bool experimental_mode = controls_state.getExperimentalMode();

if (state == cereal::ControlsState::OpenpilotState::PRE_ENABLED || state == cereal::ControlsState::OpenpilotState::OVERRIDING) {
status = STATUS_OVERRIDE;
} else if (scene.always_on_lateral_active) {
Expand All @@ -484,8 +486,10 @@ void UIState::updateStatus() {
} else {
status = scene.enabled ? STATUS_ENGAGED : STATUS_DISENGAGED;
}

scene.wake_up_screen = controls_state.getAlertStatus() != cereal::ControlsState::AlertStatus::NORMAL || previous_experimental_mode != experimental_mode;

scene.wake_up_screen = controls_state.getAlertStatus() != cereal::ControlsState::AlertStatus::NORMAL;
previous_experimental_mode = experimental_mode;
}

scene.started |= scene.force_onroad;
Expand Down
1 change: 1 addition & 0 deletions selfdrive/ui/ui.h
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ class UIState : public QObject {

UIStatus status;
UIScene scene = {};
bool previous_experimental_mode = false;

QString language;

Expand Down

0 comments on commit 01ae025

Please sign in to comment.