Disconnection detection added

PC checks for connection
Esp32 send Heartbeat
This commit is contained in:
2026-11-05 10:37:24 +01:00
parent 4e991a71b5
commit 3531430661
6 changed files with 212 additions and 32 deletions
+13
View File
@@ -128,6 +128,19 @@ def create_parameter_gui(on_start_callback=None, on_stop_callback=None):
dpg.show_viewport()
def update_robot_status(status: str):
"""Update the robot connection label from the GUI event loop."""
labels = {
"connecting": ("Status: CONNECTING TO ROBOT", (255, 200, 0)),
"connected": ("Status: RUNNING", (0, 255, 0)),
"reconnecting": ("Robot Disconnected - Reconnecting...", (255, 150, 0)),
"disconnected": ("Robot Disconnected", (255, 100, 100)),
}
label, color = labels.get(status, ("Status: RUNNING", (0, 255, 0)))
if dpg.is_dearpygui_running():
dpg.configure_item("status_text", default_value=label, color=color)
def resolve_active_command(gamepad_cmd: dict | None) -> dict:
"""Selects motion vector based on current active source in GUI."""
source = input_config["source"]