Skip to content
Merged
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
19 changes: 13 additions & 6 deletions atos_gui/atos_gui/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import threading
from pathlib import Path

import nicegui
import rclpy
from nicegui import app, ui, ui_run
from rclpy.executors import ExternalShutdownException, MultiThreadedExecutor
Expand Down Expand Up @@ -251,19 +250,22 @@ def render_home() -> None:
)


def render_atos_home_page() -> None:
@ui.page(path="/", title="ATOS GUI")
def render_home() -> None:
ui.link("Control Panel", "/control")
ui.link("Config Panel", "/config")
ui.link("Object Panel", "/object")


def ros_main() -> None:
rclpy.init()
executor = MultiThreadedExecutor()
nodes = []

if FLEET_MODE:
render_atosfleetmanagement_pages()
nodes = [FleetStateNode()]
else:
nicegui.ui.link("Control Panel", "/control")
nicegui.ui.link("Config Panel", "/config")
nicegui.ui.link("Object Panel", "/object")

control_panel = ControlPanelNode()
config_panel = ConfigPanelNode()
object_panel = ObjectPanelNode()
Expand Down Expand Up @@ -293,6 +295,11 @@ def configure_app() -> None:
if APP_CONFIGURED:
return

if FLEET_MODE:
render_atosfleetmanagement_pages()
else:
render_atos_home_page()

app.on_startup(lambda: threading.Thread(target=ros_main, daemon=True).start())
app.on_startup(print_access_hint)
APP_CONFIGURED = True
Expand Down
Loading