From a1f606a9a8af31d067c7a88a8728c5c532687566 Mon Sep 17 00:00:00 2001 From: Taekjin LEE Date: Thu, 27 Jun 2024 15:38:28 +0900 Subject: [PATCH] refactor(radar_object_clustering)!: fix namespace and directory structure (#7654) * refactor: refactor radar object clustering node and related files Signed-off-by: Taekjin LEE * refactor: fix the node name Signed-off-by: Taekjin LEE * refactor: move the node header to src Signed-off-by: Taekjin LEE --------- Signed-off-by: Taekjin LEE Signed-off-by: palas21 --- .../radar_object_clustering/CMakeLists.txt | 8 ++++---- .../radar_object_clustering_node.cpp | 19 ++++++++++--------- .../radar_object_clustering_node.hpp | 10 +++++----- 3 files changed, 19 insertions(+), 18 deletions(-) rename perception/radar_object_clustering/src/{radar_object_clustering_node => }/radar_object_clustering_node.cpp (97%) rename perception/radar_object_clustering/{include/radar_object_clustering => src}/radar_object_clustering_node.hpp (87%) diff --git a/perception/radar_object_clustering/CMakeLists.txt b/perception/radar_object_clustering/CMakeLists.txt index ea25353d3e1d7..9a54bbb0dae43 100644 --- a/perception/radar_object_clustering/CMakeLists.txt +++ b/perception/radar_object_clustering/CMakeLists.txt @@ -6,12 +6,12 @@ find_package(autoware_cmake REQUIRED) autoware_package() # Targets -ament_auto_add_library(radar_object_clustering_node_component SHARED - src/radar_object_clustering_node/radar_object_clustering_node.cpp +ament_auto_add_library(${PROJECT_NAME} SHARED + src/radar_object_clustering_node.cpp ) -rclcpp_components_register_node(radar_object_clustering_node_component - PLUGIN "radar_object_clustering::RadarObjectClusteringNode" +rclcpp_components_register_node(${PROJECT_NAME} + PLUGIN "autoware::radar_object_clustering::RadarObjectClusteringNode" EXECUTABLE radar_object_clustering_node ) diff --git a/perception/radar_object_clustering/src/radar_object_clustering_node/radar_object_clustering_node.cpp b/perception/radar_object_clustering/src/radar_object_clustering_node.cpp similarity index 97% rename from perception/radar_object_clustering/src/radar_object_clustering_node/radar_object_clustering_node.cpp rename to perception/radar_object_clustering/src/radar_object_clustering_node.cpp index 339ab21741d29..b867d6a193ed7 100644 --- a/perception/radar_object_clustering/src/radar_object_clustering_node/radar_object_clustering_node.cpp +++ b/perception/radar_object_clustering/src/radar_object_clustering_node.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "radar_object_clustering/radar_object_clustering_node.hpp" +#include "radar_object_clustering_node.hpp" #include "autoware/universe_utils/geometry/geometry.hpp" #include "autoware/universe_utils/math/unit_conversion.hpp" @@ -20,17 +20,18 @@ #include -#include -#include -#include -#include - #ifdef ROS_DISTRO_GALACTIC #include #else #include #endif +#include +#include +#include +#include +#include + namespace { template @@ -58,7 +59,7 @@ double get_distance(const autoware_perception_msgs::msg::DetectedObject & object } // namespace -namespace radar_object_clustering +namespace autoware::radar_object_clustering { using autoware_perception_msgs::msg::DetectedObject; using autoware_perception_msgs::msg::DetectedObjects; @@ -229,7 +230,7 @@ rcl_interfaces::msg::SetParametersResult RadarObjectClusteringNode::onSetParam( result.reason = "success"; return result; } -} // namespace radar_object_clustering +} // namespace autoware::radar_object_clustering #include "rclcpp_components/register_node_macro.hpp" -RCLCPP_COMPONENTS_REGISTER_NODE(radar_object_clustering::RadarObjectClusteringNode) +RCLCPP_COMPONENTS_REGISTER_NODE(autoware::radar_object_clustering::RadarObjectClusteringNode) diff --git a/perception/radar_object_clustering/include/radar_object_clustering/radar_object_clustering_node.hpp b/perception/radar_object_clustering/src/radar_object_clustering_node.hpp similarity index 87% rename from perception/radar_object_clustering/include/radar_object_clustering/radar_object_clustering_node.hpp rename to perception/radar_object_clustering/src/radar_object_clustering_node.hpp index 38a2235a117eb..13284a4151f49 100644 --- a/perception/radar_object_clustering/include/radar_object_clustering/radar_object_clustering_node.hpp +++ b/perception/radar_object_clustering/src/radar_object_clustering_node.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef RADAR_OBJECT_CLUSTERING__RADAR_OBJECT_CLUSTERING_NODE_HPP_ -#define RADAR_OBJECT_CLUSTERING__RADAR_OBJECT_CLUSTERING_NODE_HPP_ +#ifndef RADAR_OBJECT_CLUSTERING_NODE_HPP_ +#define RADAR_OBJECT_CLUSTERING_NODE_HPP_ #include "rclcpp/rclcpp.hpp" @@ -24,7 +24,7 @@ #include #include -namespace radar_object_clustering +namespace autoware::radar_object_clustering { using autoware_perception_msgs::msg::DetectedObject; using autoware_perception_msgs::msg::DetectedObjects; @@ -72,6 +72,6 @@ class RadarObjectClusteringNode : public rclcpp::Node bool isSameObject(const DetectedObject & object_1, const DetectedObject & object_2); }; -} // namespace radar_object_clustering +} // namespace autoware::radar_object_clustering -#endif // RADAR_OBJECT_CLUSTERING__RADAR_OBJECT_CLUSTERING_NODE_HPP_ +#endif // RADAR_OBJECT_CLUSTERING_NODE_HPP_