From 648d039b358c329a9e93e753ef7e8b74e9f6bbdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20=C5=A0togl?= Date: Sun, 15 May 2022 18:02:46 +0200 Subject: [PATCH] Add ControllerInterfaceBase class and use it in Controller Manager. --- .../include/controller_interface/controller_interface.hpp | 2 +- .../test_chainable_controller.cpp | 2 +- .../test_chainable_controller.xml | 2 +- .../test/test_controller/test_controller.cpp | 3 ++- .../test/test_controller/test_controller.xml | 2 +- .../test_controller_failed_init.cpp | 3 ++- .../test_controller_failed_init.xml | 2 +- controller_manager/test/test_controller_manager_srvs.cpp | 2 +- .../test_controller_with_interfaces.cpp | 2 +- .../test_controller_with_interfaces.xml | 2 +- .../test_controllers_chaining_with_controller_manager.cpp | 8 ++++---- 11 files changed, 16 insertions(+), 14 deletions(-) diff --git a/controller_interface/include/controller_interface/controller_interface.hpp b/controller_interface/include/controller_interface/controller_interface.hpp index efdab02d62..a3d006755f 100644 --- a/controller_interface/include/controller_interface/controller_interface.hpp +++ b/controller_interface/include/controller_interface/controller_interface.hpp @@ -53,7 +53,7 @@ class ControllerInterface : public controller_interface::ControllerInterfaceBase /** * Controller is not chainable, therefore no chained mode can be set. * - * \returns false; + * \returns false. */ CONTROLLER_INTERFACE_PUBLIC bool set_chained_mode(bool chained_mode) final; diff --git a/controller_manager/test/test_chainable_controller/test_chainable_controller.cpp b/controller_manager/test/test_chainable_controller/test_chainable_controller.cpp index dedc527344..23c26c26f2 100644 --- a/controller_manager/test/test_chainable_controller/test_chainable_controller.cpp +++ b/controller_manager/test/test_chainable_controller/test_chainable_controller.cpp @@ -186,4 +186,4 @@ void TestChainableController::set_reference_interface_names( #include "pluginlib/class_list_macros.hpp" PLUGINLIB_EXPORT_CLASS( - test_chainable_controller::TestChainableController, controller_interface::ControllerInterface) + test_chainable_controller::TestChainableController, controller_interface::ControllerInterfaceBase) diff --git a/controller_manager/test/test_chainable_controller/test_chainable_controller.xml b/controller_manager/test/test_chainable_controller/test_chainable_controller.xml index a2213e6dcd..3803f14032 100644 --- a/controller_manager/test/test_chainable_controller/test_chainable_controller.xml +++ b/controller_manager/test/test_chainable_controller/test_chainable_controller.xml @@ -2,7 +2,7 @@ + base_class_type="controller_interface::ControllerInterfaceBase"> Controller used for testing diff --git a/controller_manager/test/test_controller/test_controller.cpp b/controller_manager/test/test_controller/test_controller.cpp index 51e83ac452..9f8a45ff97 100644 --- a/controller_manager/test/test_controller/test_controller.cpp +++ b/controller_manager/test/test_controller/test_controller.cpp @@ -111,4 +111,5 @@ void TestController::set_state_interface_configuration( #include "pluginlib/class_list_macros.hpp" -PLUGINLIB_EXPORT_CLASS(test_controller::TestController, controller_interface::ControllerInterface) +PLUGINLIB_EXPORT_CLASS( + test_controller::TestController, controller_interface::ControllerInterfaceBase) diff --git a/controller_manager/test/test_controller/test_controller.xml b/controller_manager/test/test_controller/test_controller.xml index e4d1d61ca5..8f2ad843af 100644 --- a/controller_manager/test/test_controller/test_controller.xml +++ b/controller_manager/test/test_controller/test_controller.xml @@ -1,6 +1,6 @@ - + Controller used for testing diff --git a/controller_manager/test/test_controller_failed_init/test_controller_failed_init.cpp b/controller_manager/test/test_controller_failed_init/test_controller_failed_init.cpp index 57d253d03c..d0edc97489 100644 --- a/controller_manager/test/test_controller_failed_init/test_controller_failed_init.cpp +++ b/controller_manager/test/test_controller_failed_init/test_controller_failed_init.cpp @@ -49,4 +49,5 @@ controller_interface::return_type TestControllerFailedInit::update( #include "pluginlib/class_list_macros.hpp" PLUGINLIB_EXPORT_CLASS( - test_controller_failed_init::TestControllerFailedInit, controller_interface::ControllerInterface) + test_controller_failed_init::TestControllerFailedInit, + controller_interface::ControllerInterfaceBase) diff --git a/controller_manager/test/test_controller_failed_init/test_controller_failed_init.xml b/controller_manager/test/test_controller_failed_init/test_controller_failed_init.xml index 0f425924b1..b69b4a180d 100644 --- a/controller_manager/test/test_controller_failed_init/test_controller_failed_init.xml +++ b/controller_manager/test/test_controller_failed_init/test_controller_failed_init.xml @@ -1,6 +1,6 @@ - + Controller used for testing diff --git a/controller_manager/test/test_controller_manager_srvs.cpp b/controller_manager/test/test_controller_manager_srvs.cpp index e106ac0125..f2999f4a08 100644 --- a/controller_manager/test/test_controller_manager_srvs.cpp +++ b/controller_manager/test/test_controller_manager_srvs.cpp @@ -48,7 +48,7 @@ TEST_F(TestControllerManagerSrvs, list_controller_types) ASSERT_EQ(controller_types, result->base_classes.size()); ASSERT_THAT(result->types, ::testing::Contains(test_controller::TEST_CONTROLLER_CLASS_NAME)); ASSERT_THAT( - result->base_classes, ::testing::Contains("controller_interface::ControllerInterface")); + result->base_classes, ::testing::Contains("controller_interface::ControllerInterfaceBase")); } TEST_F(TestControllerManagerSrvs, list_controllers_srv) diff --git a/controller_manager/test/test_controller_with_interfaces/test_controller_with_interfaces.cpp b/controller_manager/test/test_controller_with_interfaces/test_controller_with_interfaces.cpp index 86f3c8b76c..629e6ad80d 100644 --- a/controller_manager/test/test_controller_with_interfaces/test_controller_with_interfaces.cpp +++ b/controller_manager/test/test_controller_with_interfaces/test_controller_with_interfaces.cpp @@ -56,4 +56,4 @@ TestControllerWithInterfaces::on_cleanup(const rclcpp_lifecycle::State & /*previ PLUGINLIB_EXPORT_CLASS( test_controller_with_interfaces::TestControllerWithInterfaces, - controller_interface::ControllerInterface) + controller_interface::ControllerInterfaceBase) diff --git a/controller_manager/test/test_controller_with_interfaces/test_controller_with_interfaces.xml b/controller_manager/test/test_controller_with_interfaces/test_controller_with_interfaces.xml index 451477fda7..bf5a8487d9 100644 --- a/controller_manager/test/test_controller_with_interfaces/test_controller_with_interfaces.xml +++ b/controller_manager/test/test_controller_with_interfaces/test_controller_with_interfaces.xml @@ -1,6 +1,6 @@ - + Controller used for testing diff --git a/controller_manager/test/test_controllers_chaining_with_controller_manager.cpp b/controller_manager/test/test_controllers_chaining_with_controller_manager.cpp index 6dd8e9e5df..312abafa75 100644 --- a/controller_manager/test/test_controllers_chaining_with_controller_manager.cpp +++ b/controller_manager/test/test_controllers_chaining_with_controller_manager.cpp @@ -216,7 +216,7 @@ class TestControllerChainingWithControllerManager template < typename T, typename std::enable_if< - std::is_convertible::value, + std::is_convertible::value, T>::type * = nullptr> void SetToChainedModeAndMakeReferenceInterfacesAvailable( std::shared_ptr & controller, const std::string & controller_name, @@ -236,7 +236,7 @@ class TestControllerChainingWithControllerManager template < typename T, typename std::enable_if< - std::is_convertible::value, + std::is_convertible::value, T>::type * = nullptr> void check_after_de_activate( std::shared_ptr & controller, const std::vector & claimed_command_itfs, @@ -273,7 +273,7 @@ class TestControllerChainingWithControllerManager template < typename T, typename std::enable_if< - std::is_convertible::value, + std::is_convertible::value, T>::type * = nullptr> void ActivateAndCheckController( std::shared_ptr & controller, const std::string & controller_name, @@ -288,7 +288,7 @@ class TestControllerChainingWithControllerManager template < typename T, typename std::enable_if< - std::is_convertible::value, + std::is_convertible::value, T>::type * = nullptr> void DeactivateAndCheckController( std::shared_ptr & controller, const std::string & controller_name,