From f5b83be267b294cf67ba9cb4dc0c29fa016a13c5 Mon Sep 17 00:00:00 2001 From: Esteve Fernandez Date: Wed, 16 Oct 2024 11:07:53 +0200 Subject: [PATCH] refactor(component_interface_utils): prefix package and namespace with autoware Signed-off-by: Esteve Fernandez --- .../CMakeLists.txt | 2 +- .../README.md | 14 +++++++------- .../component_interface_utils/rclcpp.hpp | 16 ++++++++-------- .../rclcpp/create_interface.hpp | 16 ++++++++-------- .../rclcpp/exceptions.hpp | 4 ++-- .../rclcpp/interface.hpp | 4 ++-- .../rclcpp/service_client.hpp | 8 ++++---- .../rclcpp/service_server.hpp | 8 ++++---- .../rclcpp/topic_publisher.hpp | 4 ++-- .../rclcpp/topic_subscription.hpp | 4 ++-- .../component_interface_utils/specs.hpp | 4 ++-- .../component_interface_utils/status.hpp | 4 ++-- .../package.xml | 4 ++-- .../test/test_component_interface_utils.cpp | 14 +++++++------- 14 files changed, 53 insertions(+), 53 deletions(-) rename common/{component_interface_utils => autoware_component_interface_utils}/CMakeLists.txt (92%) rename common/{component_interface_utils => autoware_component_interface_utils}/README.md (83%) rename common/{component_interface_utils/include => autoware_component_interface_utils/include/autoware}/component_interface_utils/rclcpp.hpp (88%) rename common/{component_interface_utils/include => autoware_component_interface_utils/include/autoware}/component_interface_utils/rclcpp/create_interface.hpp (85%) rename common/{component_interface_utils/include => autoware_component_interface_utils/include/autoware}/component_interface_utils/rclcpp/exceptions.hpp (96%) rename common/{component_interface_utils/include => autoware_component_interface_utils/include/autoware}/component_interface_utils/rclcpp/interface.hpp (95%) rename common/{component_interface_utils/include => autoware_component_interface_utils/include/autoware}/component_interface_utils/rclcpp/service_client.hpp (93%) rename common/{component_interface_utils/include => autoware_component_interface_utils/include/autoware}/component_interface_utils/rclcpp/service_server.hpp (92%) rename common/{component_interface_utils/include => autoware_component_interface_utils/include/autoware}/component_interface_utils/rclcpp/topic_publisher.hpp (93%) rename common/{component_interface_utils/include => autoware_component_interface_utils/include/autoware}/component_interface_utils/rclcpp/topic_subscription.hpp (93%) rename common/{component_interface_utils/include => autoware_component_interface_utils/include/autoware}/component_interface_utils/specs.hpp (90%) rename common/{component_interface_utils/include => autoware_component_interface_utils/include/autoware}/component_interface_utils/status.hpp (89%) rename common/{component_interface_utils => autoware_component_interface_utils}/package.xml (87%) rename common/{component_interface_utils => autoware_component_interface_utils}/test/test_component_interface_utils.cpp (83%) diff --git a/common/component_interface_utils/CMakeLists.txt b/common/autoware_component_interface_utils/CMakeLists.txt similarity index 92% rename from common/component_interface_utils/CMakeLists.txt rename to common/autoware_component_interface_utils/CMakeLists.txt index 435d5535e0a37..b7cce55eba9fa 100644 --- a/common/component_interface_utils/CMakeLists.txt +++ b/common/autoware_component_interface_utils/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.14) -project(component_interface_utils) +project(autoware_component_interface_utils) find_package(autoware_cmake REQUIRED) autoware_package() diff --git a/common/component_interface_utils/README.md b/common/autoware_component_interface_utils/README.md similarity index 83% rename from common/component_interface_utils/README.md rename to common/autoware_component_interface_utils/README.md index 2a2b191c854a0..2f4038c9f37cd 100644 --- a/common/component_interface_utils/README.md +++ b/common/autoware_component_interface_utils/README.md @@ -1,4 +1,4 @@ -# component_interface_utils +# autoware_component_interface_utils ## Features @@ -40,13 +40,13 @@ Create the wrapper using the above definition as follows. ```cpp // header file -component_interface_utils::Service::SharedPtr srv_; -component_interface_utils::Client::SharedPtr cli_; -component_interface_utils::Publisher::SharedPtr pub_; -component_interface_utils::Subscription::SharedPtr sub_; +autoware::component_interface_utils::Service::SharedPtr srv_; +autoware::component_interface_utils::Client::SharedPtr cli_; +autoware::component_interface_utils::Publisher::SharedPtr pub_; +autoware::component_interface_utils::Subscription::SharedPtr sub_; // source file -const auto node = component_interface_utils::NodeAdaptor(this); +const auto node = autoware::component_interface_utils::NodeAdaptor(this); node.init_srv(srv_, callback); node.init_cli(cli_); node.init_pub(pub_); @@ -94,7 +94,7 @@ void service_callback(Request req, Response res) There are utilities for relaying services and messages of the same type. ```cpp -const auto node = component_interface_utils::NodeAdaptor(this); +const auto node = autoware::component_interface_utils::NodeAdaptor(this); service_callback_group_ = create_callback_group(rclcpp::CallbackGroupType::MutuallyExclusive); node.relay_message(pub_, sub_); node.relay_service(cli_, srv_, service_callback_group_); // group is for avoiding deadlocks diff --git a/common/component_interface_utils/include/component_interface_utils/rclcpp.hpp b/common/autoware_component_interface_utils/include/autoware/component_interface_utils/rclcpp.hpp similarity index 88% rename from common/component_interface_utils/include/component_interface_utils/rclcpp.hpp rename to common/autoware_component_interface_utils/include/autoware/component_interface_utils/rclcpp.hpp index 8099bea36784e..05b40d2765b9e 100644 --- a/common/component_interface_utils/include/component_interface_utils/rclcpp.hpp +++ b/common/autoware_component_interface_utils/include/autoware/component_interface_utils/rclcpp.hpp @@ -15,18 +15,18 @@ #ifndef COMPONENT_INTERFACE_UTILS__RCLCPP_HPP_ #define COMPONENT_INTERFACE_UTILS__RCLCPP_HPP_ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include #include -namespace component_interface_utils +namespace autoware::component_interface_utils { class NodeAdaptor @@ -123,6 +123,6 @@ class NodeAdaptor NodeInterface::SharedPtr interface_; }; -} // namespace component_interface_utils +} // namespace autoware::component_interface_utils #endif // COMPONENT_INTERFACE_UTILS__RCLCPP_HPP_ diff --git a/common/component_interface_utils/include/component_interface_utils/rclcpp/create_interface.hpp b/common/autoware_component_interface_utils/include/autoware/component_interface_utils/rclcpp/create_interface.hpp similarity index 85% rename from common/component_interface_utils/include/component_interface_utils/rclcpp/create_interface.hpp rename to common/autoware_component_interface_utils/include/autoware/component_interface_utils/rclcpp/create_interface.hpp index d5af211b015bf..3b798155bd7fb 100644 --- a/common/component_interface_utils/include/component_interface_utils/rclcpp/create_interface.hpp +++ b/common/autoware_component_interface_utils/include/autoware/component_interface_utils/rclcpp/create_interface.hpp @@ -15,17 +15,17 @@ #ifndef COMPONENT_INTERFACE_UTILS__RCLCPP__CREATE_INTERFACE_HPP_ #define COMPONENT_INTERFACE_UTILS__RCLCPP__CREATE_INTERFACE_HPP_ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include -namespace component_interface_utils +namespace autoware::component_interface_utils { /// Create a client wrapper for logging. This is a private implementation. @@ -72,6 +72,6 @@ typename Subscription::SharedPtr create_subscription_impl( return Subscription::make_shared(subscription); } -} // namespace component_interface_utils +} // namespace autoware::component_interface_utils #endif // COMPONENT_INTERFACE_UTILS__RCLCPP__CREATE_INTERFACE_HPP_ diff --git a/common/component_interface_utils/include/component_interface_utils/rclcpp/exceptions.hpp b/common/autoware_component_interface_utils/include/autoware/component_interface_utils/rclcpp/exceptions.hpp similarity index 96% rename from common/component_interface_utils/include/component_interface_utils/rclcpp/exceptions.hpp rename to common/autoware_component_interface_utils/include/autoware/component_interface_utils/rclcpp/exceptions.hpp index e0a6064875d91..500cffe4ace46 100644 --- a/common/component_interface_utils/include/component_interface_utils/rclcpp/exceptions.hpp +++ b/common/autoware_component_interface_utils/include/autoware/component_interface_utils/rclcpp/exceptions.hpp @@ -20,7 +20,7 @@ #include #include -namespace component_interface_utils +namespace autoware::component_interface_utils { class ServiceException : public std::exception @@ -104,6 +104,6 @@ class NoEffectWarning : public ServiceException } }; -} // namespace component_interface_utils +} // namespace autoware::component_interface_utils #endif // COMPONENT_INTERFACE_UTILS__RCLCPP__EXCEPTIONS_HPP_ diff --git a/common/component_interface_utils/include/component_interface_utils/rclcpp/interface.hpp b/common/autoware_component_interface_utils/include/autoware/component_interface_utils/rclcpp/interface.hpp similarity index 95% rename from common/component_interface_utils/include/component_interface_utils/rclcpp/interface.hpp rename to common/autoware_component_interface_utils/include/autoware/component_interface_utils/rclcpp/interface.hpp index 97f46933f2fe6..fab32c9d2f3a0 100644 --- a/common/component_interface_utils/include/component_interface_utils/rclcpp/interface.hpp +++ b/common/autoware_component_interface_utils/include/autoware/component_interface_utils/rclcpp/interface.hpp @@ -23,7 +23,7 @@ #include #include -namespace component_interface_utils +namespace autoware::component_interface_utils { struct NodeInterface @@ -68,6 +68,6 @@ struct NodeInterface std::string node_name; }; -} // namespace component_interface_utils +} // namespace autoware::component_interface_utils #endif // COMPONENT_INTERFACE_UTILS__RCLCPP__INTERFACE_HPP_ diff --git a/common/component_interface_utils/include/component_interface_utils/rclcpp/service_client.hpp b/common/autoware_component_interface_utils/include/autoware/component_interface_utils/rclcpp/service_client.hpp similarity index 93% rename from common/component_interface_utils/include/component_interface_utils/rclcpp/service_client.hpp rename to common/autoware_component_interface_utils/include/autoware/component_interface_utils/rclcpp/service_client.hpp index e9cf68fa098a2..5e8e9e40acfab 100644 --- a/common/component_interface_utils/include/component_interface_utils/rclcpp/service_client.hpp +++ b/common/autoware_component_interface_utils/include/autoware/component_interface_utils/rclcpp/service_client.hpp @@ -15,8 +15,8 @@ #ifndef COMPONENT_INTERFACE_UTILS__RCLCPP__SERVICE_CLIENT_HPP_ #define COMPONENT_INTERFACE_UTILS__RCLCPP__SERVICE_CLIENT_HPP_ -#include -#include +#include +#include #include #include @@ -25,7 +25,7 @@ #include #include -namespace component_interface_utils +namespace autoware::component_interface_utils { /// The wrapper class of rclcpp::Client for logging. @@ -104,6 +104,6 @@ class Client NodeInterface::SharedPtr interface_; }; -} // namespace component_interface_utils +} // namespace autoware::component_interface_utils #endif // COMPONENT_INTERFACE_UTILS__RCLCPP__SERVICE_CLIENT_HPP_ diff --git a/common/component_interface_utils/include/component_interface_utils/rclcpp/service_server.hpp b/common/autoware_component_interface_utils/include/autoware/component_interface_utils/rclcpp/service_server.hpp similarity index 92% rename from common/component_interface_utils/include/component_interface_utils/rclcpp/service_server.hpp rename to common/autoware_component_interface_utils/include/autoware/component_interface_utils/rclcpp/service_server.hpp index 762f95fe8b450..52f6136f9af21 100644 --- a/common/component_interface_utils/include/component_interface_utils/rclcpp/service_server.hpp +++ b/common/autoware_component_interface_utils/include/autoware/component_interface_utils/rclcpp/service_server.hpp @@ -15,15 +15,15 @@ #ifndef COMPONENT_INTERFACE_UTILS__RCLCPP__SERVICE_SERVER_HPP_ #define COMPONENT_INTERFACE_UTILS__RCLCPP__SERVICE_SERVER_HPP_ -#include -#include +#include +#include #include #include #include -namespace component_interface_utils +namespace autoware::component_interface_utils { /// The wrapper class of rclcpp::Service for logging. @@ -94,6 +94,6 @@ class Service NodeInterface::SharedPtr interface_; }; -} // namespace component_interface_utils +} // namespace autoware::component_interface_utils #endif // COMPONENT_INTERFACE_UTILS__RCLCPP__SERVICE_SERVER_HPP_ diff --git a/common/component_interface_utils/include/component_interface_utils/rclcpp/topic_publisher.hpp b/common/autoware_component_interface_utils/include/autoware/component_interface_utils/rclcpp/topic_publisher.hpp similarity index 93% rename from common/component_interface_utils/include/component_interface_utils/rclcpp/topic_publisher.hpp rename to common/autoware_component_interface_utils/include/autoware/component_interface_utils/rclcpp/topic_publisher.hpp index b2c002613a294..dc227ebd41785 100644 --- a/common/component_interface_utils/include/component_interface_utils/rclcpp/topic_publisher.hpp +++ b/common/autoware_component_interface_utils/include/autoware/component_interface_utils/rclcpp/topic_publisher.hpp @@ -17,7 +17,7 @@ #include -namespace component_interface_utils +namespace autoware::component_interface_utils { /// The wrapper class of rclcpp::Publisher. This is for future use and no functionality now. @@ -43,6 +43,6 @@ class Publisher typename WrapType::SharedPtr publisher_; }; -} // namespace component_interface_utils +} // namespace autoware::component_interface_utils #endif // COMPONENT_INTERFACE_UTILS__RCLCPP__TOPIC_PUBLISHER_HPP_ diff --git a/common/component_interface_utils/include/component_interface_utils/rclcpp/topic_subscription.hpp b/common/autoware_component_interface_utils/include/autoware/component_interface_utils/rclcpp/topic_subscription.hpp similarity index 93% rename from common/component_interface_utils/include/component_interface_utils/rclcpp/topic_subscription.hpp rename to common/autoware_component_interface_utils/include/autoware/component_interface_utils/rclcpp/topic_subscription.hpp index 195a04c370964..c7225e23d3c51 100644 --- a/common/component_interface_utils/include/component_interface_utils/rclcpp/topic_subscription.hpp +++ b/common/autoware_component_interface_utils/include/autoware/component_interface_utils/rclcpp/topic_subscription.hpp @@ -17,7 +17,7 @@ #include -namespace component_interface_utils +namespace autoware::component_interface_utils { /// The wrapper class of rclcpp::Subscription. This is for future use and no functionality now. @@ -40,6 +40,6 @@ class Subscription typename WrapType::SharedPtr subscription_; }; -} // namespace component_interface_utils +} // namespace autoware::component_interface_utils #endif // COMPONENT_INTERFACE_UTILS__RCLCPP__TOPIC_SUBSCRIPTION_HPP_ diff --git a/common/component_interface_utils/include/component_interface_utils/specs.hpp b/common/autoware_component_interface_utils/include/autoware/component_interface_utils/specs.hpp similarity index 90% rename from common/component_interface_utils/include/component_interface_utils/specs.hpp rename to common/autoware_component_interface_utils/include/autoware/component_interface_utils/specs.hpp index db3bb9517430f..cbf254453458c 100644 --- a/common/component_interface_utils/include/component_interface_utils/specs.hpp +++ b/common/autoware_component_interface_utils/include/autoware/component_interface_utils/specs.hpp @@ -17,7 +17,7 @@ #include -namespace component_interface_utils +namespace autoware::component_interface_utils { template @@ -29,6 +29,6 @@ rclcpp::QoS get_qos() return qos; } -} // namespace component_interface_utils +} // namespace autoware::component_interface_utils #endif // COMPONENT_INTERFACE_UTILS__SPECS_HPP_ diff --git a/common/component_interface_utils/include/component_interface_utils/status.hpp b/common/autoware_component_interface_utils/include/autoware/component_interface_utils/status.hpp similarity index 89% rename from common/component_interface_utils/include/component_interface_utils/status.hpp rename to common/autoware_component_interface_utils/include/autoware/component_interface_utils/status.hpp index bf4d67ae5c833..e15066b8b1e35 100644 --- a/common/component_interface_utils/include/component_interface_utils/status.hpp +++ b/common/autoware_component_interface_utils/include/autoware/component_interface_utils/status.hpp @@ -15,7 +15,7 @@ #ifndef COMPONENT_INTERFACE_UTILS__STATUS_HPP_ #define COMPONENT_INTERFACE_UTILS__STATUS_HPP_ -namespace component_interface_utils::status +namespace autoware::component_interface_utils::status { template @@ -26,6 +26,6 @@ void copy(const T1 & src, T2 & dst) // NOLINT(build/include_what_you_use): cppl dst->status.message = src->status.message; } -} // namespace component_interface_utils::status +} // namespace autoware::component_interface_utils::status #endif // COMPONENT_INTERFACE_UTILS__STATUS_HPP_ diff --git a/common/component_interface_utils/package.xml b/common/autoware_component_interface_utils/package.xml similarity index 87% rename from common/component_interface_utils/package.xml rename to common/autoware_component_interface_utils/package.xml index 7a6a6d12880ad..f6b3e08b45ce5 100755 --- a/common/component_interface_utils/package.xml +++ b/common/autoware_component_interface_utils/package.xml @@ -1,9 +1,9 @@ - component_interface_utils + autoware_component_interface_utils 0.0.0 - The component_interface_utils package + The autoware_component_interface_utils package Takagi, Isamu Yukihiro Saito Apache License 2.0 diff --git a/common/component_interface_utils/test/test_component_interface_utils.cpp b/common/autoware_component_interface_utils/test/test_component_interface_utils.cpp similarity index 83% rename from common/component_interface_utils/test/test_component_interface_utils.cpp rename to common/autoware_component_interface_utils/test/test_component_interface_utils.cpp index 3c41f4a85b4f9..7cf2dccf3e764 100644 --- a/common/component_interface_utils/test/test_component_interface_utils.cpp +++ b/common/autoware_component_interface_utils/test/test_component_interface_utils.cpp @@ -12,15 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "component_interface_utils/rclcpp/exceptions.hpp" -#include "component_interface_utils/specs.hpp" -#include "component_interface_utils/status.hpp" +#include "autoware/component_interface_utils/rclcpp/exceptions.hpp" +#include "autoware/component_interface_utils/specs.hpp" +#include "autoware/component_interface_utils/status.hpp" #include "gtest/gtest.h" TEST(interface, utils) { { - using component_interface_utils::ServiceException; + using autoware::component_interface_utils::ServiceException; using ResponseStatus = autoware_adapi_v1_msgs::msg::ResponseStatus; using ResponseStatusCode = ResponseStatus::_code_type; @@ -34,7 +34,7 @@ TEST(interface, utils) } { - using component_interface_utils::ServiceException; + using autoware::component_interface_utils::ServiceException; using ResponseStatus = autoware_adapi_v1_msgs::msg::ResponseStatus; using ResponseStatusCode = ResponseStatus::_code_type; @@ -48,10 +48,10 @@ TEST(interface, utils) } { - using component_interface_utils::ServiceException; + using autoware::component_interface_utils::ServiceException; using ResponseStatus = autoware_adapi_v1_msgs::msg::ResponseStatus; using ResponseStatusCode = ResponseStatus::_code_type; - using component_interface_utils::status::copy; + using autoware::component_interface_utils::status::copy; class status_test {