Skip to content

Commit

Permalink
Add condition to disable MoveIt
Browse files Browse the repository at this point in the history
  • Loading branch information
luis-camero committed Dec 19, 2024
1 parent 2ac65c7 commit 2ab5b42
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions clearpath_manipulators/launch/manipulators.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
IncludeLaunchDescription,
TimerAction
)
from launch.conditions import IfCondition
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import (
LaunchConfiguration,
Expand Down Expand Up @@ -72,10 +73,18 @@ def generate_launch_description():
description='Robot namespace'
)

arg_launch_moveit = DeclareLaunchArgument(
'launch_moveit',
choices=['true', 'false'],
default_value='true',
description='Launch MoveIt'
)

# Launch Configurations
setup_path = LaunchConfiguration('setup_path')
use_sim_time = LaunchConfiguration('use_sim_time')
namespace = LaunchConfiguration('namespace')
launch_moveit = LaunchConfiguration('launch_moveit')

# Launch files
launch_file_manipulators_description = PathJoinSubstitution([
Expand Down Expand Up @@ -120,6 +129,7 @@ def generate_launch_description():
# Launch MoveIt
moveit_node_action = IncludeLaunchDescription(
PythonLaunchDescriptionSource(launch_file_moveit),
condition=IfCondition(launch_moveit),
launch_arguments=[
('setup_path', setup_path),
('use_sim_time', use_sim_time)
Expand All @@ -135,6 +145,7 @@ def generate_launch_description():
ld.add_action(arg_setup_path)
ld.add_action(arg_use_sim_time)
ld.add_action(arg_namespace)
ld.add_action(arg_launch_moveit)
ld.add_action(group_manipulators_action)
ld.add_action(moveit_delayed)
return ld

0 comments on commit 2ab5b42

Please sign in to comment.