Skip to content

Commit

Permalink
Update launcher drones_ros2
Browse files Browse the repository at this point in the history
  • Loading branch information
ango1994 committed Jan 4, 2024
1 parent 743a3de commit 81a52ab
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions manager/manager/launcher/launcher_drones_ros2.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,9 @@


class LauncherDronesRos2(ILauncher):
exercise_id: str
type: str
module: str
resource_folders: List[str]
model_folders: List[str]
plugin_folders: List[str]
launch_file: str
running = False
threads: List[Any] = []

def run(self, callback):
Expand All @@ -25,7 +20,6 @@ def run(self, callback):
self.threads.append(xserver_thread)

# expand variables in configuration paths
self._set_environment()
world_file = os.path.expandvars(self.launch_file)

# Launching MicroXRCE and Aerostack2 nodes
Expand All @@ -42,7 +36,7 @@ def run(self, callback):
px4_launch_thread.start()
self.threads.append(px4_launch_thread)

self.running = True


def is_running(self):
return True
Expand All @@ -52,13 +46,4 @@ def terminate(self):
for thread in self.threads:
thread.terminate()
thread.join()
self.running = False

def _set_environment(self):
resource_folders = [os.path.expandvars(path) for path in self.resource_folders]
model_folders = [os.path.expandvars(path) for path in self.model_folders]
plugin_folders = [os.path.expandvars(path) for path in self.plugin_folders]

os.environ["GAZEBO_RESOURCE_PATH"] = f"{os.environ.get('GAZEBO_RESOURCE_PATH', '')}:{':'.join(resource_folders)}"
os.environ["GAZEBO_MODEL_PATH"] = f"{os.environ.get('GAZEBO_MODEL_PATH', '')}:{':'.join(model_folders)}"
os.environ["GAZEBO_PLUGIN_PATH"] = f"{os.environ.get('GAZEBO_PLUGIN_PATH', '')}:{':'.join(plugin_folders)}"

0 comments on commit 81a52ab

Please sign in to comment.