@@ -171,6 +171,18 @@ def generate_launch_description():
171171
172172 # #} end of debug
173173
174+ # #{ use_sim_time
175+
176+ use_sim_time = LaunchConfiguration ('use_sim_time' )
177+
178+ ld .add_action (DeclareLaunchArgument (
179+ 'use_sim_time' ,
180+ default_value = os .getenv ('USE_SIM_TIME' , "false" ),
181+ description = "Should the node subscribe to sim time?" ,
182+ ))
183+
184+ # #} end of custom_config
185+
174186 container_name = ["/" , uav_name , "/uav_core_container" ]
175187
176188 core_container = ComposableNodeContainer (
@@ -182,6 +194,7 @@ def generate_launch_description():
182194 parameters = [
183195 {'use_intra_process_comms' : True },
184196 {'thread_num' : os .cpu_count ()},
197+ {'use_sim_time' : use_sim_time },
185198 ],
186199 # prefix=[debug],
187200 condition = UnlessCondition (standalone )
@@ -195,6 +208,7 @@ def generate_launch_description():
195208 FindPackageShare ('mrs_uav_managers' ), '/launch/control_manager.py'
196209 ]),
197210 launch_arguments = {
211+ 'use_sim_time' : use_sim_time ,
198212 'custom_config' : custom_config ,
199213 'platform_config' : platform_config ,
200214 'world_config' : world_config ,
@@ -211,6 +225,7 @@ def generate_launch_description():
211225 FindPackageShare ('mrs_uav_managers' ), '/launch/uav_manager.py'
212226 ]),
213227 launch_arguments = {
228+ 'use_sim_time' : use_sim_time ,
214229 'custom_config' : custom_config ,
215230 'platform_config' : platform_config ,
216231 'world_config' : world_config ,
@@ -227,6 +242,7 @@ def generate_launch_description():
227242 FindPackageShare ('mrs_uav_managers' ), '/launch/transform_manager.py'
228243 ]),
229244 launch_arguments = {
245+ 'use_sim_time' : use_sim_time ,
230246 'custom_config' : custom_config ,
231247 'platform_config' : platform_config ,
232248 'world_config' : world_config ,
@@ -243,6 +259,7 @@ def generate_launch_description():
243259 FindPackageShare ('mrs_uav_managers' ), '/launch/constraint_manager.py'
244260 ]),
245261 launch_arguments = {
262+ 'use_sim_time' : use_sim_time ,
246263 'custom_config' : custom_config ,
247264 'platform_config' : platform_config ,
248265 'world_config' : world_config ,
@@ -259,6 +276,7 @@ def generate_launch_description():
259276 FindPackageShare ('mrs_uav_managers' ), '/launch/gain_manager.py'
260277 ]),
261278 launch_arguments = {
279+ 'use_sim_time' : use_sim_time ,
262280 'custom_config' : custom_config ,
263281 'platform_config' : platform_config ,
264282 'world_config' : world_config ,
@@ -275,6 +293,7 @@ def generate_launch_description():
275293 FindPackageShare ('mrs_uav_managers' ), '/launch/estimation_manager.py'
276294 ]),
277295 launch_arguments = {
296+ 'use_sim_time' : use_sim_time ,
278297 'custom_config' : custom_config ,
279298 'platform_config' : platform_config ,
280299 'world_config' : world_config ,
@@ -291,6 +310,7 @@ def generate_launch_description():
291310 FindPackageShare ('mrs_uav_trajectory_generation' ), '/launch/trajectory_generation.py'
292311 ]),
293312 launch_arguments = {
313+ 'use_sim_time' : use_sim_time ,
294314 'custom_config' : custom_config ,
295315 'platform_config' : platform_config ,
296316 'standalone' : standalone ,
0 commit comments