diff --git a/controller_manager/doc/parameters_context.yaml b/controller_manager/doc/parameters_context.yaml index f5df997661..a015765c79 100644 --- a/controller_manager/doc/parameters_context.yaml +++ b/controller_manager/doc/parameters_context.yaml @@ -5,14 +5,14 @@ hardware_components_initial_state: | Detailed explanation of each parameter is given below. The full structure of the map is given in the following example: - .. code-block:: yaml + .. code-block:: yaml - hardware_components_initial_state: - unconfigured: - - "arm1" - - "arm2" - inactive: - - "base3" + hardware_components_initial_state: + unconfigured: + - "arm1" + - "arm2" + inactive: + - "base3" diagnostics.threshold.controllers.periodicity: | The ``periodicity`` diagnostics will be published only for the asynchronous controllers, because any affect to the synchronous controllers will be reflected directly in the controller manager's periodicity. diff --git a/controller_manager/src/controller_manager.cpp b/controller_manager/src/controller_manager.cpp index 6ffb154cb4..d9de54ea38 100644 --- a/controller_manager/src/controller_manager.cpp +++ b/controller_manager/src/controller_manager.cpp @@ -415,6 +415,11 @@ void ControllerManager::init_resource_manager(const std::string & robot_descript } }; + if (cm_param_listener_->is_old(*params_)) + { + *params_ = cm_param_listener_->get_params(); + } + // unconfigured (loaded only) set_components_to_state( params_->hardware_components_initial_state.unconfigured, diff --git a/controller_manager/src/controller_manager_parameters.yaml b/controller_manager/src/controller_manager_parameters.yaml index b5f9dfdc0a..dd4bf1bc1b 100644 --- a/controller_manager/src/controller_manager_parameters.yaml +++ b/controller_manager/src/controller_manager_parameters.yaml @@ -11,7 +11,6 @@ controller_manager: type: string_array, default_value: [], description: "Defines which hardware components will be only loaded immediately when controller manager is started.", - read_only: true, validation: { unique<>: null, } @@ -21,7 +20,6 @@ controller_manager: type: string_array, default_value: [], description: "Defines which hardware components will be configured immediately when controller manager is started.", - read_only: true, validation: { unique<>: null, } diff --git a/controller_manager/test/test_hardware_management_srvs.cpp b/controller_manager/test/test_hardware_management_srvs.cpp index c7b67e0cfe..bdd48f15ae 100644 --- a/controller_manager/test/test_hardware_management_srvs.cpp +++ b/controller_manager/test/test_hardware_management_srvs.cpp @@ -65,6 +65,7 @@ class TestControllerManagerHWManagementSrvs : public TestControllerManagerSrvs cm_ = std::make_shared(executor_, TEST_CM_NAME); run_updater_ = false; + SetUpSrvsCMExecutor(); cm_->set_parameter(rclcpp::Parameter( "hardware_components_initial_state.unconfigured", std::vector({TEST_SYSTEM_HARDWARE_NAME}))); @@ -72,11 +73,10 @@ class TestControllerManagerHWManagementSrvs : public TestControllerManagerSrvs "hardware_components_initial_state.inactive", std::vector({TEST_SENSOR_HARDWARE_NAME}))); + std::this_thread::sleep_for(std::chrono::milliseconds(100)); auto msg = std_msgs::msg::String(); msg.data = ros2_control_test_assets::minimal_robot_urdf; cm_->robot_description_callback(msg); - - SetUpSrvsCMExecutor(); } void check_component_fileds(