Skip to content

Commit 7695e5a

Browse files
committed
Fast Forward Feature: Add delay to manipulator controller (#191)
1 parent fabad7d commit 7695e5a

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

clearpath_generator_common/clearpath_generator_common/launch/generator.py

+1
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ def __init__(self,
9797
('use_sim_time', 'false'),
9898
('namespace', self.namespace),
9999
('launch_moveit', str(self.clearpath_config.manipulators.moveit.enable).lower()),
100+
('delay_moveit', str(self.clearpath_config.manipulators.moveit.delay))
100101
]
101102
)
102103

clearpath_manipulators/launch/manipulators.launch.py

+23-2
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,25 @@ def generate_launch_description():
8080
description='Launch MoveIt'
8181
)
8282

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+
8395
# Launch Configurations
8496
setup_path = LaunchConfiguration('setup_path')
8597
use_sim_time = LaunchConfiguration('use_sim_time')
8698
namespace = LaunchConfiguration('namespace')
8799
launch_moveit = LaunchConfiguration('launch_moveit')
100+
control_delay = LaunchConfiguration('control_delay')
101+
moveit_delay = LaunchConfiguration('moveit_delay')
88102

89103
# Launch files
90104
launch_file_manipulators_description = PathJoinSubstitution([
@@ -126,6 +140,11 @@ def generate_launch_description():
126140
]
127141
)
128142

143+
control_delayed = TimerAction(
144+
period=control_delay,
145+
actions=[group_manipulators_action]
146+
)
147+
129148
# Launch MoveIt
130149
moveit_node_action = IncludeLaunchDescription(
131150
PythonLaunchDescriptionSource(launch_file_moveit),
@@ -137,7 +156,7 @@ def generate_launch_description():
137156
)
138157

139158
moveit_delayed = TimerAction(
140-
period=10.0,
159+
period=moveit_delay,
141160
actions=[moveit_node_action]
142161
)
143162

@@ -146,6 +165,8 @@ def generate_launch_description():
146165
ld.add_action(arg_use_sim_time)
147166
ld.add_action(arg_namespace)
148167
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)
150171
ld.add_action(moveit_delayed)
151172
return ld

0 commit comments

Comments
 (0)