Skip to content

Commit 01214bd

Browse files
authored
Feature: MoveIt Parameters and Enable (#166) (#189)
1 parent 7987519 commit 01214bd

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

clearpath_generator_common/clearpath_generator_common/launch/generator.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ def __init__(self,
9595
args=[
9696
('setup_path', self.setup_path),
9797
('use_sim_time', 'false'),
98-
('namespace', self.namespace)
98+
('namespace', self.namespace),
99+
('launch_moveit', str(self.clearpath_config.manipulators.moveit.enable).lower()),
99100
]
100101
)
101102

clearpath_generator_common/clearpath_generator_common/param/manipulators.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,11 @@ def generate_parameters(self, use_sim_time: bool = False) -> None:
178178

179179
self.param_file.add_node_header()
180180

181-
# Get extra ros parameters from config
182-
extras = self.clearpath_config.platform.extras.ros_parameters
183-
for node in extras:
181+
# Get MoveIt ros parameters from config
182+
moveit_params = self.clearpath_config.manipulators.moveit.ros_parameters
183+
for node in moveit_params:
184184
if node in self.param_file.parameters:
185-
self.param_file.update({node: extras.get(node)})
185+
self.param_file.update({node: moveit_params.get(node)})
186186

187187
if use_sim_time:
188188
for node in self.param_file.parameters:

clearpath_manipulators/launch/manipulators.launch.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
IncludeLaunchDescription,
3939
TimerAction
4040
)
41+
from launch.conditions import IfCondition
4142
from launch.launch_description_sources import PythonLaunchDescriptionSource
4243
from launch.substitutions import (
4344
LaunchConfiguration,
@@ -72,10 +73,18 @@ def generate_launch_description():
7273
description='Robot namespace'
7374
)
7475

76+
arg_launch_moveit = DeclareLaunchArgument(
77+
'launch_moveit',
78+
choices=['true', 'false'],
79+
default_value='false',
80+
description='Launch MoveIt'
81+
)
82+
7583
# Launch Configurations
7684
setup_path = LaunchConfiguration('setup_path')
7785
use_sim_time = LaunchConfiguration('use_sim_time')
7886
namespace = LaunchConfiguration('namespace')
87+
launch_moveit = LaunchConfiguration('launch_moveit')
7988

8089
# Launch files
8190
launch_file_manipulators_description = PathJoinSubstitution([
@@ -123,7 +132,8 @@ def generate_launch_description():
123132
launch_arguments=[
124133
('setup_path', setup_path),
125134
('use_sim_time', use_sim_time)
126-
]
135+
],
136+
condition=IfCondition(launch_moveit)
127137
)
128138

129139
moveit_delayed = TimerAction(
@@ -135,6 +145,7 @@ def generate_launch_description():
135145
ld.add_action(arg_setup_path)
136146
ld.add_action(arg_use_sim_time)
137147
ld.add_action(arg_namespace)
148+
ld.add_action(arg_launch_moveit)
138149
ld.add_action(group_manipulators_action)
139150
ld.add_action(moveit_delayed)
140151
return ld

0 commit comments

Comments
 (0)