From c44247e6dce0b2c8c9b7f63de3ef4bd04af47ef7 Mon Sep 17 00:00:00 2001 From: Chen Chen Date: Sun, 10 Dec 2023 18:28:41 +0800 Subject: [PATCH] Fix controller spawn error (#11) * fix: "No executable found" error when launching fd.launch.py - There's a space missing between "spawn" and "--controller-manager" - Use Node instead of ExecuteProcess to spawn controller - Remove ExecuteProcess import * style: organize imports in fd.launch.py --- fd_bringup/launch/fd.launch.py | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/fd_bringup/launch/fd.launch.py b/fd_bringup/launch/fd.launch.py index d12b57e..1a14bef 100644 --- a/fd_bringup/launch/fd.launch.py +++ b/fd_bringup/launch/fd.launch.py @@ -13,9 +13,13 @@ # limitations under the License. from launch import LaunchDescription -from launch.actions import DeclareLaunchArgument, ExecuteProcess -from launch.substitutions import Command, FindExecutable -from launch.substitutions import LaunchConfiguration, PathJoinSubstitution +from launch.actions import DeclareLaunchArgument +from launch.substitutions import ( + Command, + FindExecutable, + LaunchConfiguration, + PathJoinSubstitution, +) from launch_ros.actions import Node from launch_ros.substitutions import FindPackageShare @@ -88,14 +92,16 @@ def generate_launch_description(): load_controllers = [] for controller in ['fd_controller', 'joint_state_broadcaster']: load_controllers += [ - ExecuteProcess( - cmd=[ - 'ros2 run controller_manager spawner' + - f'--controller-manager /fd/controller_manager {controller}' + Node( + package='controller_manager', + executable='spawner', + namespace='fd', + arguments=[ + controller, + '--controller-manager', + '/fd/controller_manager', ], - shell=True, - output='screen', - ) + ), ] nodes = [