@@ -80,11 +80,25 @@ def generate_launch_description():
80
80
description = 'Launch MoveIt'
81
81
)
82
82
83
+ arg_control_delay = DeclareLaunchArgument (
84
+ 'control_delay' ,
85
+ default_value = '0.0' ,
86
+ description = 'Control launch delay in seconds.'
87
+ )
88
+
89
+ arg_moveit_delay = DeclareLaunchArgument (
90
+ 'moveit_delay' ,
91
+ default_value = '1.0' ,
92
+ description = 'MoveIt launch delay in seconds.'
93
+ )
94
+
83
95
# Launch Configurations
84
96
setup_path = LaunchConfiguration ('setup_path' )
85
97
use_sim_time = LaunchConfiguration ('use_sim_time' )
86
98
namespace = LaunchConfiguration ('namespace' )
87
99
launch_moveit = LaunchConfiguration ('launch_moveit' )
100
+ control_delay = LaunchConfiguration ('control_delay' )
101
+ moveit_delay = LaunchConfiguration ('moveit_delay' )
88
102
89
103
# Launch files
90
104
launch_file_manipulators_description = PathJoinSubstitution ([
@@ -126,6 +140,11 @@ def generate_launch_description():
126
140
]
127
141
)
128
142
143
+ control_delayed = TimerAction (
144
+ period = control_delay ,
145
+ actions = [group_manipulators_action ]
146
+ )
147
+
129
148
# Launch MoveIt
130
149
moveit_node_action = IncludeLaunchDescription (
131
150
PythonLaunchDescriptionSource (launch_file_moveit ),
@@ -137,7 +156,7 @@ def generate_launch_description():
137
156
)
138
157
139
158
moveit_delayed = TimerAction (
140
- period = 10.0 ,
159
+ period = moveit_delay ,
141
160
actions = [moveit_node_action ]
142
161
)
143
162
@@ -146,6 +165,8 @@ def generate_launch_description():
146
165
ld .add_action (arg_use_sim_time )
147
166
ld .add_action (arg_namespace )
148
167
ld .add_action (arg_launch_moveit )
149
- ld .add_action (group_manipulators_action )
168
+ ld .add_action (arg_control_delay )
169
+ ld .add_action (arg_moveit_delay )
170
+ ld .add_action (control_delayed )
150
171
ld .add_action (moveit_delayed )
151
172
return ld
0 commit comments