From de87e569fd0efeb2ad92ef5703b90655f4ada5ca Mon Sep 17 00:00:00 2001 From: Taekjin LEE Date: Mon, 24 Jun 2024 15:40:41 +0900 Subject: [PATCH 1/4] feat: Refactor radar_crossing_objects_noise_filter node Signed-off-by: Taekjin LEE --- .../CMakeLists.txt | 16 ++++++++-------- .../node.hpp} | 10 +++++----- ...ng_objects_noise_filter_node.cpp => node.cpp} | 8 ++++---- ...st_radar_crossing_objects_filter_is_noise.cpp | 12 ++++++------ 4 files changed, 23 insertions(+), 23 deletions(-) rename perception/radar_crossing_objects_noise_filter/include/{radar_crossing_objects_noise_filter/radar_crossing_objects_noise_filter_node.hpp => autoware/radar_crossing_objects_noise_filter/node.hpp} (82%) rename perception/radar_crossing_objects_noise_filter/src/{radar_crossing_objects_noise_filter_node/radar_crossing_objects_noise_filter_node.cpp => node.cpp} (94%) diff --git a/perception/radar_crossing_objects_noise_filter/CMakeLists.txt b/perception/radar_crossing_objects_noise_filter/CMakeLists.txt index bf4a46cda7ae6..f36844ffbcd8a 100644 --- a/perception/radar_crossing_objects_noise_filter/CMakeLists.txt +++ b/perception/radar_crossing_objects_noise_filter/CMakeLists.txt @@ -6,13 +6,13 @@ find_package(autoware_cmake REQUIRED) autoware_package() # Targets -ament_auto_add_library(radar_crossing_objects_noise_filter_node_component SHARED - src/radar_crossing_objects_noise_filter_node/radar_crossing_objects_noise_filter_node.cpp +ament_auto_add_library(${PROJECT_NAME}_node_component SHARED + src/node.cpp ) -rclcpp_components_register_node(radar_crossing_objects_noise_filter_node_component - PLUGIN "radar_crossing_objects_noise_filter::RadarCrossingObjectsNoiseFilterNode" - EXECUTABLE radar_crossing_objects_noise_filter_node +rclcpp_components_register_node(${PROJECT_NAME}_node_component + PLUGIN "autoware::radar_crossing_objects_noise_filter::RadarCrossingObjectsNoiseFilterNode" + EXECUTABLE ${PROJECT_NAME}_node ) # Tests @@ -23,10 +23,10 @@ if(BUILD_TESTING) ament_lint_auto_find_test_dependencies() file(GLOB_RECURSE test_files test/**/*.cpp) - ament_add_ros_isolated_gtest(radar_crossing_objects_noise_filter ${test_files}) + ament_add_ros_isolated_gtest(${PROJECT_NAME} ${test_files}) - target_link_libraries(radar_crossing_objects_noise_filter - radar_crossing_objects_noise_filter_node_component + target_link_libraries(${PROJECT_NAME} + ${PROJECT_NAME}_node_component ) endif() diff --git a/perception/radar_crossing_objects_noise_filter/include/radar_crossing_objects_noise_filter/radar_crossing_objects_noise_filter_node.hpp b/perception/radar_crossing_objects_noise_filter/include/autoware/radar_crossing_objects_noise_filter/node.hpp similarity index 82% rename from perception/radar_crossing_objects_noise_filter/include/radar_crossing_objects_noise_filter/radar_crossing_objects_noise_filter_node.hpp rename to perception/radar_crossing_objects_noise_filter/include/autoware/radar_crossing_objects_noise_filter/node.hpp index fbd64c884d396..6ba697e2b72a3 100644 --- a/perception/radar_crossing_objects_noise_filter/include/radar_crossing_objects_noise_filter/radar_crossing_objects_noise_filter_node.hpp +++ b/perception/radar_crossing_objects_noise_filter/include/autoware/radar_crossing_objects_noise_filter/node.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef RADAR_CROSSING_OBJECTS_NOISE_FILTER__RADAR_CROSSING_OBJECTS_NOISE_FILTER_NODE_HPP_ -#define RADAR_CROSSING_OBJECTS_NOISE_FILTER__RADAR_CROSSING_OBJECTS_NOISE_FILTER_NODE_HPP_ +#ifndef AUTOWARE__RADAR_CROSSING_OBJECTS_NOISE_FILTER__NODE_HPP_ +#define AUTOWARE__RADAR_CROSSING_OBJECTS_NOISE_FILTER__NODE_HPP_ #include "rclcpp/rclcpp.hpp" @@ -23,7 +23,7 @@ #include #include -namespace radar_crossing_objects_noise_filter +namespace autoware::radar_crossing_objects_noise_filter { using autoware_perception_msgs::msg::DetectedObject; using autoware_perception_msgs::msg::DetectedObjects; @@ -63,6 +63,6 @@ class RadarCrossingObjectsNoiseFilterNode : public rclcpp::Node bool isNoise(const DetectedObject & object); }; -} // namespace radar_crossing_objects_noise_filter +} // namespace autoware::radar_crossing_objects_noise_filter -#endif // RADAR_CROSSING_OBJECTS_NOISE_FILTER__RADAR_CROSSING_OBJECTS_NOISE_FILTER_NODE_HPP_ +#endif // AUTOWARE__RADAR_CROSSING_OBJECTS_NOISE_FILTER__NODE_HPP_ diff --git a/perception/radar_crossing_objects_noise_filter/src/radar_crossing_objects_noise_filter_node/radar_crossing_objects_noise_filter_node.cpp b/perception/radar_crossing_objects_noise_filter/src/node.cpp similarity index 94% rename from perception/radar_crossing_objects_noise_filter/src/radar_crossing_objects_noise_filter_node/radar_crossing_objects_noise_filter_node.cpp rename to perception/radar_crossing_objects_noise_filter/src/node.cpp index 2f5884c04ce37..1a0285f09b355 100644 --- a/perception/radar_crossing_objects_noise_filter/src/radar_crossing_objects_noise_filter_node/radar_crossing_objects_noise_filter_node.cpp +++ b/perception/radar_crossing_objects_noise_filter/src/node.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "radar_crossing_objects_noise_filter/radar_crossing_objects_noise_filter_node.hpp" +#include "autoware/radar_crossing_objects_noise_filter/node.hpp" #include "autoware/universe_utils/geometry/geometry.hpp" #include "autoware/universe_utils/math/normalization.hpp" @@ -50,7 +50,7 @@ bool update_param( } } // namespace -namespace radar_crossing_objects_noise_filter +namespace autoware::radar_crossing_objects_noise_filter { using autoware_perception_msgs::msg::DetectedObject; using autoware_perception_msgs::msg::DetectedObjects; @@ -142,8 +142,8 @@ bool RadarCrossingObjectsNoiseFilterNode::isNoise(const DetectedObject & object) } } -} // namespace radar_crossing_objects_noise_filter +} // namespace autoware::radar_crossing_objects_noise_filter #include "rclcpp_components/register_node_macro.hpp" RCLCPP_COMPONENTS_REGISTER_NODE( - radar_crossing_objects_noise_filter::RadarCrossingObjectsNoiseFilterNode) + autoware::radar_crossing_objects_noise_filter::RadarCrossingObjectsNoiseFilterNode) diff --git a/perception/radar_crossing_objects_noise_filter/test/test_radar_crossing_objects_noise_filter/test_radar_crossing_objects_filter_is_noise.cpp b/perception/radar_crossing_objects_noise_filter/test/test_radar_crossing_objects_noise_filter/test_radar_crossing_objects_filter_is_noise.cpp index 44ccaae8ee7fc..e16a8fdab5565 100644 --- a/perception/radar_crossing_objects_noise_filter/test/test_radar_crossing_objects_noise_filter/test_radar_crossing_objects_filter_is_noise.cpp +++ b/perception/radar_crossing_objects_noise_filter/test/test_radar_crossing_objects_noise_filter/test_radar_crossing_objects_filter_is_noise.cpp @@ -12,24 +12,24 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "autoware/radar_crossing_objects_noise_filter/node.hpp" #include "autoware/universe_utils/geometry/geometry.hpp" #include "autoware/universe_utils/math/unit_conversion.hpp" -#include "radar_crossing_objects_noise_filter/radar_crossing_objects_noise_filter_node.hpp" #include #include -std::shared_ptr get_node( - double angle_threshold, double velocity_threshold) +std::shared_ptr +get_node(double angle_threshold, double velocity_threshold) { rclcpp::NodeOptions node_options; node_options.parameter_overrides( {{"angle_threshold", angle_threshold}, {"velocity_threshold", velocity_threshold}}); - auto node = - std::make_shared( - node_options); + auto node = std::make_shared< + autoware::radar_crossing_objects_noise_filter::RadarCrossingObjectsNoiseFilterNode>( + node_options); return node; } From 6b483cde1be7778848e793d4edd49332019c742c Mon Sep 17 00:00:00 2001 From: Taekjin LEE Date: Tue, 25 Jun 2024 13:57:27 +0900 Subject: [PATCH 2/4] refactor: fix the node name Signed-off-by: Taekjin LEE --- perception/radar_crossing_objects_noise_filter/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perception/radar_crossing_objects_noise_filter/CMakeLists.txt b/perception/radar_crossing_objects_noise_filter/CMakeLists.txt index f36844ffbcd8a..0528df07a2fd9 100644 --- a/perception/radar_crossing_objects_noise_filter/CMakeLists.txt +++ b/perception/radar_crossing_objects_noise_filter/CMakeLists.txt @@ -12,7 +12,7 @@ ament_auto_add_library(${PROJECT_NAME}_node_component SHARED rclcpp_components_register_node(${PROJECT_NAME}_node_component PLUGIN "autoware::radar_crossing_objects_noise_filter::RadarCrossingObjectsNoiseFilterNode" - EXECUTABLE ${PROJECT_NAME}_node + EXECUTABLE radar_crossing_objects_noise_filter_node ) # Tests From 2f973801b232555c04544873a1b6b3ad78da9b37 Mon Sep 17 00:00:00 2001 From: Taekjin LEE Date: Wed, 26 Jun 2024 13:52:59 +0900 Subject: [PATCH 3/4] refactor: move header file to src Signed-off-by: Taekjin LEE --- .../radar_crossing_objects_noise_filter/CMakeLists.txt | 4 ++-- ...ode.cpp => radar_crossing_objects_noise_filter_node.cpp} | 2 +- .../radar_crossing_objects_noise_filter_node.hpp} | 6 +++--- .../test_radar_crossing_objects_filter_is_noise.cpp | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) rename perception/radar_crossing_objects_noise_filter/src/{node.cpp => radar_crossing_objects_noise_filter_node.cpp} (98%) rename perception/radar_crossing_objects_noise_filter/{include/autoware/radar_crossing_objects_noise_filter/node.hpp => src/radar_crossing_objects_noise_filter_node.hpp} (90%) diff --git a/perception/radar_crossing_objects_noise_filter/CMakeLists.txt b/perception/radar_crossing_objects_noise_filter/CMakeLists.txt index 0528df07a2fd9..6414739413d5c 100644 --- a/perception/radar_crossing_objects_noise_filter/CMakeLists.txt +++ b/perception/radar_crossing_objects_noise_filter/CMakeLists.txt @@ -7,7 +7,7 @@ autoware_package() # Targets ament_auto_add_library(${PROJECT_NAME}_node_component SHARED - src/node.cpp + src/radar_crossing_objects_noise_filter_node.cpp ) rclcpp_components_register_node(${PROJECT_NAME}_node_component @@ -26,7 +26,7 @@ if(BUILD_TESTING) ament_add_ros_isolated_gtest(${PROJECT_NAME} ${test_files}) target_link_libraries(${PROJECT_NAME} - ${PROJECT_NAME}_node_component + ${PROJECT_NAME}_node_component ) endif() diff --git a/perception/radar_crossing_objects_noise_filter/src/node.cpp b/perception/radar_crossing_objects_noise_filter/src/radar_crossing_objects_noise_filter_node.cpp similarity index 98% rename from perception/radar_crossing_objects_noise_filter/src/node.cpp rename to perception/radar_crossing_objects_noise_filter/src/radar_crossing_objects_noise_filter_node.cpp index 1a0285f09b355..13231b83bf27b 100644 --- a/perception/radar_crossing_objects_noise_filter/src/node.cpp +++ b/perception/radar_crossing_objects_noise_filter/src/radar_crossing_objects_noise_filter_node.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "autoware/radar_crossing_objects_noise_filter/node.hpp" +#include "radar_crossing_objects_noise_filter_node.hpp" #include "autoware/universe_utils/geometry/geometry.hpp" #include "autoware/universe_utils/math/normalization.hpp" diff --git a/perception/radar_crossing_objects_noise_filter/include/autoware/radar_crossing_objects_noise_filter/node.hpp b/perception/radar_crossing_objects_noise_filter/src/radar_crossing_objects_noise_filter_node.hpp similarity index 90% rename from perception/radar_crossing_objects_noise_filter/include/autoware/radar_crossing_objects_noise_filter/node.hpp rename to perception/radar_crossing_objects_noise_filter/src/radar_crossing_objects_noise_filter_node.hpp index 6ba697e2b72a3..6e389f563a138 100644 --- a/perception/radar_crossing_objects_noise_filter/include/autoware/radar_crossing_objects_noise_filter/node.hpp +++ b/perception/radar_crossing_objects_noise_filter/src/radar_crossing_objects_noise_filter_node.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef AUTOWARE__RADAR_CROSSING_OBJECTS_NOISE_FILTER__NODE_HPP_ -#define AUTOWARE__RADAR_CROSSING_OBJECTS_NOISE_FILTER__NODE_HPP_ +#ifndef RADAR_CROSSING_OBJECTS_NOISE_FILTER_NODE_HPP_ +#define RADAR_CROSSING_OBJECTS_NOISE_FILTER_NODE_HPP_ #include "rclcpp/rclcpp.hpp" @@ -65,4 +65,4 @@ class RadarCrossingObjectsNoiseFilterNode : public rclcpp::Node } // namespace autoware::radar_crossing_objects_noise_filter -#endif // AUTOWARE__RADAR_CROSSING_OBJECTS_NOISE_FILTER__NODE_HPP_ +#endif // RADAR_CROSSING_OBJECTS_NOISE_FILTER_NODE_HPP_ diff --git a/perception/radar_crossing_objects_noise_filter/test/test_radar_crossing_objects_noise_filter/test_radar_crossing_objects_filter_is_noise.cpp b/perception/radar_crossing_objects_noise_filter/test/test_radar_crossing_objects_noise_filter/test_radar_crossing_objects_filter_is_noise.cpp index e16a8fdab5565..93475af7b3628 100644 --- a/perception/radar_crossing_objects_noise_filter/test/test_radar_crossing_objects_noise_filter/test_radar_crossing_objects_filter_is_noise.cpp +++ b/perception/radar_crossing_objects_noise_filter/test/test_radar_crossing_objects_noise_filter/test_radar_crossing_objects_filter_is_noise.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "autoware/radar_crossing_objects_noise_filter/node.hpp" +#include "../../src/radar_crossing_objects_noise_filter_node.hpp" #include "autoware/universe_utils/geometry/geometry.hpp" #include "autoware/universe_utils/math/unit_conversion.hpp" From dad4dfcf67a4981f91aebc9748b6cdd1f1deceed Mon Sep 17 00:00:00 2001 From: Taekjin LEE Date: Wed, 26 Jun 2024 13:55:23 +0900 Subject: [PATCH 4/4] refactor: remove unused dependency Signed-off-by: Taekjin LEE --- perception/radar_crossing_objects_noise_filter/package.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/perception/radar_crossing_objects_noise_filter/package.xml b/perception/radar_crossing_objects_noise_filter/package.xml index 0db40b24e809c..d0245dfe62a40 100644 --- a/perception/radar_crossing_objects_noise_filter/package.xml +++ b/perception/radar_crossing_objects_noise_filter/package.xml @@ -16,7 +16,6 @@ autoware_perception_msgs autoware_universe_utils - geometry_msgs rclcpp rclcpp_components tf2