From 57e3155bc5e2b3fa86d37ec5b19d355de747e364 Mon Sep 17 00:00:00 2001 From: Taekjin LEE Date: Thu, 27 Jun 2024 15:38:44 +0900 Subject: [PATCH] refactor(simple_object_merger)!: fix namespace and directory structure (#7700) * refactor(simple_object_merger): refactor library and node names Refactor the library and node names in the simple_object_merger package to follow the autoware namespace convention. This includes renaming the library from simple_object_merger_node_component to autoware_simple_object_merger and the node from simple_object_merger_node to autoware_simple_object_merger_node. Signed-off-by: Taekjin LEE * refactor: fix the node name Signed-off-by: Taekjin LEE * refactor: rename simple_object_merger library and node to follow autoware namespace convention Signed-off-by: Taekjin LEE * refactor: move node header to src Signed-off-by: Taekjin LEE --------- Signed-off-by: Taekjin LEE --- perception/simple_object_merger/CMakeLists.txt | 8 ++++---- .../simple_object_merger_node.cpp | 8 ++++---- .../simple_object_merger_node.hpp | 10 +++++----- 3 files changed, 13 insertions(+), 13 deletions(-) rename perception/simple_object_merger/src/{simple_object_merger_node => }/simple_object_merger_node.cpp (96%) rename perception/simple_object_merger/{include/simple_object_merger => src}/simple_object_merger_node.hpp (89%) diff --git a/perception/simple_object_merger/CMakeLists.txt b/perception/simple_object_merger/CMakeLists.txt index 10bd0efa7b8fc..1a65bdf96050e 100644 --- a/perception/simple_object_merger/CMakeLists.txt +++ b/perception/simple_object_merger/CMakeLists.txt @@ -6,12 +6,12 @@ find_package(autoware_cmake REQUIRED) autoware_package() # Targets -ament_auto_add_library(simple_object_merger_node_component SHARED - src/simple_object_merger_node/simple_object_merger_node.cpp +ament_auto_add_library(${PROJECT_NAME} SHARED + src/simple_object_merger_node.cpp ) -rclcpp_components_register_node(simple_object_merger_node_component - PLUGIN "simple_object_merger::SimpleObjectMergerNode" +rclcpp_components_register_node(${PROJECT_NAME} + PLUGIN "autoware::simple_object_merger::SimpleObjectMergerNode" EXECUTABLE simple_object_merger_node ) diff --git a/perception/simple_object_merger/src/simple_object_merger_node/simple_object_merger_node.cpp b/perception/simple_object_merger/src/simple_object_merger_node.cpp similarity index 96% rename from perception/simple_object_merger/src/simple_object_merger_node/simple_object_merger_node.cpp rename to perception/simple_object_merger/src/simple_object_merger_node.cpp index faa531560ba09..98c7fd03c1e99 100644 --- a/perception/simple_object_merger/src/simple_object_merger_node/simple_object_merger_node.cpp +++ b/perception/simple_object_merger/src/simple_object_merger_node.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "simple_object_merger/simple_object_merger_node.hpp" +#include "simple_object_merger_node.hpp" #include @@ -65,7 +65,7 @@ autoware_perception_msgs::msg::DetectedObjects::SharedPtr getTransformedObjects( } // namespace -namespace simple_object_merger +namespace autoware::simple_object_merger { using namespace std::literals; using std::chrono::duration; @@ -193,7 +193,7 @@ void SimpleObjectMergerNode::onTimer() pub_objects_->publish(output_objects); } -} // namespace simple_object_merger +} // namespace autoware::simple_object_merger #include "rclcpp_components/register_node_macro.hpp" -RCLCPP_COMPONENTS_REGISTER_NODE(simple_object_merger::SimpleObjectMergerNode) +RCLCPP_COMPONENTS_REGISTER_NODE(autoware::simple_object_merger::SimpleObjectMergerNode) diff --git a/perception/simple_object_merger/include/simple_object_merger/simple_object_merger_node.hpp b/perception/simple_object_merger/src/simple_object_merger_node.hpp similarity index 89% rename from perception/simple_object_merger/include/simple_object_merger/simple_object_merger_node.hpp rename to perception/simple_object_merger/src/simple_object_merger_node.hpp index d25eef20cc676..d5f907ff09ef2 100644 --- a/perception/simple_object_merger/include/simple_object_merger/simple_object_merger_node.hpp +++ b/perception/simple_object_merger/src/simple_object_merger_node.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef SIMPLE_OBJECT_MERGER__SIMPLE_OBJECT_MERGER_NODE_HPP_ -#define SIMPLE_OBJECT_MERGER__SIMPLE_OBJECT_MERGER_NODE_HPP_ +#ifndef SIMPLE_OBJECT_MERGER_NODE_HPP_ +#define SIMPLE_OBJECT_MERGER_NODE_HPP_ #include "autoware/universe_utils/ros/transform_listener.hpp" #include "rclcpp/rclcpp.hpp" @@ -25,7 +25,7 @@ #include #include -namespace simple_object_merger +namespace autoware::simple_object_merger { using autoware_perception_msgs::msg::DetectedObject; using autoware_perception_msgs::msg::DetectedObjects; @@ -76,6 +76,6 @@ class SimpleObjectMergerNode : public rclcpp::Node size_t input_topic_size; }; -} // namespace simple_object_merger +} // namespace autoware::simple_object_merger -#endif // SIMPLE_OBJECT_MERGER__SIMPLE_OBJECT_MERGER_NODE_HPP_ +#endif // SIMPLE_OBJECT_MERGER_NODE_HPP_