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: services:
gui-tools: gui-tools:
runtime: nvidia runtime: nvidia
env_file: env_file:
@ -33,10 +32,10 @@ services:
network_mode: host network_mode: host
ipc: host ipc: host
#user: "${UID}:${GID}" #user: "${UID}:${GID}"
privileged: true # Allow privileged access if necessary (e.g., for GPU access) privileged: true # Allow privileged access if necessary (e.g., for GPU access)
# restart: unless-stopped # restart: unless-stopped
# command: /bin/bash -c "source /opt/ros/foxy/setup.bash && rvis2" # Replace with the actual command to run Gazebo Ignition # 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: # deploy:
# resources: # resources:
# reservations: # reservations:
@ -45,7 +44,6 @@ services:
# device_ids: # device_ids:
# - nvidia.com/gpu=all # - nvidia.com/gpu=all
ardupilot: ardupilot:
container_name: ardupilot-$DRONE_SYS_ID container_name: ardupilot-$DRONE_SYS_ID
env_file: env_file:
@ -115,7 +113,7 @@ services:
image: git.spirirobotics.com/spiri/services-ros1-mavros:master image: git.spirirobotics.com/spiri/services-ros1-mavros:master
command: rosrun mavros mavros_node __name:=spiri$DRONE_SYS_ID _fcu_url:="udp://0.0.0.0:$MAVROS1_PORT@:14559" _target_system_id:="$DRONE_SYS_ID" command: rosrun mavros mavros_node __name:=spiri$DRONE_SYS_ID _fcu_url:="udp://0.0.0.0:$MAVROS1_PORT@:14559" _target_system_id:="$DRONE_SYS_ID"
profiles: profiles:
- uav-sim - uav-sim
ipc: host ipc: host
network_mode: host network_mode: host
restart: always restart: always
@ -136,7 +134,7 @@ services:
image: git.spirirobotics.com/spiri/services-ros1-core:main image: git.spirirobotics.com/spiri/services-ros1-core:main
command: stdbuf -o L roscore command: stdbuf -o L roscore
profiles: profiles:
- ros-master - ros-master
ipc: host ipc: host
network_mode: host network_mode: host
restart: always restart: always

View File

@ -3,7 +3,7 @@ import subprocess
# Dictionary of applications: key is the button text, value is the command to execute # Dictionary of applications: key is the button text, value is the command to execute
applications = { applications = {
"Launch Terminal": ['qterminal'], "Launch Terminal": ["qterminal"],
"Launch rqt": ["rqt"], "Launch rqt": ["rqt"],
"Launch rviz2": ["rviz2"], "Launch rviz2": ["rviz2"],
"Launch Gazebo": ["/spawn_drones.sh"], "Launch Gazebo": ["/spawn_drones.sh"],
@ -11,12 +11,16 @@ applications = {
# Add more applications here if needed # Add more applications here if needed
} }
# Function to launch an application # Function to launch an application
def launch_app(command): def launch_app(command):
try: try:
subprocess.Popen(command) subprocess.Popen(command)
except FileNotFoundError: 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 # Create the main application window
root = tk.Tk() root = tk.Tk()
@ -27,9 +31,14 @@ label.pack(pady=10)
# Create and place buttons dynamically based on the dictionary # Create and place buttons dynamically based on the dictionary
for app_name, command in applications.items(): 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() button.pack()
# Run the Tkinter main loop # Run the Tkinter main loop
root.mainloop() root.mainloop()