Skip to content

Commit 30744f3

Browse files
committed
Fix hardware management service tests
1 parent 9528bd7 commit 30744f3

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

controller_manager/doc/parameters_context.yaml

+7-7
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ hardware_components_initial_state: |
55
Detailed explanation of each parameter is given below.
66
The full structure of the map is given in the following example:
77
8-
.. code-block:: yaml
8+
.. code-block:: yaml
99
10-
hardware_components_initial_state:
11-
unconfigured:
12-
- "arm1"
13-
- "arm2"
14-
inactive:
15-
- "base3"
10+
hardware_components_initial_state:
11+
unconfigured:
12+
- "arm1"
13+
- "arm2"
14+
inactive:
15+
- "base3"
1616
1717
diagnostics.threshold.controllers.periodicity: |
1818
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.

controller_manager/src/controller_manager.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,11 @@ void ControllerManager::init_resource_manager(const std::string & robot_descript
415415
}
416416
};
417417

418+
if (cm_param_listener_->is_old(*params_))
419+
{
420+
*params_ = cm_param_listener_->get_params();
421+
}
422+
418423
// unconfigured (loaded only)
419424
set_components_to_state(
420425
params_->hardware_components_initial_state.unconfigured,

controller_manager/src/controller_manager_parameters.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ controller_manager:
1111
type: string_array,
1212
default_value: [],
1313
description: "Defines which hardware components will be only loaded immediately when controller manager is started.",
14-
read_only: true,
1514
validation: {
1615
unique<>: null,
1716
}
@@ -21,7 +20,6 @@ controller_manager:
2120
type: string_array,
2221
default_value: [],
2322
description: "Defines which hardware components will be configured immediately when controller manager is started.",
24-
read_only: true,
2523
validation: {
2624
unique<>: null,
2725
}

controller_manager/test/test_hardware_management_srvs.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,18 @@ class TestControllerManagerHWManagementSrvs : public TestControllerManagerSrvs
6565
cm_ = std::make_shared<controller_manager::ControllerManager>(executor_, TEST_CM_NAME);
6666
run_updater_ = false;
6767

68+
SetUpSrvsCMExecutor();
6869
cm_->set_parameter(rclcpp::Parameter(
6970
"hardware_components_initial_state.unconfigured",
7071
std::vector<std::string>({TEST_SYSTEM_HARDWARE_NAME})));
7172
cm_->set_parameter(rclcpp::Parameter(
7273
"hardware_components_initial_state.inactive",
7374
std::vector<std::string>({TEST_SENSOR_HARDWARE_NAME})));
7475

76+
std::this_thread::sleep_for(std::chrono::milliseconds(100));
7577
auto msg = std_msgs::msg::String();
7678
msg.data = ros2_control_test_assets::minimal_robot_urdf;
7779
cm_->robot_description_callback(msg);
78-
79-
SetUpSrvsCMExecutor();
8080
}
8181

8282
void check_component_fileds(

0 commit comments

Comments
 (0)