From a86bc40aafc3b4a38753185d97e897b5a8f3405b Mon Sep 17 00:00:00 2001 From: "Dr. Denis" Date: Mon, 11 Dec 2023 18:19:16 +0100 Subject: [PATCH] Remove old parameter from tests. --- .../test/test_hardware_management_srvs.cpp | 66 ++----------------- 1 file changed, 4 insertions(+), 62 deletions(-) diff --git a/controller_manager/test/test_hardware_management_srvs.cpp b/controller_manager/test/test_hardware_management_srvs.cpp index 0fc7a2f27e..7afaa68d24 100644 --- a/controller_manager/test/test_hardware_management_srvs.cpp +++ b/controller_manager/test/test_hardware_management_srvs.cpp @@ -205,7 +205,8 @@ class TestControllerManagerHWManagementSrvs : public TestControllerManagerSrvs TEST_F(TestControllerManagerHWManagementSrvs, list_hardware_components) { // Default status after start: - // checks if "configure_components_on_start" and "activate_components_on_start" are correctly read + // checks if "hardware_components_initial_state.unconfigured" and + // "hardware_components_initial_state.inactive" are correctly read list_hardware_components_and_check( // actuator, sensor, system @@ -391,8 +392,8 @@ class TestControllerManagerHWManagementSrvsWithoutParams TEST_F(TestControllerManagerHWManagementSrvsWithoutParams, test_default_activation_of_all_hardware) { - // "configure_components_on_start" and "activate_components_on_start" are not set (empty) - // therefore all hardware components are active + // "hardware_components_initial_state.unconfigured" and "hardware_components_initial_state.inactive" + // are not set (empty). Therefore, all hardware components are active. list_hardware_components_and_check( // actuator, sensor, system std::vector( @@ -412,62 +413,3 @@ TEST_F(TestControllerManagerHWManagementSrvsWithoutParams, test_default_activati {{false, false, false, false}, {false, false, false, false, false, false, false}}, // system })); } - -// BEGIN: Remove at the end of 2023 -class TestControllerManagerHWManagementSrvsOldParameters -: public TestControllerManagerHWManagementSrvs -{ -public: - void SetUp() override - { - executor_ = std::make_shared(); - cm_ = std::make_shared( - std::make_unique(), executor_, TEST_CM_NAME); - run_updater_ = false; - - cm_->set_parameter( - rclcpp::Parameter("robot_description", ros2_control_test_assets::minimal_robot_urdf)); - cm_->set_parameter(rclcpp::Parameter( - "activate_components_on_start", std::vector({TEST_ACTUATOR_HARDWARE_NAME}))); - cm_->set_parameter(rclcpp::Parameter( - "configure_components_on_start", std::vector({TEST_SENSOR_HARDWARE_NAME}))); - - std::string robot_description = ""; - cm_->get_parameter("robot_description", robot_description); - if (robot_description.empty()) - { - throw std::runtime_error( - "Unable to initialize resource manager, no robot description found."); - } - - cm_->init_resource_manager(robot_description); - - SetUpSrvsCMExecutor(); - } -}; - -TEST_F(TestControllerManagerHWManagementSrvsOldParameters, list_hardware_components) -{ - // Default status after start: - // checks if "configure_components_on_start" and "activate_components_on_start" are correctly read - - list_hardware_components_and_check( - // actuator, sensor, system - std::vector( - {LFC_STATE::PRIMARY_STATE_ACTIVE, LFC_STATE::PRIMARY_STATE_INACTIVE, - LFC_STATE::PRIMARY_STATE_UNCONFIGURED}), - std::vector({ACTIVE, INACTIVE, UNCONFIGURED}), - std::vector>>({ - // is available - {{true, true}, {true, true, true}}, // actuator - {{}, {true}}, // sensor - {{false, false, false, false}, {false, false, false, false, false, false, false}}, // system - }), - std::vector>>({ - // is claimed - {{false, false}, {false, false, false}}, // actuator - {{}, {false}}, // sensor - {{false, false, false, false}, {false, false, false, false, false, false, false}}, // system - })); -} -// END: Remove at the end of 2023