Skip to content

Commit

Permalink
Fixes gazebo shutdown error when using nested launch files (#1376)
Browse files Browse the repository at this point in the history
* Fixed gazebo shutdown error

* Avoid spaces in -s libgazebo_ros_*

Signed-off-by: Aditya <[email protected]>
  • Loading branch information
adityapande-1995 authored May 9, 2022
1 parent c39b04c commit 352649f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
8 changes: 4 additions & 4 deletions gazebo_ros/launch/gzclient.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@


def generate_launch_description():
cmd = [[
cmd = [
'gzclient',
_boolean_command('version'), ' ',
_boolean_command('verbose'), ' ',
_boolean_command('help'), ' ',
LaunchConfiguration('extra_gazebo_args'),
]]
]

model, plugin, media = GazeboRosPaths.get_paths()

Expand Down Expand Up @@ -99,7 +99,7 @@ def generate_launch_description():
cmd=cmd,
output='screen',
additional_env=env,
shell=True,
shell=False,
prefix=prefix,
on_exit=Shutdown(),
condition=IfCondition(LaunchConfiguration('gui_required')),
Expand All @@ -110,7 +110,7 @@ def generate_launch_description():
cmd=cmd,
output='screen',
additional_env=env,
shell=True,
shell=False,
prefix=prefix,
condition=UnlessCondition(LaunchConfiguration('gui_required')),
),
Expand Down
7 changes: 4 additions & 3 deletions gazebo_ros/launch/gzserver.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def generate_launch_description():
cmd=cmd,
output='screen',
additional_env=env,
shell=True,
shell=False,
prefix=prefix,
on_exit=Shutdown(),
condition=IfCondition(LaunchConfiguration('server_required')),
Expand All @@ -196,7 +196,7 @@ def generate_launch_description():
cmd=cmd,
output='screen',
additional_env=env,
shell=True,
shell=False,
prefix=prefix,
condition=UnlessCondition(LaunchConfiguration('server_required')),
),
Expand All @@ -219,6 +219,7 @@ def _arg_command(arg):

# Add gazebo_ros plugins if true
def _plugin_command(arg):
cmd = ['"-s libgazebo_ros_', arg, '.so" if "true" == "', LaunchConfiguration(arg), '" else ""']
cmd = ['"-s', 'libgazebo_ros_', arg, '.so" if "true" == "',
LaunchConfiguration(arg), '" else ""']
py_cmd = PythonExpression(cmd)
return py_cmd

0 comments on commit 352649f

Please sign in to comment.