Skip to content

Commit

Permalink
Aerostack2 ILauncher
Browse files Browse the repository at this point in the history
  • Loading branch information
pawanw17 committed Aug 16, 2023
1 parent 9601dc4 commit 5054973
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions manager/manager/launcher/launcher_aerostack2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import os
import subprocess
from src.manager.manager.launcher.launcher_interface import ILauncher, LauncherException
from src.manager.manager.docker_thread.docker_thread import DockerThread
from typing import List, Any

class LauncherAerostack2(ILauncher):
exercise_id: str
type: str
module: str
world_file: str
running = False
thread: Any = None

def run(self, callback):
world_file = os.path.expandvars(self.world_file)

as2_launch_cmd = f"ros2 launch jderobot_drones as2_default_classic_gazebo.launch.py world_file:={world_file}"

self.thread = DockerThread(as2_launch_cmd)
self.thread.start()

self.running = True

def is_running(self):
return True

def terminate(self):
if self.is_running():
self.thread.terminate()
self.thread.join()

0 comments on commit 5054973

Please sign in to comment.