Update controller/main.py

This commit is contained in:
elias 2025-04-02 15:26:17 +02:00
parent e1fce30972
commit 10a2060547

View File

@ -1,4 +1,4 @@
import tkinter as tk, threading, robomasterpy as rm import tkinter as tk, robomasterpy as rm
from tkinter import ttk from tkinter import ttk
class RobomasterUI: class RobomasterUI:
@ -73,7 +73,7 @@ class RobomasterUI:
master.bind("<space>", lambda event: self.stop_chassis()) master.bind("<space>", lambda event: self.stop_chassis())
def _run_command(self, func, *args, **kwargs): def _run_command(self, func, *args, **kwargs):
threading.Thread(target=lambda: self._command_executor(func, *args, **kwargs)).start() self._command_executor(func, *args, **kwargs)
def _command_executor(self, func, *args, **kwargs): def _command_executor(self, func, *args, **kwargs):
try: try:
@ -154,7 +154,6 @@ class RobomasterUI:
except ValueError: except ValueError:
self._display_output("Error: Invalid speed value") self._display_output("Error: Invalid speed value")
def main(): def main():
ip_address = "192.168.2.1" ip_address = "192.168.2.1"
try: try: