From 73d7135f86908790bbabe3d9a429aea7001c861d Mon Sep 17 00:00:00 2001 From: Gerry Salinas Date: Tue, 19 Mar 2024 21:46:48 +0000 Subject: [PATCH] Restore base version of canopen_system example. --- .../canopen_system/ros2_controllers.yaml | 4 ++-- canopen_tests/launch/canopen_system.launch.py | 23 +++---------------- 2 files changed, 5 insertions(+), 22 deletions(-) diff --git a/canopen_tests/config/canopen_system/ros2_controllers.yaml b/canopen_tests/config/canopen_system/ros2_controllers.yaml index 57005410..771b5f9c 100644 --- a/canopen_tests/config/canopen_system/ros2_controllers.yaml +++ b/canopen_tests/config/canopen_system/ros2_controllers.yaml @@ -1,4 +1,4 @@ -__namespace__/controller_manager: +controller_manager: ros__parameters: update_rate: 10 # Hz @@ -8,6 +8,6 @@ __namespace__/controller_manager: node_1_controller: type: canopen_ros2_controllers/CanopenProxyController -__namespace__/node_1_controller: +node_1_controller: ros__parameters: joint: node_1 diff --git a/canopen_tests/launch/canopen_system.launch.py b/canopen_tests/launch/canopen_system.launch.py index 7c9dd634..ef63aefc 100644 --- a/canopen_tests/launch/canopen_system.launch.py +++ b/canopen_tests/launch/canopen_system.launch.py @@ -40,13 +40,10 @@ from launch.actions import IncludeLaunchDescription from launch.launch_description_sources import PythonLaunchDescriptionSource -from launch.actions import GroupAction -from launch_ros.actions import PushROSNamespace -from nav2_common.launch import ReplaceString def launch_setup(context, *args, **kwargs): - can_ns = LaunchConfiguration("can_ns") + name = LaunchConfiguration("name") prefix = LaunchConfiguration("prefix") @@ -114,11 +111,6 @@ def launch_setup(context, *args, **kwargs): ] ) - ros2_control_config = ReplaceString( - source_file=ros2_control_config, - replacements={"__namespace__/":(can_ns, "/")} - ) - # nodes to start are listed below control_node = Node( package="controller_manager", @@ -131,13 +123,13 @@ def launch_setup(context, *args, **kwargs): joint_state_broadcaster_spawner = Node( package="controller_manager", executable="spawner", - arguments=["joint_state_broadcaster"] + arguments=["joint_state_broadcaster", "--controller-manager", "/controller_manager"], ) canopen_proxy_controller_spawner = Node( package="controller_manager", executable="spawner", - arguments=["node_1_controller"] + arguments=["node_1_controller", "--controller-manager", "/controller_manager"], ) robot_state_publisher_node = Node( @@ -182,21 +174,12 @@ def launch_setup(context, *args, **kwargs): canopen_proxy_controller_spawner, ] - actions = [PushROSNamespace(can_ns)] - actions.extend(nodes_to_start) - return [GroupAction(actions=actions)] - return nodes_to_start def generate_launch_description(): declared_arguments = [] - declared_arguments.append( - DeclareLaunchArgument( - "can_ns", description="namespace", default_value="", - ) - ) declared_arguments.append( DeclareLaunchArgument( "name", description="robot name", default_value="canopen_test_system"