auto formatting

This commit is contained in:
Burak Ozter 2024-11-01 12:20:08 -03:00
parent 0a0e7207c9
commit de3aab205b
2 changed files with 19 additions and 12 deletions

View File

@ -1,7 +1,6 @@
version: '3.8'
version: "3.8"
services:
gui-tools:
runtime: nvidia
env_file:
@ -36,7 +35,7 @@ services:
privileged: true # Allow privileged access if necessary (e.g., for GPU access)
# restart: unless-stopped
# command: /bin/bash -c "source /opt/ros/foxy/setup.bash && rvis2" # Replace with the actual command to run Gazebo Ignition
profiles: [ui,]
profiles: [ui]
# deploy:
# resources:
# reservations:
@ -45,7 +44,6 @@ services:
# device_ids:
# - nvidia.com/gpu=all
ardupilot:
container_name: ardupilot-$DRONE_SYS_ID
env_file:

View File

@ -3,7 +3,7 @@ import subprocess
# Dictionary of applications: key is the button text, value is the command to execute
applications = {
"Launch Terminal": ['qterminal'],
"Launch Terminal": ["qterminal"],
"Launch rqt": ["rqt"],
"Launch rviz2": ["rviz2"],
"Launch Gazebo": ["/spawn_drones.sh"],
@ -11,12 +11,16 @@ applications = {
# Add more applications here if needed
}
# Function to launch an application
def launch_app(command):
try:
subprocess.Popen(command)
except FileNotFoundError:
print(f"{command[0]} not found. Make sure it's installed and accessible in the PATH.")
print(
f"{command[0]} not found. Make sure it's installed and accessible in the PATH."
)
# Create the main application window
root = tk.Tk()
@ -27,9 +31,14 @@ label.pack(pady=10)
# Create and place buttons dynamically based on the dictionary
for app_name, command in applications.items():
button = tk.Button(root, text=app_name, command=lambda cmd=command: launch_app(cmd), width=20, height=2)
button = tk.Button(
root,
text=app_name,
command=lambda cmd=command: launch_app(cmd),
width=20,
height=2,
)
button.pack()
# Run the Tkinter main loop
root.mainloop()