From a8ba462c6b72b19df32171c85cdf0ae21651615f Mon Sep 17 00:00:00 2001 From: Taekjin LEE Date: Mon, 24 Jun 2024 16:39:33 +0900 Subject: [PATCH 1/3] refactor: refactor radar object clustering node and related files Signed-off-by: Taekjin LEE --- perception/radar_object_clustering/CMakeLists.txt | 10 +++++----- .../radar_object_clustering_node.hpp | 10 +++++----- .../radar_object_clustering_node.cpp | 8 ++++---- 3 files changed, 14 insertions(+), 14 deletions(-) rename perception/radar_object_clustering/include/{ => autoware}/radar_object_clustering/radar_object_clustering_node.hpp (85%) rename perception/radar_object_clustering/src/{radar_object_clustering_node => }/radar_object_clustering_node.cpp (96%) diff --git a/perception/radar_object_clustering/CMakeLists.txt b/perception/radar_object_clustering/CMakeLists.txt index ea25353d3e1d7..178c2d0669460 100644 --- a/perception/radar_object_clustering/CMakeLists.txt +++ b/perception/radar_object_clustering/CMakeLists.txt @@ -6,13 +6,13 @@ 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" - EXECUTABLE radar_object_clustering_node +rclcpp_components_register_node(${PROJECT_NAME} + PLUGIN "autoware::radar_object_clustering::RadarObjectClusteringNode" + EXECUTABLE ${PROJECT_NAME}_node ) # Tests diff --git a/perception/radar_object_clustering/include/radar_object_clustering/radar_object_clustering_node.hpp b/perception/radar_object_clustering/include/autoware/radar_object_clustering/radar_object_clustering_node.hpp similarity index 85% rename from perception/radar_object_clustering/include/radar_object_clustering/radar_object_clustering_node.hpp rename to perception/radar_object_clustering/include/autoware/radar_object_clustering/radar_object_clustering_node.hpp index 38a2235a117eb..e2564e312cdbc 100644 --- a/perception/radar_object_clustering/include/radar_object_clustering/radar_object_clustering_node.hpp +++ b/perception/radar_object_clustering/include/autoware/radar_object_clustering/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 AUTOWARE__RADAR_OBJECT_CLUSTERING__RADAR_OBJECT_CLUSTERING_NODE_HPP_ +#define AUTOWARE__RADAR_OBJECT_CLUSTERING__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 // AUTOWARE__RADAR_OBJECT_CLUSTERING__RADAR_OBJECT_CLUSTERING_NODE_HPP_ 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 96% 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..c70cb4ae889fe 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 "autoware/radar_object_clustering/radar_object_clustering_node.hpp" #include "autoware/universe_utils/geometry/geometry.hpp" #include "autoware/universe_utils/math/unit_conversion.hpp" @@ -58,7 +58,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 +229,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) From c2f1e2c6ceb778ef9941f94bed6e26697dae7112 Mon Sep 17 00:00:00 2001 From: Taekjin LEE Date: Tue, 25 Jun 2024 13:58:26 +0900 Subject: [PATCH 2/3] refactor: fix the node name Signed-off-by: Taekjin LEE --- perception/radar_object_clustering/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perception/radar_object_clustering/CMakeLists.txt b/perception/radar_object_clustering/CMakeLists.txt index 178c2d0669460..9a54bbb0dae43 100644 --- a/perception/radar_object_clustering/CMakeLists.txt +++ b/perception/radar_object_clustering/CMakeLists.txt @@ -12,7 +12,7 @@ ament_auto_add_library(${PROJECT_NAME} SHARED rclcpp_components_register_node(${PROJECT_NAME} PLUGIN "autoware::radar_object_clustering::RadarObjectClusteringNode" - EXECUTABLE ${PROJECT_NAME}_node + EXECUTABLE radar_object_clustering_node ) # Tests From 4fe6beb05d27ed78297dc1a85abb866e9f9e7357 Mon Sep 17 00:00:00 2001 From: Taekjin LEE Date: Wed, 26 Jun 2024 12:07:51 +0900 Subject: [PATCH 3/3] refactor: move the node header to src Signed-off-by: Taekjin LEE --- .../src/radar_object_clustering_node.cpp | 13 +++++++------ .../radar_object_clustering_node.hpp | 6 +++--- 2 files changed, 10 insertions(+), 9 deletions(-) rename perception/radar_object_clustering/{include/autoware/radar_object_clustering => src}/radar_object_clustering_node.hpp (89%) diff --git a/perception/radar_object_clustering/src/radar_object_clustering_node.cpp b/perception/radar_object_clustering/src/radar_object_clustering_node.cpp index c70cb4ae889fe..b867d6a193ed7 100644 --- a/perception/radar_object_clustering/src/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 "autoware/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 diff --git a/perception/radar_object_clustering/include/autoware/radar_object_clustering/radar_object_clustering_node.hpp b/perception/radar_object_clustering/src/radar_object_clustering_node.hpp similarity index 89% rename from perception/radar_object_clustering/include/autoware/radar_object_clustering/radar_object_clustering_node.hpp rename to perception/radar_object_clustering/src/radar_object_clustering_node.hpp index e2564e312cdbc..13284a4151f49 100644 --- a/perception/radar_object_clustering/include/autoware/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 AUTOWARE__RADAR_OBJECT_CLUSTERING__RADAR_OBJECT_CLUSTERING_NODE_HPP_ -#define AUTOWARE__RADAR_OBJECT_CLUSTERING__RADAR_OBJECT_CLUSTERING_NODE_HPP_ +#ifndef RADAR_OBJECT_CLUSTERING_NODE_HPP_ +#define RADAR_OBJECT_CLUSTERING_NODE_HPP_ #include "rclcpp/rclcpp.hpp" @@ -74,4 +74,4 @@ class RadarObjectClusteringNode : public rclcpp::Node } // namespace autoware::radar_object_clustering -#endif // AUTOWARE__RADAR_OBJECT_CLUSTERING__RADAR_OBJECT_CLUSTERING_NODE_HPP_ +#endif // RADAR_OBJECT_CLUSTERING_NODE_HPP_