From 9431af1a0954c747525fea1837b553561a001718 Mon Sep 17 00:00:00 2001 From: Arjo Chakravarty Date: Fri, 24 Jan 2025 12:12:22 +0800 Subject: [PATCH] Add confg Signed-off-by: Arjo Chakravarty --- ros_gz_sim/launch/gz_sim.launch.py.in | 35 ++++++++++++++++++--------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/ros_gz_sim/launch/gz_sim.launch.py.in b/ros_gz_sim/launch/gz_sim.launch.py.in index e300c51d..04a88e2e 100644 --- a/ros_gz_sim/launch/gz_sim.launch.py.in +++ b/ros_gz_sim/launch/gz_sim.launch.py.in @@ -102,6 +102,7 @@ def launch_gz(context, *args, **kwargs): ign_version = LaunchConfiguration('ign_version').perform(context) debugger = LaunchConfiguration('debugger').perform(context) on_exit_shutdown = LaunchConfiguration('on_exit_shutdown').perform(context) + debug_env = LaunchConfiguration('debug_env').perform(context) if not len(gz_args) and len(ign_args): print("ign_args is deprecated, migrate to gz_args!") @@ -127,17 +128,29 @@ def launch_gz(context, *args, **kwargs): else: on_exit = None - return [ - LogInfo(f"Launching gazebo with the environment variables: {env}"), - ExecuteProcess( - cmd=[exec, exec_args, '--force-version', gz_version], - name='gazebo', - output='screen', - additional_env=env, - shell=True, - prefix=debug_prefix, - on_exit=on_exit - )] + if debug_env == 'true': + return [ + LogInfo(f"Launching gazebo with the environment variables: {env}"), + ExecuteProcess( + cmd=[exec, exec_args, '--force-version', gz_version], + name='gazebo', + output='screen', + additional_env=env, + shell=True, + prefix=debug_prefix, + on_exit=on_exit + )] + else: + return [ + ExecuteProcess( + cmd=[exec, exec_args, '--force-version', gz_version], + name='gazebo', + output='screen', + additional_env=env, + shell=True, + prefix=debug_prefix, + on_exit=on_exit + )] def generate_launch_description():