32
32
from launch_ros .actions import Node
33
33
from launch .actions import DeclareLaunchArgument
34
34
from launch .substitutions import LaunchConfiguration
35
- from launch .conditions import LaunchConfigurationEquals , LaunchConfigurationNotEquals
35
+ from launch .substitutions import EqualsSubstitution
36
+ from launch .substitutions import NotEqualsSubstitution
37
+ from launch .conditions import IfCondition
36
38
37
39
38
40
def generate_launch_description ():
@@ -41,15 +43,16 @@ def generate_launch_description():
41
43
description = "Treat FlexBE App as offline editor () Editor mode as default" ,
42
44
default_value = "false" )
43
45
44
- # Change the default value based on passing a true/false string to offline, or allow setting directly
46
+ # Change the default value based on passing a true/false string to offline,
47
+ # or allow setting directly
45
48
offline_arg = DeclareLaunchArgument ("offline_arg" ,
46
49
description = "Optionally specify FlexBE App offline Editor mode ('--offline')" ,
47
50
default_value = "--offline" ,
48
- condition = LaunchConfigurationEquals ( "offline" , "true" ))
51
+ condition = IfCondition ( EqualsSubstitution ( LaunchConfiguration ( "offline" ) , "true" ) ))
49
52
online_arg = DeclareLaunchArgument ("offline_arg" ,
50
53
description = "Optionally specify FlexBE App offline Editor mode ('--offline') default=''" ,
51
54
default_value = "" ,
52
- condition = LaunchConfigurationEquals ( "offline" , "false" ))
55
+ condition = IfCondition ( EqualsSubstitution ( LaunchConfiguration ( "offline" ) , "false" ) ))
53
56
54
57
no_app = DeclareLaunchArgument ("no_app" , default_value = "false" )
55
58
use_sim_time = DeclareLaunchArgument ("use_sim_time" , default_value = "False" )
@@ -59,11 +62,11 @@ def generate_launch_description():
59
62
60
63
behavior_mirror = Node (name = "behavior_mirror" , package = "flexbe_mirror" ,
61
64
executable = "behavior_mirror_sm" ,
62
- condition = LaunchConfigurationNotEquals ( "offline_arg" , "--offline" ))
65
+ condition = IfCondition ( NotEqualsSubstitution ( LaunchConfiguration ( "offline_arg" ) , "--offline" ) ))
63
66
64
67
behavior_launcher = Node (name = "behavior_launcher" , package = "flexbe_widget" ,
65
68
executable = "be_launcher" , output = "screen" ,
66
- condition = LaunchConfigurationNotEquals ( "offline_arg" , "--offline" ))
69
+ condition = IfCondition ( NotEqualsSubstitution ( LaunchConfiguration ( "offline_arg" ) , "--offline" ) ))
67
70
68
71
return LaunchDescription ([
69
72
offline ,
0 commit comments