From de3aab205b4e7f163df402bc280e710ee8b9502c Mon Sep 17 00:00:00 2001 From: Burak Ozter Date: Fri, 1 Nov 2024 12:20:08 -0300 Subject: [PATCH] auto formatting --- docker-compose.yml | 14 ++++++-------- guiTools/launcher.py | 17 +++++++++++++---- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 90cf5b6..bd1c873 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,6 @@ -version: '3.8' +version: "3.8" services: - gui-tools: runtime: nvidia env_file: @@ -33,10 +32,10 @@ services: network_mode: host ipc: host #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 # 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: @@ -115,7 +113,7 @@ services: 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" profiles: - - uav-sim + - uav-sim ipc: host network_mode: host restart: always @@ -136,7 +134,7 @@ services: image: git.spirirobotics.com/spiri/services-ros1-core:main command: stdbuf -o L roscore profiles: - - ros-master + - ros-master ipc: host network_mode: host restart: always @@ -149,4 +147,4 @@ services: ulimits: nofile: soft: 1024 - hard: 524288 \ No newline at end of file + hard: 524288 diff --git a/guiTools/launcher.py b/guiTools/launcher.py index fb76a6a..01fea0f 100644 --- a/guiTools/launcher.py +++ b/guiTools/launcher.py @@ -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() -