From f58d4072dbd1c3fd4e1f64cd10a19a2b60f59049 Mon Sep 17 00:00:00 2001 From: Bence Magyar Date: Tue, 6 Dec 2022 07:43:03 +0000 Subject: [PATCH] Rename class type to plugin name #api-breaking #abi-breaking (#780) --- controller_manager/src/controller_manager.cpp | 9 ++++- .../test/test_hardware_management_srvs.cpp | 16 ++++----- .../msg/HardwareComponentState.msg | 3 +- .../hardware_component_info.hpp | 4 +-- .../hardware_interface/hardware_info.hpp | 4 +-- hardware_interface/src/component_parser.cpp | 14 ++++---- hardware_interface/src/resource_manager.cpp | 8 ++--- .../test/test_component_parser.cpp | 33 ++++++++++--------- .../test/test_resource_manager.cpp | 15 +++++---- .../components_urdfs.hpp | 4 +-- .../ros2_control_test_assets/descriptions.hpp | 6 ++-- 11 files changed, 63 insertions(+), 53 deletions(-) diff --git a/controller_manager/src/controller_manager.cpp b/controller_manager/src/controller_manager.cpp index 83aa61d3b5..3fa0b34f94 100644 --- a/controller_manager/src/controller_manager.cpp +++ b/controller_manager/src/controller_manager.cpp @@ -1590,7 +1590,14 @@ void ControllerManager::list_hardware_components_srv_cb( auto component = controller_manager_msgs::msg::HardwareComponentState(); component.name = component_name; component.type = component_info.type; - component.class_type = component_info.class_type; + component.class_type = + component_info.plugin_name; // TODO(bence): deprecated currently. Remove soon + RCLCPP_WARN( + get_logger(), + "The 'class_type' field in 'controller_manager_msgs/msg/HardwareComponentState.msg' is " + "deprecated and will be removed soon. Please switch over client code to use 'plugin_name' " + "instead."); + component.plugin_name = component_info.plugin_name; component.state.id = component_info.state.id(); component.state.label = component_info.state.label(); diff --git a/controller_manager/test/test_hardware_management_srvs.cpp b/controller_manager/test/test_hardware_management_srvs.cpp index d3a92bfce4..9df237a9af 100644 --- a/controller_manager/test/test_hardware_management_srvs.cpp +++ b/controller_manager/test/test_hardware_management_srvs.cpp @@ -36,19 +36,19 @@ using hardware_interface::lifecycle_state_names::FINALIZED; using hardware_interface::lifecycle_state_names::INACTIVE; using hardware_interface::lifecycle_state_names::UNCONFIGURED; -using ros2_control_test_assets::TEST_ACTUATOR_HARDWARE_CLASS_TYPE; using ros2_control_test_assets::TEST_ACTUATOR_HARDWARE_COMMAND_INTERFACES; using ros2_control_test_assets::TEST_ACTUATOR_HARDWARE_NAME; +using ros2_control_test_assets::TEST_ACTUATOR_HARDWARE_PLUGIN_NAME; using ros2_control_test_assets::TEST_ACTUATOR_HARDWARE_STATE_INTERFACES; using ros2_control_test_assets::TEST_ACTUATOR_HARDWARE_TYPE; -using ros2_control_test_assets::TEST_SENSOR_HARDWARE_CLASS_TYPE; using ros2_control_test_assets::TEST_SENSOR_HARDWARE_COMMAND_INTERFACES; using ros2_control_test_assets::TEST_SENSOR_HARDWARE_NAME; +using ros2_control_test_assets::TEST_SENSOR_HARDWARE_PLUGIN_NAME; using ros2_control_test_assets::TEST_SENSOR_HARDWARE_STATE_INTERFACES; using ros2_control_test_assets::TEST_SENSOR_HARDWARE_TYPE; -using ros2_control_test_assets::TEST_SYSTEM_HARDWARE_CLASS_TYPE; using ros2_control_test_assets::TEST_SYSTEM_HARDWARE_COMMAND_INTERFACES; using ros2_control_test_assets::TEST_SYSTEM_HARDWARE_NAME; +using ros2_control_test_assets::TEST_SYSTEM_HARDWARE_PLUGIN_NAME; using ros2_control_test_assets::TEST_SYSTEM_HARDWARE_STATE_INTERFACES; using ros2_control_test_assets::TEST_SYSTEM_HARDWARE_TYPE; @@ -88,12 +88,12 @@ class TestControllerManagerHWManagementSrvs : public TestControllerManagerSrvs void check_component_fileds( const controller_manager_msgs::msg::HardwareComponentState & component, - const std::string & name, const std::string & type, const std::string & class_type, + const std::string & name, const std::string & type, const std::string & plugin_name, const uint8_t state_id, const std::string & state_label) { EXPECT_EQ(component.name, name); EXPECT_EQ(component.type, type); - EXPECT_EQ(component.class_type, class_type); + EXPECT_EQ(component.plugin_name, plugin_name); EXPECT_EQ(component.state.id, state_id); EXPECT_EQ(component.state.label, state_label); } @@ -135,7 +135,7 @@ class TestControllerManagerHWManagementSrvs : public TestControllerManagerSrvs { check_component_fileds( component, TEST_ACTUATOR_HARDWARE_NAME, TEST_ACTUATOR_HARDWARE_TYPE, - TEST_ACTUATOR_HARDWARE_CLASS_TYPE, hw_state_ids[0], hw_state_labels[0]); + TEST_ACTUATOR_HARDWARE_PLUGIN_NAME, hw_state_ids[0], hw_state_labels[0]); check_interfaces( component.command_interfaces, TEST_ACTUATOR_HARDWARE_COMMAND_INTERFACES, hw_itfs_available_status[0][0], hw_itfs_claimed_status[0][0]); @@ -147,7 +147,7 @@ class TestControllerManagerHWManagementSrvs : public TestControllerManagerSrvs { check_component_fileds( component, TEST_SENSOR_HARDWARE_NAME, TEST_SENSOR_HARDWARE_TYPE, - TEST_SENSOR_HARDWARE_CLASS_TYPE, hw_state_ids[1], hw_state_labels[1]); + TEST_SENSOR_HARDWARE_PLUGIN_NAME, hw_state_ids[1], hw_state_labels[1]); check_interfaces( component.command_interfaces, TEST_SENSOR_HARDWARE_COMMAND_INTERFACES, hw_itfs_available_status[1][0], hw_itfs_claimed_status[1][0]); @@ -159,7 +159,7 @@ class TestControllerManagerHWManagementSrvs : public TestControllerManagerSrvs { check_component_fileds( component, TEST_SYSTEM_HARDWARE_NAME, TEST_SYSTEM_HARDWARE_TYPE, - TEST_SYSTEM_HARDWARE_CLASS_TYPE, hw_state_ids[2], hw_state_labels[2]); + TEST_SYSTEM_HARDWARE_PLUGIN_NAME, hw_state_ids[2], hw_state_labels[2]); check_interfaces( component.command_interfaces, TEST_SYSTEM_HARDWARE_COMMAND_INTERFACES, hw_itfs_available_status[2][0], hw_itfs_claimed_status[2][0]); diff --git a/controller_manager_msgs/msg/HardwareComponentState.msg b/controller_manager_msgs/msg/HardwareComponentState.msg index 51fd170701..9720b53161 100644 --- a/controller_manager_msgs/msg/HardwareComponentState.msg +++ b/controller_manager_msgs/msg/HardwareComponentState.msg @@ -1,6 +1,7 @@ string name string type -string class_type +string class_type # DEPRECATED +string plugin_name lifecycle_msgs/State state HardwareInterface[] command_interfaces HardwareInterface[] state_interfaces diff --git a/hardware_interface/include/hardware_interface/hardware_component_info.hpp b/hardware_interface/include/hardware_interface/hardware_component_info.hpp index 71dbfebade..cd94c67fcb 100644 --- a/hardware_interface/include/hardware_interface/hardware_component_info.hpp +++ b/hardware_interface/include/hardware_interface/hardware_component_info.hpp @@ -39,8 +39,8 @@ struct HardwareComponentInfo /// Component "classification": "actuator", "sensor" or "system" std::string type; - /// Component class type. - std::string class_type; + /// Component pluginlib plugin name. + std::string plugin_name; /// Component current state. rclcpp_lifecycle::State state; diff --git a/hardware_interface/include/hardware_interface/hardware_info.hpp b/hardware_interface/include/hardware_interface/hardware_info.hpp index 0a5cb1cc18..073d197f9a 100644 --- a/hardware_interface/include/hardware_interface/hardware_info.hpp +++ b/hardware_interface/include/hardware_interface/hardware_info.hpp @@ -106,8 +106,8 @@ struct HardwareInfo std::string name; /// Type of the hardware: actuator, sensor or system. std::string type; - /// Class of the hardware that will be dynamically loaded. - std::string hardware_class_type; + /// Name of the pluginlib plugin of the hardware that will be loaded. + std::string hardware_plugin_name; /// (Optional) Key-value pairs for hardware parameters. std::unordered_map hardware_parameters; /** diff --git a/hardware_interface/src/component_parser.cpp b/hardware_interface/src/component_parser.cpp index 2a223b0f63..0dc4c1913d 100644 --- a/hardware_interface/src/component_parser.cpp +++ b/hardware_interface/src/component_parser.cpp @@ -27,7 +27,7 @@ namespace constexpr const auto kRobotTag = "robot"; constexpr const auto kROS2ControlTag = "ros2_control"; constexpr const auto kHardwareTag = "hardware"; -constexpr const auto kClassTypeTag = "plugin"; +constexpr const auto kPluginNameTag = "plugin"; constexpr const auto kParamTag = "param"; constexpr const auto kActuatorTag = "actuator"; constexpr const auto kJointTag = "joint"; @@ -404,8 +404,8 @@ TransmissionInfo parse_transmission_from_xml(const tinyxml2::XMLElement * transm // Find name, type and class of a transmission transmission.name = get_attribute_value(transmission_it, kNameAttribute, transmission_it->Name()); - const auto * type_it = transmission_it->FirstChildElement(kClassTypeTag); - transmission.type = get_text_for_element(type_it, kClassTypeTag); + const auto * type_it = transmission_it->FirstChildElement(kPluginNameTag); + transmission.type = get_text_for_element(type_it, kPluginNameTag); // Parse joints const auto * joint_it = transmission_it->FirstChildElement(kJointTag); @@ -496,15 +496,15 @@ HardwareInfo parse_resource_from_xml( hardware.type = get_attribute_value(ros2_control_it, kTypeAttribute, kROS2ControlTag); // Parse everything under ros2_control tag - hardware.hardware_class_type = ""; + hardware.hardware_plugin_name = ""; const auto * ros2_control_child_it = ros2_control_it->FirstChildElement(); while (ros2_control_child_it) { if (!std::string(kHardwareTag).compare(ros2_control_child_it->Name())) { - const auto * type_it = ros2_control_child_it->FirstChildElement(kClassTypeTag); - hardware.hardware_class_type = - get_text_for_element(type_it, std::string("hardware ") + kClassTypeTag); + const auto * type_it = ros2_control_child_it->FirstChildElement(kPluginNameTag); + hardware.hardware_plugin_name = + get_text_for_element(type_it, std::string("hardware ") + kPluginNameTag); const auto * params_it = ros2_control_child_it->FirstChildElement(kParamTag); if (params_it) { diff --git a/hardware_interface/src/resource_manager.cpp b/hardware_interface/src/resource_manager.cpp index 4b80bc09dd..2b0308b16e 100644 --- a/hardware_interface/src/resource_manager.cpp +++ b/hardware_interface/src/resource_manager.cpp @@ -87,18 +87,16 @@ class ResourceStorage { RCUTILS_LOG_INFO_NAMED( "resource_manager", "Loading hardware '%s' ", hardware_info.name.c_str()); - // hardware_class_type has to match class name in plugin xml description - // TODO(karsten1987) extract package from hardware_class_type - // e.g.: / + // hardware_plugin_name has to match class name in plugin xml description auto interface = std::unique_ptr( - loader.createUnmanagedInstance(hardware_info.hardware_class_type)); + loader.createUnmanagedInstance(hardware_info.hardware_plugin_name)); HardwareT hardware(std::move(interface)); container.emplace_back(std::move(hardware)); // initialize static data about hardware component to reduce later calls HardwareComponentInfo component_info; component_info.name = hardware_info.name; component_info.type = hardware_info.type; - component_info.class_type = hardware_info.hardware_class_type; + component_info.plugin_name = hardware_info.hardware_plugin_name; hardware_info_map_.insert(std::make_pair(component_info.name, component_info)); hardware_used_by_controllers_.insert( diff --git a/hardware_interface/test/test_component_parser.cpp b/hardware_interface/test/test_component_parser.cpp index a2881ff200..e6409b3d58 100644 --- a/hardware_interface/test/test_component_parser.cpp +++ b/hardware_interface/test/test_component_parser.cpp @@ -123,7 +123,7 @@ TEST_F(TestComponentParser, successfully_parse_valid_urdf_system_one_interface) EXPECT_EQ(hardware_info.name, "RRBotSystemPositionOnly"); EXPECT_EQ(hardware_info.type, "system"); EXPECT_EQ( - hardware_info.hardware_class_type, + hardware_info.hardware_plugin_name, "ros2_control_demo_hardware/RRBotSystemPositionOnlyHardware"); ASSERT_THAT(hardware_info.hardware_parameters, SizeIs(2)); EXPECT_EQ(hardware_info.hardware_parameters.at("example_param_write_for_sec"), "2"); @@ -162,7 +162,7 @@ TEST_F(TestComponentParser, successfully_parse_valid_urdf_system_multi_interface EXPECT_EQ(hardware_info.name, "RRBotSystemMultiInterface"); EXPECT_EQ(hardware_info.type, "system"); EXPECT_EQ( - hardware_info.hardware_class_type, + hardware_info.hardware_plugin_name, "ros2_control_demo_hardware/RRBotSystemMultiInterfaceHardware"); ASSERT_THAT(hardware_info.hardware_parameters, SizeIs(2)); EXPECT_EQ(hardware_info.hardware_parameters.at("example_param_write_for_sec"), "2"); @@ -199,7 +199,7 @@ TEST_F(TestComponentParser, successfully_parse_valid_urdf_system_robot_with_sens EXPECT_EQ(hardware_info.name, "RRBotSystemWithSensor"); EXPECT_EQ(hardware_info.type, "system"); EXPECT_EQ( - hardware_info.hardware_class_type, "ros2_control_demo_hardware/RRBotSystemWithSensorHardware"); + hardware_info.hardware_plugin_name, "ros2_control_demo_hardware/RRBotSystemWithSensorHardware"); ASSERT_THAT(hardware_info.hardware_parameters, SizeIs(2)); EXPECT_EQ(hardware_info.hardware_parameters.at("example_param_write_for_sec"), "2"); @@ -243,7 +243,7 @@ TEST_F(TestComponentParser, successfully_parse_valid_urdf_system_robot_with_exte EXPECT_EQ(hardware_info.name, "RRBotSystemPositionOnlyWithExternalSensor"); EXPECT_EQ(hardware_info.type, "system"); EXPECT_EQ( - hardware_info.hardware_class_type, + hardware_info.hardware_plugin_name, "ros2_control_demo_hardware/RRBotSystemPositionOnlyHardware"); ASSERT_THAT(hardware_info.hardware_parameters, SizeIs(2)); EXPECT_EQ(hardware_info.hardware_parameters.at("example_param_write_for_sec"), "2"); @@ -284,7 +284,7 @@ TEST_F(TestComponentParser, successfully_parse_valid_urdf_actuator_modular_robot EXPECT_EQ(hardware_info.name, "RRBotModularJoint1"); EXPECT_EQ(hardware_info.type, "actuator"); EXPECT_EQ( - hardware_info.hardware_class_type, "ros2_control_demo_hardware/PositionActuatorHardware"); + hardware_info.hardware_plugin_name, "ros2_control_demo_hardware/PositionActuatorHardware"); ASSERT_THAT(hardware_info.hardware_parameters, SizeIs(2)); EXPECT_EQ(hardware_info.hardware_parameters.at("example_param_write_for_sec"), "1.23"); @@ -297,7 +297,7 @@ TEST_F(TestComponentParser, successfully_parse_valid_urdf_actuator_modular_robot EXPECT_EQ(hardware_info.name, "RRBotModularJoint2"); EXPECT_EQ(hardware_info.type, "actuator"); EXPECT_EQ( - hardware_info.hardware_class_type, "ros2_control_demo_hardware/PositionActuatorHardware"); + hardware_info.hardware_plugin_name, "ros2_control_demo_hardware/PositionActuatorHardware"); ASSERT_THAT(hardware_info.hardware_parameters, SizeIs(2)); EXPECT_EQ(hardware_info.hardware_parameters.at("example_param_read_for_sec"), "3"); @@ -319,7 +319,7 @@ TEST_F(TestComponentParser, successfully_parse_valid_urdf_actuator_modular_robot EXPECT_EQ(hardware_info.name, "RRBotModularJoint1"); EXPECT_EQ(hardware_info.type, "actuator"); EXPECT_EQ( - hardware_info.hardware_class_type, "ros2_control_demo_hardware/VelocityActuatorHardware"); + hardware_info.hardware_plugin_name, "ros2_control_demo_hardware/VelocityActuatorHardware"); ASSERT_THAT(hardware_info.hardware_parameters, SizeIs(2)); EXPECT_EQ(hardware_info.hardware_parameters.at("example_param_write_for_sec"), "1.23"); @@ -344,7 +344,7 @@ TEST_F(TestComponentParser, successfully_parse_valid_urdf_actuator_modular_robot EXPECT_EQ(hardware_info.name, "RRBotModularJoint2"); EXPECT_EQ(hardware_info.type, "actuator"); EXPECT_EQ( - hardware_info.hardware_class_type, "ros2_control_demo_hardware/VelocityActuatorHardware"); + hardware_info.hardware_plugin_name, "ros2_control_demo_hardware/VelocityActuatorHardware"); ASSERT_THAT(hardware_info.hardware_parameters, SizeIs(2)); EXPECT_EQ(hardware_info.hardware_parameters.at("example_param_read_for_sec"), "3"); @@ -360,7 +360,8 @@ TEST_F(TestComponentParser, successfully_parse_valid_urdf_actuator_modular_robot EXPECT_EQ(hardware_info.name, "RRBotModularPositionSensorJoint1"); EXPECT_EQ(hardware_info.type, "sensor"); - EXPECT_EQ(hardware_info.hardware_class_type, "ros2_control_demo_hardware/PositionSensorHardware"); + EXPECT_EQ( + hardware_info.hardware_plugin_name, "ros2_control_demo_hardware/PositionSensorHardware"); ASSERT_THAT(hardware_info.hardware_parameters, SizeIs(1)); EXPECT_EQ(hardware_info.hardware_parameters.at("example_param_read_for_sec"), "2"); @@ -376,7 +377,8 @@ TEST_F(TestComponentParser, successfully_parse_valid_urdf_actuator_modular_robot EXPECT_EQ(hardware_info.name, "RRBotModularPositionSensorJoint2"); EXPECT_EQ(hardware_info.type, "sensor"); - EXPECT_EQ(hardware_info.hardware_class_type, "ros2_control_demo_hardware/PositionSensorHardware"); + EXPECT_EQ( + hardware_info.hardware_plugin_name, "ros2_control_demo_hardware/PositionSensorHardware"); ASSERT_THAT(hardware_info.hardware_parameters, SizeIs(1)); EXPECT_EQ(hardware_info.hardware_parameters.at("example_param_read_for_sec"), "2"); @@ -402,7 +404,7 @@ TEST_F(TestComponentParser, successfully_parse_valid_urdf_system_multi_joints_tr EXPECT_EQ(hardware_info.name, "RRBotModularWrist"); EXPECT_EQ(hardware_info.type, "system"); EXPECT_EQ( - hardware_info.hardware_class_type, "ros2_control_demo_hardware/ActuatorHardwareMultiDOF"); + hardware_info.hardware_plugin_name, "ros2_control_demo_hardware/ActuatorHardwareMultiDOF"); ASSERT_THAT(hardware_info.hardware_parameters, SizeIs(2)); EXPECT_EQ(hardware_info.hardware_parameters.at("example_param_write_for_sec"), "1.23"); @@ -443,7 +445,7 @@ TEST_F(TestComponentParser, successfully_parse_valid_urdf_sensor_only) EXPECT_EQ(hardware_info.name, "CameraWithIMU"); EXPECT_EQ(hardware_info.type, "sensor"); - EXPECT_EQ(hardware_info.hardware_class_type, "ros2_control_demo_hardware/CameraWithIMUSensor"); + EXPECT_EQ(hardware_info.hardware_plugin_name, "ros2_control_demo_hardware/CameraWithIMUSensor"); ASSERT_THAT(hardware_info.hardware_parameters, SizeIs(1)); EXPECT_EQ(hardware_info.hardware_parameters.at("example_param_read_for_sec"), "2"); @@ -473,7 +475,7 @@ TEST_F(TestComponentParser, successfully_parse_valid_urdf_actuator_only) EXPECT_EQ(hardware_info.name, "ActuatorModularJoint1"); EXPECT_EQ(hardware_info.type, "actuator"); EXPECT_EQ( - hardware_info.hardware_class_type, "ros2_control_demo_hardware/VelocityActuatorHardware"); + hardware_info.hardware_plugin_name, "ros2_control_demo_hardware/VelocityActuatorHardware"); ASSERT_THAT(hardware_info.hardware_parameters, SizeIs(2)); EXPECT_EQ(hardware_info.hardware_parameters.at("example_param_write_for_sec"), "1.13"); @@ -521,7 +523,7 @@ TEST_F(TestComponentParser, successfully_parse_valid_urdf_system_robot_with_gpio EXPECT_EQ(hardware_info.name, "RRBotSystemWithGPIO"); EXPECT_EQ(hardware_info.type, "system"); EXPECT_EQ( - hardware_info.hardware_class_type, "ros2_control_demo_hardware/RRBotSystemWithGPIOHardware"); + hardware_info.hardware_plugin_name, "ros2_control_demo_hardware/RRBotSystemWithGPIOHardware"); ASSERT_THAT(hardware_info.joints, SizeIs(2)); @@ -564,7 +566,8 @@ TEST_F(TestComponentParser, successfully_parse_valid_urdf_system_with_size_and_d EXPECT_EQ(hardware_info.name, "RRBotSystemWithSizeAndDataType"); EXPECT_EQ(hardware_info.type, "system"); EXPECT_EQ( - hardware_info.hardware_class_type, "ros2_control_demo_hardware/RRBotSystemWithSizeAndDataType"); + hardware_info.hardware_plugin_name, + "ros2_control_demo_hardware/RRBotSystemWithSizeAndDataType"); ASSERT_THAT(hardware_info.joints, SizeIs(1)); diff --git a/hardware_interface/test/test_resource_manager.cpp b/hardware_interface/test/test_resource_manager.cpp index 7674213903..8600575ff6 100644 --- a/hardware_interface/test/test_resource_manager.cpp +++ b/hardware_interface/test/test_resource_manager.cpp @@ -29,19 +29,19 @@ #include "rclcpp_lifecycle/state.hpp" #include "ros2_control_test_assets/descriptions.hpp" -using ros2_control_test_assets::TEST_ACTUATOR_HARDWARE_CLASS_TYPE; using ros2_control_test_assets::TEST_ACTUATOR_HARDWARE_COMMAND_INTERFACES; using ros2_control_test_assets::TEST_ACTUATOR_HARDWARE_NAME; +using ros2_control_test_assets::TEST_ACTUATOR_HARDWARE_PLUGIN_NAME; using ros2_control_test_assets::TEST_ACTUATOR_HARDWARE_STATE_INTERFACES; using ros2_control_test_assets::TEST_ACTUATOR_HARDWARE_TYPE; -using ros2_control_test_assets::TEST_SENSOR_HARDWARE_CLASS_TYPE; using ros2_control_test_assets::TEST_SENSOR_HARDWARE_COMMAND_INTERFACES; using ros2_control_test_assets::TEST_SENSOR_HARDWARE_NAME; +using ros2_control_test_assets::TEST_SENSOR_HARDWARE_PLUGIN_NAME; using ros2_control_test_assets::TEST_SENSOR_HARDWARE_STATE_INTERFACES; using ros2_control_test_assets::TEST_SENSOR_HARDWARE_TYPE; -using ros2_control_test_assets::TEST_SYSTEM_HARDWARE_CLASS_TYPE; using ros2_control_test_assets::TEST_SYSTEM_HARDWARE_COMMAND_INTERFACES; using ros2_control_test_assets::TEST_SYSTEM_HARDWARE_NAME; +using ros2_control_test_assets::TEST_SYSTEM_HARDWARE_PLUGIN_NAME; using ros2_control_test_assets::TEST_SYSTEM_HARDWARE_STATE_INTERFACES; using ros2_control_test_assets::TEST_SYSTEM_HARDWARE_TYPE; @@ -448,10 +448,11 @@ TEST_F(ResourceManagerTest, resource_status) EXPECT_EQ(status_map[TEST_ACTUATOR_HARDWARE_NAME].type, TEST_ACTUATOR_HARDWARE_TYPE); EXPECT_EQ(status_map[TEST_SENSOR_HARDWARE_NAME].type, TEST_SENSOR_HARDWARE_TYPE); EXPECT_EQ(status_map[TEST_SYSTEM_HARDWARE_NAME].type, TEST_SYSTEM_HARDWARE_TYPE); - // class_type - EXPECT_EQ(status_map[TEST_ACTUATOR_HARDWARE_NAME].class_type, TEST_ACTUATOR_HARDWARE_CLASS_TYPE); - EXPECT_EQ(status_map[TEST_SENSOR_HARDWARE_NAME].class_type, TEST_SENSOR_HARDWARE_CLASS_TYPE); - EXPECT_EQ(status_map[TEST_SYSTEM_HARDWARE_NAME].class_type, TEST_SYSTEM_HARDWARE_CLASS_TYPE); + // plugin_name + EXPECT_EQ( + status_map[TEST_ACTUATOR_HARDWARE_NAME].plugin_name, TEST_ACTUATOR_HARDWARE_PLUGIN_NAME); + EXPECT_EQ(status_map[TEST_SENSOR_HARDWARE_NAME].plugin_name, TEST_SENSOR_HARDWARE_PLUGIN_NAME); + EXPECT_EQ(status_map[TEST_SYSTEM_HARDWARE_NAME].plugin_name, TEST_SYSTEM_HARDWARE_PLUGIN_NAME); // state EXPECT_EQ( status_map[TEST_ACTUATOR_HARDWARE_NAME].state.id(), diff --git a/ros2_control_test_assets/include/ros2_control_test_assets/components_urdfs.hpp b/ros2_control_test_assets/include/ros2_control_test_assets/components_urdfs.hpp index 73dc32dd2f..f3e2bda2c0 100644 --- a/ros2_control_test_assets/include/ros2_control_test_assets/components_urdfs.hpp +++ b/ros2_control_test_assets/include/ros2_control_test_assets/components_urdfs.hpp @@ -421,7 +421,7 @@ const auto invalid_urdf_ros2_control_missing_attribute = )"; -const auto invalid_urdf_ros2_control_component_missing_class_type = +const auto invalid_urdf_ros2_control_component_missing_plugin_name = R"( @@ -452,7 +452,7 @@ const auto invalid_urdf_ros2_control_parameter_missing_name = )"; -const auto invalid_urdf_ros2_control_component_class_type_empty = +const auto invalid_urdf_ros2_control_component_plugin_name_empty = R"( diff --git a/ros2_control_test_assets/include/ros2_control_test_assets/descriptions.hpp b/ros2_control_test_assets/include/ros2_control_test_assets/descriptions.hpp index 83281bd3d7..05ffad00d6 100644 --- a/ros2_control_test_assets/include/ros2_control_test_assets/descriptions.hpp +++ b/ros2_control_test_assets/include/ros2_control_test_assets/descriptions.hpp @@ -417,7 +417,7 @@ const auto minimal_robot_missing_command_keys_urdf = [[maybe_unused]] const std::string TEST_ACTUATOR_HARDWARE_NAME = "TestActuatorHardware"; [[maybe_unused]] const std::string TEST_ACTUATOR_HARDWARE_TYPE = "actuator"; -[[maybe_unused]] const std::string TEST_ACTUATOR_HARDWARE_CLASS_TYPE = "test_actuator"; +[[maybe_unused]] const std::string TEST_ACTUATOR_HARDWARE_PLUGIN_NAME = "test_actuator"; [[maybe_unused]] const std::vector TEST_ACTUATOR_HARDWARE_COMMAND_INTERFACES = { "joint1/position", "joint1/max_velocity"}; [[maybe_unused]] const std::vector TEST_ACTUATOR_HARDWARE_STATE_INTERFACES = { @@ -425,14 +425,14 @@ const auto minimal_robot_missing_command_keys_urdf = [[maybe_unused]] const std::string TEST_SENSOR_HARDWARE_NAME = "TestSensorHardware"; [[maybe_unused]] const std::string TEST_SENSOR_HARDWARE_TYPE = "sensor"; -[[maybe_unused]] const std::string TEST_SENSOR_HARDWARE_CLASS_TYPE = "test_sensor"; +[[maybe_unused]] const std::string TEST_SENSOR_HARDWARE_PLUGIN_NAME = "test_sensor"; [[maybe_unused]] const std::vector TEST_SENSOR_HARDWARE_COMMAND_INTERFACES = {""}; [[maybe_unused]] const std::vector TEST_SENSOR_HARDWARE_STATE_INTERFACES = { "sensor1/velocity"}; [[maybe_unused]] const std::string TEST_SYSTEM_HARDWARE_NAME = "TestSystemHardware"; [[maybe_unused]] const std::string TEST_SYSTEM_HARDWARE_TYPE = "system"; -[[maybe_unused]] const std::string TEST_SYSTEM_HARDWARE_CLASS_TYPE = "test_system"; +[[maybe_unused]] const std::string TEST_SYSTEM_HARDWARE_PLUGIN_NAME = "test_system"; [[maybe_unused]] const std::vector TEST_SYSTEM_HARDWARE_COMMAND_INTERFACES = { "joint2/velocity", "joint2/max_acceleration", "joint3/velocity", "configuration/max_tcp_jerk"}; [[maybe_unused]] const std::vector TEST_SYSTEM_HARDWARE_STATE_INTERFACES = {