From 853770130b083a6221fbcddf2f9e2714168792fc Mon Sep 17 00:00:00 2001 From: Taekjin LEE Date: Thu, 27 Jun 2024 15:57:31 +0900 Subject: [PATCH] refactor(object_range_splitter)!: fix namespace and directory structure (#7644) * refactor: refactor object_range_splitter library and node Signed-off-by: Taekjin LEE * refactor: refactor object_range_splitter library and node Signed-off-by: Taekjin LEE * refactor: fix the node name Signed-off-by: Taekjin LEE * refactor: rename include path Signed-off-by: Taekjin LEE * refactor: remove unused dependency on sensor_msgs Signed-off-by: Taekjin LEE * refactor: move header file to src Signed-off-by: Taekjin LEE --------- Signed-off-by: Taekjin LEE --- perception/object_range_splitter/CMakeLists.txt | 8 ++++---- perception/object_range_splitter/package.xml | 1 - .../src/{node.cpp => object_range_splitter_node.cpp} | 8 ++++---- .../node.hpp => src/object_range_splitter_node.hpp} | 12 ++++++------ 4 files changed, 14 insertions(+), 15 deletions(-) rename perception/object_range_splitter/src/{node.cpp => object_range_splitter_node.cpp} (91%) rename perception/object_range_splitter/{include/object_range_splitter/node.hpp => src/object_range_splitter_node.hpp} (81%) diff --git a/perception/object_range_splitter/CMakeLists.txt b/perception/object_range_splitter/CMakeLists.txt index 92c6c0668a085..1da71a31b26d0 100644 --- a/perception/object_range_splitter/CMakeLists.txt +++ b/perception/object_range_splitter/CMakeLists.txt @@ -4,12 +4,12 @@ project(object_range_splitter) find_package(autoware_cmake REQUIRED) autoware_package() -ament_auto_add_library(object_range_splitter SHARED - src/node.cpp +ament_auto_add_library(${PROJECT_NAME} SHARED + src/object_range_splitter_node.cpp ) -rclcpp_components_register_node(object_range_splitter - PLUGIN "object_range_splitter::ObjectRangeSplitterNode" +rclcpp_components_register_node(${PROJECT_NAME} + PLUGIN "autoware::object_range_splitter::ObjectRangeSplitterNode" EXECUTABLE object_range_splitter_node ) diff --git a/perception/object_range_splitter/package.xml b/perception/object_range_splitter/package.xml index bef3ea76354d1..7fc9245ee894f 100644 --- a/perception/object_range_splitter/package.xml +++ b/perception/object_range_splitter/package.xml @@ -14,7 +14,6 @@ autoware_perception_msgs rclcpp rclcpp_components - sensor_msgs ament_lint_auto autoware_lint_common diff --git a/perception/object_range_splitter/src/node.cpp b/perception/object_range_splitter/src/object_range_splitter_node.cpp similarity index 91% rename from perception/object_range_splitter/src/node.cpp rename to perception/object_range_splitter/src/object_range_splitter_node.cpp index 978c40275fb9b..5d5a4aad70011 100644 --- a/perception/object_range_splitter/src/node.cpp +++ b/perception/object_range_splitter/src/object_range_splitter_node.cpp @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "object_range_splitter/node.hpp" +#include "object_range_splitter_node.hpp" -namespace object_range_splitter +namespace autoware::object_range_splitter { ObjectRangeSplitterNode::ObjectRangeSplitterNode(const rclcpp::NodeOptions & node_options) : Node("object_range_splitter_node", node_options) @@ -59,7 +59,7 @@ void ObjectRangeSplitterNode::objectCallback( long_range_object_pub_->publish(output_long_range_object_msg); short_range_object_pub_->publish(output_short_range_object_msg); } -} // namespace object_range_splitter +} // namespace autoware::object_range_splitter #include -RCLCPP_COMPONENTS_REGISTER_NODE(object_range_splitter::ObjectRangeSplitterNode) +RCLCPP_COMPONENTS_REGISTER_NODE(autoware::object_range_splitter::ObjectRangeSplitterNode) diff --git a/perception/object_range_splitter/include/object_range_splitter/node.hpp b/perception/object_range_splitter/src/object_range_splitter_node.hpp similarity index 81% rename from perception/object_range_splitter/include/object_range_splitter/node.hpp rename to perception/object_range_splitter/src/object_range_splitter_node.hpp index a4dbb2fb634aa..19e5924272eb9 100644 --- a/perception/object_range_splitter/include/object_range_splitter/node.hpp +++ b/perception/object_range_splitter/src/object_range_splitter_node.hpp @@ -12,16 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef OBJECT_RANGE_SPLITTER__NODE_HPP_ -#define OBJECT_RANGE_SPLITTER__NODE_HPP_ +#ifndef OBJECT_RANGE_SPLITTER_NODE_HPP_ +#define OBJECT_RANGE_SPLITTER_NODE_HPP_ #include -#include +#include "autoware_perception_msgs/msg/detected_objects.hpp" #include -namespace object_range_splitter +namespace autoware::object_range_splitter { class ObjectRangeSplitterNode : public rclcpp::Node { @@ -42,6 +42,6 @@ class ObjectRangeSplitterNode : public rclcpp::Node float spilt_range_; }; -} // namespace object_range_splitter +} // namespace autoware::object_range_splitter -#endif // OBJECT_RANGE_SPLITTER__NODE_HPP_ +#endif // OBJECT_RANGE_SPLITTER_NODE_HPP_