Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions selfdrive/ui/layouts/onboarding.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,11 @@
from openpilot.system.ui.widgets import Widget
from openpilot.system.ui.widgets.button import Button, ButtonStyle
from openpilot.system.ui.widgets.label import Label
from openpilot.selfdrive.ui.lib.onboarding_steps import STEP_RECTS
from openpilot.selfdrive.ui.ui_state import ui_state

DEBUG = False

STEP_RECTS = [rl.Rectangle(104, 800, 633, 175), rl.Rectangle(1835, 0, 2159, 1080), rl.Rectangle(1835, 0, 2156, 1080),
rl.Rectangle(1526, 473, 427, 472), rl.Rectangle(1643, 441, 217, 223), rl.Rectangle(1835, 0, 2155, 1080),
rl.Rectangle(1786, 591, 267, 236), rl.Rectangle(1353, 0, 804, 1080), rl.Rectangle(1458, 485, 633, 211),
rl.Rectangle(95, 794, 1158, 187), rl.Rectangle(1560, 170, 392, 397), rl.Rectangle(1835, 0, 2159, 1080),
rl.Rectangle(1351, 0, 807, 1080), rl.Rectangle(1835, 0, 2158, 1080), rl.Rectangle(1531, 82, 441, 920),
rl.Rectangle(1336, 438, 490, 393), rl.Rectangle(1835, 0, 2159, 1080), rl.Rectangle(1835, 0, 2159, 1080),
rl.Rectangle(87, 795, 1187, 186)]

DM_RECORD_STEP = 9
DM_RECORD_YES_RECT = rl.Rectangle(695, 794, 558, 187)

Expand Down
23 changes: 23 additions & 0 deletions selfdrive/ui/lib/onboarding_steps.py
Copy link
Contributor Author

@TheSecurityDev TheSecurityDev Oct 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separate out this file since importing the steps from onboarding.py from the test causes the params to be changed due to importing ui_state it seems

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a better way to do this?

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from pyray import Rectangle

STEP_RECTS = [
Rectangle(104, 800, 633, 175),
Rectangle(1835, 0, 2159, 1080),
Rectangle(1835, 0, 2156, 1080),
Rectangle(1526, 473, 427, 472),
Rectangle(1643, 441, 217, 223),
Rectangle(1835, 0, 2155, 1080),
Rectangle(1786, 591, 267, 236),
Rectangle(1353, 0, 804, 1080),
Rectangle(1458, 485, 633, 211),
Rectangle(95, 794, 1158, 187),
Rectangle(1560, 170, 392, 397),
Rectangle(1835, 0, 2159, 1080),
Rectangle(1351, 0, 807, 1080),
Rectangle(1835, 0, 2158, 1080),
Rectangle(1531, 82, 441, 920),
Rectangle(1336, 438, 490, 393),
Rectangle(1835, 0, 2159, 1080),
Rectangle(1835, 0, 2159, 1080),
Rectangle(87, 795, 1187, 186),
]
12 changes: 11 additions & 1 deletion selfdrive/ui/tests/test_ui/raylib_screenshots.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
from openpilot.common.basedir import BASEDIR
from openpilot.common.params import Params
from openpilot.common.prefix import OpenpilotPrefix
from openpilot.selfdrive.test.helpers import with_processes
from openpilot.selfdrive.selfdrived.alertmanager import set_offroad_alert
from openpilot.selfdrive.test.helpers import with_processes
from openpilot.selfdrive.ui.lib.onboarding_steps import STEP_RECTS
from openpilot.system.updated.updated import parse_release_notes

AlertSize = log.SelfdriveState.AlertSize
Expand Down Expand Up @@ -133,6 +134,14 @@ def setup_experimental_mode_description(click, pm: PubMaster):
click(1200, 280) # expand description for experimental mode


def setup_onboarding(click, pm: PubMaster):
setup_settings(click, pm)
click(2000, 960) # review training guide
# Click the center of each onboarding step rect
for _, rect in enumerate(STEP_RECTS[:-1]):
click(int(rect.x + rect.width / 2), int(rect.y + rect.height / 2))


def setup_openpilot_long_confirmation_dialog(click, pm: PubMaster):
setup_settings_developer(click, pm)
click(2000, 960) # toggle openpilot longitudinal control
Expand Down Expand Up @@ -247,6 +256,7 @@ def setup_onroad_full_alert_long_text(click, pm: PubMaster):
"offroad_alert": setup_offroad_alert,
"confirmation_dialog": setup_confirmation_dialog,
"experimental_mode_description": setup_experimental_mode_description,
"onboarding_completion": setup_onboarding,
"openpilot_long_confirmation_dialog": setup_openpilot_long_confirmation_dialog,
"onroad": setup_onroad,
"onroad_sidebar": setup_onroad_sidebar,
Expand Down