Skip to content

Commit ddef762

Browse files
committed
New launch option using user files
1 parent 2161605 commit ddef762

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

manager/manager/manager.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,19 @@ def terminated_callback(name, code):
120120
if launchers_configuration is None:
121121
raise Exception("Launch configuration missing")
122122

123+
# check if launch file is sent
124+
launch_file = configuration.get('launch_file', None)
125+
if (launch_file is not None):
126+
directory = "workspace/worlds/"
127+
file_path = directory + launch_file.get('name', "world.launch")
128+
# if folder does not exist, create it
129+
if not os.path.exists(directory):
130+
os.makedirs(directory)
131+
# store the file
132+
file = open(file_path, 'w')
133+
file.write(launch_file.get('contents', None))
134+
file.close()
135+
123136
LogManager.logger.info(
124137
f"Launch transition started, configuration: {configuration}")
125138

0 commit comments

Comments
 (0)