diff --git a/.github/workflows/ci-coverage-build.yml b/.github/workflows/ci-coverage-build.yml
index ae2a1b9e61..fe2ccd0c1a 100644
--- a/.github/workflows/ci-coverage-build.yml
+++ b/.github/workflows/ci-coverage-build.yml
@@ -30,6 +30,7 @@ jobs:
controller_interface
controller_manager
hardware_interface
+ hardware_interface_testing
transmission_interface
vcs-repo-file-url: |
diff --git a/.github/workflows/ci-ros-lint.yml b/.github/workflows/ci-ros-lint.yml
index 84c68217f3..52da5edfe4 100644
--- a/.github/workflows/ci-ros-lint.yml
+++ b/.github/workflows/ci-ros-lint.yml
@@ -24,6 +24,7 @@ jobs:
controller_manager
controller_manager_msgs
hardware_interface
+ hardware_interface_testing
ros2controlcli
ros2_control
ros2_control_test_assets
@@ -49,6 +50,7 @@ jobs:
controller_manager
controller_manager_msgs
hardware_interface
+ hardware_interface_testing
ros2controlcli
ros2_control
ros2_control_test_assets
diff --git a/controller_manager/package.xml b/controller_manager/package.xml
index 33e0004e78..e534e39268 100644
--- a/controller_manager/package.xml
+++ b/controller_manager/package.xml
@@ -29,6 +29,7 @@
std_msgs
ament_cmake_gmock
+ hardware_interface_testing
ros2_control_test_assets
diff --git a/hardware_interface/CMakeLists.txt b/hardware_interface/CMakeLists.txt
index 35823b3ce9..2613ba735a 100644
--- a/hardware_interface/CMakeLists.txt
+++ b/hardware_interface/CMakeLists.txt
@@ -79,21 +79,6 @@ if(BUILD_TESTING)
target_link_libraries(test_component_parser hardware_interface)
ament_target_dependencies(test_component_parser ros2_control_test_assets)
- add_library(test_components SHARED
- test/test_components/test_actuator.cpp
- test/test_components/test_sensor.cpp
- test/test_components/test_system.cpp)
- target_link_libraries(test_components hardware_interface)
- ament_target_dependencies(test_components
- pluginlib
- ros2_control_test_assets
- )
- install(TARGETS test_components
- DESTINATION lib
- )
- pluginlib_export_plugin_description_file(
- hardware_interface test/test_components/test_components.xml)
-
add_library(test_hardware_components SHARED
test/test_hardware_components/test_single_joint_actuator.cpp
test/test_hardware_components/test_force_torque_sensor.cpp
@@ -110,14 +95,6 @@ if(BUILD_TESTING)
hardware_interface test/test_hardware_components/test_hardware_components.xml
)
- ament_add_gmock(test_resource_manager test/test_resource_manager.cpp)
- target_link_libraries(test_resource_manager hardware_interface)
- ament_target_dependencies(test_resource_manager ros2_control_test_assets)
-
- ament_add_gmock(test_resource_manager_prepare_perform_switch test/test_resource_manager_prepare_perform_switch.cpp)
- target_link_libraries(test_resource_manager_prepare_perform_switch hardware_interface)
- ament_target_dependencies(test_resource_manager_prepare_perform_switch ros2_control_test_assets)
-
ament_add_gmock(test_generic_system test/mock_components/test_generic_system.cpp)
target_include_directories(test_generic_system PRIVATE include)
target_link_libraries(test_generic_system hardware_interface)
diff --git a/hardware_interface_testing/CMakeLists.txt b/hardware_interface_testing/CMakeLists.txt
new file mode 100644
index 0000000000..8e88a677bf
--- /dev/null
+++ b/hardware_interface_testing/CMakeLists.txt
@@ -0,0 +1,46 @@
+cmake_minimum_required(VERSION 3.16)
+project(hardware_interface_testing LANGUAGES CXX)
+
+if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
+ add_compile_options(-Wall -Wextra -Werror=conversion -Werror=unused-but-set-variable -Werror=return-type -Werror=shadow)
+endif()
+
+set(THIS_PACKAGE_INCLUDE_DEPENDS
+ control_msgs
+ hardware_interface
+ lifecycle_msgs
+ pluginlib
+ rclcpp_lifecycle
+ ros2_control_test_assets
+)
+
+find_package(ament_cmake REQUIRED)
+foreach(Dependency IN ITEMS ${THIS_PACKAGE_INCLUDE_DEPENDS})
+ find_package(${Dependency} REQUIRED)
+endforeach()
+
+add_library(test_components SHARED
+test/test_components/test_actuator.cpp
+test/test_components/test_sensor.cpp
+test/test_components/test_system.cpp)
+ament_target_dependencies(test_components hardware_interface pluginlib ros2_control_test_assets)
+install(TARGETS test_components
+DESTINATION lib
+)
+pluginlib_export_plugin_description_file(
+hardware_interface test/test_components/test_components.xml)
+
+if(BUILD_TESTING)
+
+ find_package(ament_cmake_gmock REQUIRED)
+
+ ament_add_gmock(test_resource_manager test/test_resource_manager.cpp)
+ ament_target_dependencies(test_resource_manager hardware_interface ros2_control_test_assets)
+
+ ament_add_gmock(test_resource_manager_prepare_perform_switch test/test_resource_manager_prepare_perform_switch.cpp)
+ ament_target_dependencies(test_resource_manager_prepare_perform_switch hardware_interface ros2_control_test_assets)
+
+endif()
+
+ament_export_dependencies(${THIS_PACKAGE_INCLUDE_DEPENDS})
+ament_package()
diff --git a/hardware_interface_testing/README.md b/hardware_interface_testing/README.md
new file mode 100644
index 0000000000..cba28d74a5
--- /dev/null
+++ b/hardware_interface_testing/README.md
@@ -0,0 +1,4 @@
+# hardware_interface_testing
+
+This package contains a set of hardware interfaces and controllers that can be used for other
+packages to test their functionality.
diff --git a/hardware_interface_testing/package.xml b/hardware_interface_testing/package.xml
new file mode 100644
index 0000000000..841c77626f
--- /dev/null
+++ b/hardware_interface_testing/package.xml
@@ -0,0 +1,25 @@
+
+
+ hardware_interface_testing
+ 0.0.0
+ ros2_control hardware interface testing
+ Bence Magyar
+ Denis Štogl
+ Christoph Froehlich
+ Apache License 2.0
+
+ ament_cmake
+
+ control_msgs
+ hardware_interface
+ lifecycle_msgs
+ pluginlib
+ rclcpp_lifecycle
+ ros2_control_test_assets
+
+ ament_cmake_gmock
+
+
+ ament_cmake
+
+
diff --git a/hardware_interface/test/test_components/test_actuator.cpp b/hardware_interface_testing/test/test_components/test_actuator.cpp
similarity index 100%
rename from hardware_interface/test/test_components/test_actuator.cpp
rename to hardware_interface_testing/test/test_components/test_actuator.cpp
diff --git a/hardware_interface/test/test_components/test_components.xml b/hardware_interface_testing/test/test_components/test_components.xml
similarity index 100%
rename from hardware_interface/test/test_components/test_components.xml
rename to hardware_interface_testing/test/test_components/test_components.xml
diff --git a/hardware_interface/test/test_components/test_sensor.cpp b/hardware_interface_testing/test/test_components/test_sensor.cpp
similarity index 100%
rename from hardware_interface/test/test_components/test_sensor.cpp
rename to hardware_interface_testing/test/test_components/test_sensor.cpp
diff --git a/hardware_interface/test/test_components/test_system.cpp b/hardware_interface_testing/test/test_components/test_system.cpp
similarity index 100%
rename from hardware_interface/test/test_components/test_system.cpp
rename to hardware_interface_testing/test/test_components/test_system.cpp
diff --git a/hardware_interface/test/test_resource_manager.cpp b/hardware_interface_testing/test/test_resource_manager.cpp
similarity index 100%
rename from hardware_interface/test/test_resource_manager.cpp
rename to hardware_interface_testing/test/test_resource_manager.cpp
diff --git a/hardware_interface/test/test_resource_manager.hpp b/hardware_interface_testing/test/test_resource_manager.hpp
similarity index 100%
rename from hardware_interface/test/test_resource_manager.hpp
rename to hardware_interface_testing/test/test_resource_manager.hpp
diff --git a/hardware_interface/test/test_resource_manager_prepare_perform_switch.cpp b/hardware_interface_testing/test/test_resource_manager_prepare_perform_switch.cpp
similarity index 100%
rename from hardware_interface/test/test_resource_manager_prepare_perform_switch.cpp
rename to hardware_interface_testing/test/test_resource_manager_prepare_perform_switch.cpp
diff --git a/joint_limits/include/joint_limits/joint_limits_urdf.hpp b/joint_limits/include/joint_limits/joint_limits_urdf.hpp
index daa0d707d8..cdcbaf9c9d 100644
--- a/joint_limits/include/joint_limits/joint_limits_urdf.hpp
+++ b/joint_limits/include/joint_limits/joint_limits_urdf.hpp
@@ -14,8 +14,8 @@
/// \author Adolfo Rodriguez Tsouroukdissian
-#ifndef JOINT_LIMITS_URDF_HPP
-#define JOINT_LIMITS_URDF_HPP
+#ifndef JOINT_LIMITS__JOINT_LIMITS_URDF_HPP_
+#define JOINT_LIMITS__JOINT_LIMITS_URDF_HPP_
#include "joint_limits/joint_limits.hpp"
#include "urdf_model/joint.h"
@@ -82,4 +82,4 @@ inline bool getSoftJointLimits(urdf::JointConstSharedPtr urdf_joint, SoftJointLi
return true;
}
} // namespace joint_limits
-#endif // JOINT_LIMITS_URDF_HPP
+#endif // JOINT_LIMITS__JOINT_LIMITS_URDF_HPP_
diff --git a/joint_limits/test/joint_limits_urdf_test.cpp b/joint_limits/test/joint_limits_urdf_test.cpp
index 27d660afd7..562293d475 100644
--- a/joint_limits/test/joint_limits_urdf_test.cpp
+++ b/joint_limits/test/joint_limits_urdf_test.cpp
@@ -17,7 +17,6 @@
#include "gtest/gtest.h"
using std::string;
-using namespace joint_limits;
class JointLimitsUrdfTest : public ::testing::Test
{
@@ -53,14 +52,14 @@ TEST_F(JointLimitsUrdfTest, GetJointLimits)
{
// Unset URDF joint
{
- JointLimits limits;
+ joint_limits::JointLimits limits;
urdf::JointSharedPtr urdf_joint_bad;
EXPECT_FALSE(getJointLimits(urdf_joint_bad, limits));
}
// Unset URDF limits
{
- JointLimits limits;
+ joint_limits::JointLimits limits;
urdf::JointSharedPtr urdf_joint_bad(new urdf::Joint);
EXPECT_FALSE(getJointLimits(urdf_joint_bad, limits));
}
@@ -69,7 +68,7 @@ TEST_F(JointLimitsUrdfTest, GetJointLimits)
{
urdf_joint->type = urdf::Joint::CONTINUOUS;
- JointLimits limits;
+ joint_limits::JointLimits limits;
EXPECT_TRUE(getJointLimits(urdf_joint, limits));
// Position
@@ -92,7 +91,7 @@ TEST_F(JointLimitsUrdfTest, GetJointLimits)
{
urdf_joint->type = urdf::Joint::REVOLUTE;
- JointLimits limits;
+ joint_limits::JointLimits limits;
EXPECT_TRUE(getJointLimits(urdf_joint, limits));
// Position
@@ -117,7 +116,7 @@ TEST_F(JointLimitsUrdfTest, GetJointLimits)
{
urdf_joint->type = urdf::Joint::PRISMATIC;
- JointLimits limits;
+ joint_limits::JointLimits limits;
EXPECT_TRUE(getJointLimits(urdf_joint, limits));
// Position
@@ -141,25 +140,23 @@ TEST_F(JointLimitsUrdfTest, GetJointLimits)
TEST_F(JointLimitsUrdfTest, GetSoftJointLimits)
{
- using namespace joint_limits;
-
// Unset URDF joint
{
- SoftJointLimits soft_limits;
+ joint_limits::SoftJointLimits soft_limits;
urdf::JointSharedPtr urdf_joint_bad;
EXPECT_FALSE(getSoftJointLimits(urdf_joint_bad, soft_limits));
}
// Unset URDF limits
{
- SoftJointLimits soft_limits;
+ joint_limits::SoftJointLimits soft_limits;
urdf::JointSharedPtr urdf_joint_bad(new urdf::Joint);
EXPECT_FALSE(getSoftJointLimits(urdf_joint_bad, soft_limits));
}
// Valid URDF joint
{
- SoftJointLimits soft_limits;
+ joint_limits::SoftJointLimits soft_limits;
EXPECT_TRUE(getSoftJointLimits(urdf_joint, soft_limits));
// Soft limits