diff --git a/hardware_interface_testing/test/test_resource_manager.cpp b/hardware_interface_testing/test/test_resource_manager.cpp
index 730410ddd7..7446e885cc 100644
--- a/hardware_interface_testing/test/test_resource_manager.cpp
+++ b/hardware_interface_testing/test/test_resource_manager.cpp
@@ -228,6 +228,12 @@ TEST_F(
ros2_control_test_assets::minimal_robot_not_existing_system_plugin);
}
+TEST_F(ResourceManagerTest, expect_load_and_initialize_to_fail_when_there_are_dupplicate_of_hw_comp)
+{
+ test_load_and_initialized_components_failure(
+ ros2_control_test_assets::minimal_robot_duplicated_component);
+}
+
TEST_F(
ResourceManagerTest, expect_load_and_initialize_to_fail_when_a_hw_component_initialization_fails)
{
@@ -250,6 +256,12 @@ TEST_F(ResourceManagerTest, load_and_initialize_components_called_if_urdf_is_val
ASSERT_TRUE(rm.are_components_initialized());
}
+TEST_F(ResourceManagerTest, load_and_initialize_components_called_if_async_urdf_is_valid)
+{
+ TestableResourceManager rm(ros2_control_test_assets::minimal_async_robot_urdf);
+ ASSERT_TRUE(rm.are_components_initialized());
+}
+
TEST_F(ResourceManagerTest, can_load_and_initialize_components_later)
{
TestableResourceManager rm;
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 713453bf62..d70f9c0869 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
@@ -176,6 +176,55 @@ const auto hardware_resources =
)";
+const auto async_hardware_resources =
+ R"(
+
+
+ test_actuator
+
+
+
+
+
+
+
+
+
+
+ test_sensor
+ 2
+ 2
+
+
+
+
+
+
+
+ test_system
+ 2
+ 2
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+)";
+
const auto unitilizable_hardware_resources =
R"(
@@ -253,25 +302,25 @@ const auto hardware_resources_not_existing_actuator_plugin =
test_system
2
2
-
-
+
+
-
-
+
+
-
+
-
-
+
+
)";
const auto hardware_resources_not_existing_sensor_plugin =
@@ -302,25 +351,25 @@ const auto hardware_resources_not_existing_sensor_plugin =
test_system
2
2
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
)";
const auto hardware_resources_not_existing_system_plugin =
R"(
@@ -371,6 +420,55 @@ const auto hardware_resources_not_existing_system_plugin =
)";
+const auto hardware_resources_duplicated_component =
+ R"(
+
+
+ test_actuator
+
+
+
+
+
+
+
+
+
+
+ test_sensor
+ 2
+ 2
+
+
+
+
+
+
+
+ test_system
+ 2
+ 2
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+)";
+
const auto hardware_resources_actuator_initializaion_error =
R"(
@@ -731,6 +829,8 @@ const auto diffbot_urdf =
const auto minimal_robot_urdf =
std::string(urdf_head) + std::string(hardware_resources) + std::string(urdf_tail);
+const auto minimal_async_robot_urdf =
+ std::string(urdf_head) + std::string(async_hardware_resources) + std::string(urdf_tail);
const auto minimal_unitilizable_robot_urdf =
std::string(urdf_head) + std::string(unitilizable_hardware_resources) + std::string(urdf_tail);
@@ -744,6 +844,10 @@ const auto minimal_robot_not_existing_system_plugin =
std::string(urdf_head) + std::string(hardware_resources_not_existing_system_plugin) +
std::string(urdf_tail);
+const auto minimal_robot_duplicated_component =
+ std::string(urdf_head) + std::string(hardware_resources_duplicated_component) +
+ std::string(urdf_tail);
+
const auto minimal_robot_actuator_initialization_error =
std::string(urdf_head) + std::string(hardware_resources_not_existing_actuator_plugin) +
std::string(urdf_tail);