Skip to content

Commit

Permalink
Fix launching multiple gzclient instances (#1411)
Browse files Browse the repository at this point in the history
Use PythonExpression to evaluate the condition substitution
  • Loading branch information
orduno authored Dec 5, 2019
1 parent c2d9359 commit 59f9637
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ def generate_launch_description():
'rviz_config_file': namespaced_rviz_config_file,
'use_rviz': use_rviz,
'use_simulator': 'False',
'headless': 'False',
'use_robot_state_pub': use_robot_state_pub}.items()),

LogInfo(
Expand Down
6 changes: 3 additions & 3 deletions nav2_bringup/bringup/launch/nav2_tb3_simulation_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
from launch import LaunchDescription
from launch.actions import (DeclareLaunchArgument, EmitEvent, ExecuteProcess,
IncludeLaunchDescription, RegisterEventHandler)
from launch.conditions import IfCondition, UnlessCondition
from launch.conditions import IfCondition
from launch.event_handlers import OnProcessExit
from launch.events import Shutdown
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import LaunchConfiguration
from launch.substitutions import LaunchConfiguration, PythonExpression

from nav2_common.launch import Node

Expand Down Expand Up @@ -136,7 +136,7 @@ def generate_launch_description():
cwd=[launch_dir], output='screen')

start_gazebo_client_cmd = ExecuteProcess(
condition=(IfCondition(use_simulator) and UnlessCondition(headless)),
condition=IfCondition(PythonExpression([use_simulator, ' and not ', headless])),
cmd=['gzclient'],
cwd=[launch_dir], output='screen')

Expand Down

0 comments on commit 59f9637

Please sign in to comment.