From f7960413477569c48e6e50d1ffd34d59865b323f Mon Sep 17 00:00:00 2001 From: Taekjin LEE Date: Wed, 3 Jul 2024 18:07:27 +0900 Subject: [PATCH] refactor(ground_segmentation)!: fix namespace and directory structure (#7744) * refactor: update namespace in ground_segmentation files Signed-off-by: Taekjin LEE * refactor: update namespace in ground_segmentation files Signed-off-by: Taekjin LEE * refactor: update ground_segmentation namespace and file structure Signed-off-by: Taekjin LEE * style(pre-commit): autofix * refactor: update ground_segmentation plugin names scheme Signed-off-by: Taekjin LEE * refactor: update ransac tester Signed-off-by: Taekjin LEE --------- Signed-off-by: Taekjin LEE Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .../ground_segmentation.launch.py | 18 ++++++++++-- perception/ground_segmentation/CMakeLists.txt | 28 +++++++++---------- .../config/ground_segmentation.param.yaml | 2 +- .../launch/scan_ground_filter.launch.py | 2 +- .../node.cpp} | 28 +++++++++---------- .../ransac_ground_filter/node.hpp} | 10 +++---- .../ray_ground_filter}/gencolors.hpp | 13 ++++----- .../node.cpp} | 13 +++++---- .../ray_ground_filter/node.hpp} | 25 ++++++++--------- .../node.cpp} | 18 ++++++------ .../scan_ground_filter/node.hpp} | 13 ++++----- .../test/test_ransac_ground_filter.cpp | 4 +-- .../test/test_ray_ground_filter.cpp | 5 ++-- .../test/test_scan_ground_filter.cpp | 8 +++--- 14 files changed, 98 insertions(+), 89 deletions(-) rename perception/ground_segmentation/src/{ransac_ground_filter_nodelet.cpp => ransac_ground_filter/node.cpp} (97%) rename perception/ground_segmentation/{include/ground_segmentation/ransac_ground_filter_nodelet.hpp => src/ransac_ground_filter/node.hpp} (94%) rename perception/ground_segmentation/{include/ground_segmentation => src/ray_ground_filter}/gencolors.hpp (96%) rename perception/ground_segmentation/src/{ray_ground_filter_nodelet.cpp => ray_ground_filter/node.cpp} (97%) rename perception/ground_segmentation/{include/ground_segmentation/ray_ground_filter_nodelet.hpp => src/ray_ground_filter/node.hpp} (95%) rename perception/ground_segmentation/src/{scan_ground_filter_nodelet.cpp => scan_ground_filter/node.cpp} (98%) rename perception/ground_segmentation/{include/ground_segmentation/scan_ground_filter_nodelet.hpp => src/scan_ground_filter/node.hpp} (97%) diff --git a/launch/tier4_perception_launch/launch/obstacle_segmentation/ground_segmentation/ground_segmentation.launch.py b/launch/tier4_perception_launch/launch/obstacle_segmentation/ground_segmentation/ground_segmentation.launch.py index 25fb1e6ac6c4d..684ecee757aad 100644 --- a/launch/tier4_perception_launch/launch/obstacle_segmentation/ground_segmentation/ground_segmentation.launch.py +++ b/launch/tier4_perception_launch/launch/obstacle_segmentation/ground_segmentation/ground_segmentation.launch.py @@ -82,6 +82,12 @@ def create_additional_pipeline(self, lidar_name): "margin_min_z" ] ) + # Get the plugin name from the full plugin path + ground_segmentation_plugin_name = self.ground_segmentation_param[ + f"{lidar_name}_ground_filter" + ]["plugin"] + ground_segmentation_plugin_name = ground_segmentation_plugin_name.split("::")[-1] + components = [] components.append( ComposableNode( @@ -110,7 +116,7 @@ def create_additional_pipeline(self, lidar_name): components.append( ComposableNode( package="ground_segmentation", - plugin=self.ground_segmentation_param[f"{lidar_name}_ground_filter"]["plugin"], + plugin="autoware::ground_segmentation::" + ground_segmentation_plugin_name, name=f"{lidar_name}_ground_filter", remappings=[ ("input", f"{lidar_name}/range_cropped/pointcloud"), @@ -203,7 +209,7 @@ def create_ransac_pipeline(self): components.append( ComposableNode( package="ground_segmentation", - plugin="ground_segmentation::RANSACGroundFilterComponent", + plugin="autoware::ground_segmentation::" + "RANSACGroundFilterComponent", name="ransac_ground_filter", namespace="plane_fitting", remappings=[ @@ -228,6 +234,12 @@ def create_common_pipeline(self, input_topic, output_topic): self.vehicle_info["min_height_offset"] + self.ground_segmentation_param["common_crop_box_filter"]["parameters"]["margin_min_z"] ) + # Get the plugin name from the full plugin path + ground_segmentation_plugin_name = self.ground_segmentation_param["common_ground_filter"][ + "plugin" + ] + ground_segmentation_plugin_name = ground_segmentation_plugin_name.split("::")[-1] + components = [] components.append( ComposableNode( @@ -256,7 +268,7 @@ def create_common_pipeline(self, input_topic, output_topic): components.append( ComposableNode( package="ground_segmentation", - plugin=self.ground_segmentation_param["common_ground_filter"]["plugin"], + plugin="autoware::ground_segmentation::" + ground_segmentation_plugin_name, name="common_ground_filter", remappings=[ ("input", "range_cropped/pointcloud"), diff --git a/perception/ground_segmentation/CMakeLists.txt b/perception/ground_segmentation/CMakeLists.txt index 9531437e80752..f8e4f50a553a2 100644 --- a/perception/ground_segmentation/CMakeLists.txt +++ b/perception/ground_segmentation/CMakeLists.txt @@ -21,20 +21,20 @@ include_directories( ${GRID_MAP_INCLUDE_DIR} ) -ament_auto_add_library(ground_segmentation SHARED - src/ray_ground_filter_nodelet.cpp - src/ransac_ground_filter_nodelet.cpp - src/scan_ground_filter_nodelet.cpp +ament_auto_add_library(${PROJECT_NAME} SHARED + src/ray_ground_filter/node.cpp + src/ransac_ground_filter/node.cpp + src/scan_ground_filter/node.cpp ) -target_link_libraries(ground_segmentation +target_link_libraries(${PROJECT_NAME} ${Boost_LIBRARIES} ${OpenCV_LIBRARIES} ${PCL_LIBRARIES} ) if(OPENMP_FOUND) - set_target_properties(ground_segmentation PROPERTIES + set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS ${OpenMP_CXX_FLAGS} LINK_FLAGS ${OpenMP_CXX_FLAGS} ) @@ -42,18 +42,18 @@ endif() # ========== Ground Filter ========== # -- Ray Ground Filter -- -rclcpp_components_register_node(ground_segmentation - PLUGIN "ground_segmentation::RayGroundFilterComponent" +rclcpp_components_register_node(${PROJECT_NAME} + PLUGIN "autoware::ground_segmentation::RayGroundFilterComponent" EXECUTABLE ray_ground_filter_node) # -- RANSAC Ground Filter -- -rclcpp_components_register_node(ground_segmentation - PLUGIN "ground_segmentation::RANSACGroundFilterComponent" +rclcpp_components_register_node(${PROJECT_NAME} + PLUGIN "autoware::ground_segmentation::RANSACGroundFilterComponent" EXECUTABLE ransac_ground_filter_node) # -- Scan Ground Filter -- -rclcpp_components_register_node(ground_segmentation - PLUGIN "ground_segmentation::ScanGroundFilterComponent" +rclcpp_components_register_node(${PROJECT_NAME} + PLUGIN "autoware::ground_segmentation::ScanGroundFilterComponent" EXECUTABLE scan_ground_filter_node) @@ -88,7 +88,7 @@ if(BUILD_TESTING) ) target_link_libraries(test_ray_ground_filter - ground_segmentation + ${PROJECT_NAME} ${YAML_CPP_LIBRARIES} ) @@ -97,7 +97,7 @@ if(BUILD_TESTING) ) target_link_libraries(test_scan_ground_filter - ground_segmentation + ${PROJECT_NAME} ${YAML_CPP_LIBRARIES} ) ament_add_ros_isolated_gtest(test_ransac_ground_filter diff --git a/perception/ground_segmentation/config/ground_segmentation.param.yaml b/perception/ground_segmentation/config/ground_segmentation.param.yaml index 594ef1fe974b2..ca077941f0185 100644 --- a/perception/ground_segmentation/config/ground_segmentation.param.yaml +++ b/perception/ground_segmentation/config/ground_segmentation.param.yaml @@ -16,7 +16,7 @@ negative: False common_ground_filter: - plugin: "ground_segmentation::ScanGroundFilterComponent" + plugin: "autoware::ground_segmentation::ScanGroundFilterComponent" parameters: global_slope_max_angle_deg: 10.0 local_slope_max_angle_deg: 13.0 # recommended 30.0 for non elevation_grid_mode diff --git a/perception/ground_segmentation/launch/scan_ground_filter.launch.py b/perception/ground_segmentation/launch/scan_ground_filter.launch.py index df8290997315e..990fcace3449a 100644 --- a/perception/ground_segmentation/launch/scan_ground_filter.launch.py +++ b/perception/ground_segmentation/launch/scan_ground_filter.launch.py @@ -36,7 +36,7 @@ def launch_setup(context, *args, **kwargs): nodes = [ ComposableNode( package="ground_segmentation", - plugin="ground_segmentation::ScanGroundFilterComponent", + plugin="autoware::ground_segmentation::ScanGroundFilterComponent", name="scan_ground_filter", remappings=[ ("input", LaunchConfiguration("input/pointcloud")), diff --git a/perception/ground_segmentation/src/ransac_ground_filter_nodelet.cpp b/perception/ground_segmentation/src/ransac_ground_filter/node.cpp similarity index 97% rename from perception/ground_segmentation/src/ransac_ground_filter_nodelet.cpp rename to perception/ground_segmentation/src/ransac_ground_filter/node.cpp index aa224e7adc5bf..25e29c5b9f21a 100644 --- a/perception/ground_segmentation/src/ransac_ground_filter_nodelet.cpp +++ b/perception/ground_segmentation/src/ransac_ground_filter/node.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "ground_segmentation/ransac_ground_filter_nodelet.hpp" +#include "node.hpp" #include @@ -54,15 +54,6 @@ Eigen::Vector3d getArbitraryOrthogonalVector(const Eigen::Vector3d & input) return unit_vec; } -ground_segmentation::PlaneBasis getPlaneBasis(const Eigen::Vector3d & plane_normal) -{ - ground_segmentation::PlaneBasis basis; - basis.e_z = plane_normal; - basis.e_x = getArbitraryOrthogonalVector(plane_normal); - basis.e_y = basis.e_x.cross(basis.e_z); - return basis; -} - geometry_msgs::msg::Pose getDebugPose(const Eigen::Affine3d & plane_affine) { geometry_msgs::msg::Pose debug_pose; @@ -78,8 +69,17 @@ geometry_msgs::msg::Pose getDebugPose(const Eigen::Affine3d & plane_affine) } } // namespace -namespace ground_segmentation +namespace autoware::ground_segmentation { +PlaneBasis getPlaneBasis(const Eigen::Vector3d & plane_normal) +{ + PlaneBasis basis; + basis.e_z = plane_normal; + basis.e_x = getArbitraryOrthogonalVector(plane_normal); + basis.e_y = basis.e_x.cross(basis.e_z); + return basis; +} + using pointcloud_preprocessor::get_param; RANSACGroundFilterComponent::RANSACGroundFilterComponent(const rclcpp::NodeOptions & options) @@ -203,7 +203,7 @@ Eigen::Affine3d RANSACGroundFilterComponent::getPlaneAffine( pcl::PointXYZ centroid_point; centroid.get(centroid_point); Eigen::Translation trans(centroid_point.x, centroid_point.y, centroid_point.z); - const ground_segmentation::PlaneBasis basis = getPlaneBasis(plane_normal); + const PlaneBasis basis = getPlaneBasis(plane_normal); Eigen::Matrix3d rot; rot << basis.e_x.x(), basis.e_y.x(), basis.e_z.x(), basis.e_x.y(), basis.e_y.y(), basis.e_z.y(), basis.e_x.z(), basis.e_y.z(), basis.e_z.z(); @@ -396,7 +396,7 @@ rcl_interfaces::msg::SetParametersResult RANSACGroundFilterComponent::paramCallb return result; } -} // namespace ground_segmentation +} // namespace autoware::ground_segmentation #include -RCLCPP_COMPONENTS_REGISTER_NODE(ground_segmentation::RANSACGroundFilterComponent) +RCLCPP_COMPONENTS_REGISTER_NODE(autoware::ground_segmentation::RANSACGroundFilterComponent) diff --git a/perception/ground_segmentation/include/ground_segmentation/ransac_ground_filter_nodelet.hpp b/perception/ground_segmentation/src/ransac_ground_filter/node.hpp similarity index 94% rename from perception/ground_segmentation/include/ground_segmentation/ransac_ground_filter_nodelet.hpp rename to perception/ground_segmentation/src/ransac_ground_filter/node.hpp index f2fc47a50ff62..ebdd28f26ebe8 100644 --- a/perception/ground_segmentation/include/ground_segmentation/ransac_ground_filter_nodelet.hpp +++ b/perception/ground_segmentation/src/ransac_ground_filter/node.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef GROUND_SEGMENTATION__RANSAC_GROUND_FILTER_NODELET_HPP_ -#define GROUND_SEGMENTATION__RANSAC_GROUND_FILTER_NODELET_HPP_ +#ifndef RANSAC_GROUND_FILTER__NODE_HPP_ +#define RANSAC_GROUND_FILTER__NODE_HPP_ #include "pointcloud_preprocessor/filter.hpp" @@ -38,7 +38,7 @@ #include #include -namespace ground_segmentation +namespace autoware::ground_segmentation { struct PlaneBasis { @@ -129,6 +129,6 @@ class RANSACGroundFilterComponent : public pointcloud_preprocessor::Filter EIGEN_MAKE_ALIGNED_OPERATOR_NEW explicit RANSACGroundFilterComponent(const rclcpp::NodeOptions & options); }; -} // namespace ground_segmentation +} // namespace autoware::ground_segmentation -#endif // GROUND_SEGMENTATION__RANSAC_GROUND_FILTER_NODELET_HPP_ +#endif // RANSAC_GROUND_FILTER__NODE_HPP_ diff --git a/perception/ground_segmentation/include/ground_segmentation/gencolors.hpp b/perception/ground_segmentation/src/ray_ground_filter/gencolors.hpp similarity index 96% rename from perception/ground_segmentation/include/ground_segmentation/gencolors.hpp rename to perception/ground_segmentation/src/ray_ground_filter/gencolors.hpp index 07637b1514b09..658e5718a01cc 100644 --- a/perception/ground_segmentation/include/ground_segmentation/gencolors.hpp +++ b/perception/ground_segmentation/src/ray_ground_filter/gencolors.hpp @@ -53,19 +53,18 @@ // //M*/ -#ifndef GROUND_SEGMENTATION__GENCOLORS_HPP_ -#define GROUND_SEGMENTATION__GENCOLORS_HPP_ +#ifndef RAY_GROUND_FILTER__GENCOLORS_HPP_ +#define RAY_GROUND_FILTER__GENCOLORS_HPP_ #include +#include #include #include #include -// #include -#include -namespace ray_ground_filter +namespace autoware::ray_ground_filter { using namespace cv; // NOLINT @@ -159,5 +158,5 @@ inline void generateColors(std::vector & colors, size_t count, size_t fa colors[i] = Scalar(c.x, c.y, c.z); } } -} // namespace ray_ground_filter -#endif // GROUND_SEGMENTATION__GENCOLORS_HPP_ +} // namespace autoware::ray_ground_filter +#endif // RAY_GROUND_FILTER__GENCOLORS_HPP_ diff --git a/perception/ground_segmentation/src/ray_ground_filter_nodelet.cpp b/perception/ground_segmentation/src/ray_ground_filter/node.cpp similarity index 97% rename from perception/ground_segmentation/src/ray_ground_filter_nodelet.cpp rename to perception/ground_segmentation/src/ray_ground_filter/node.cpp index c58f1c0e507e5..c75972d3c4f14 100644 --- a/perception/ground_segmentation/src/ray_ground_filter_nodelet.cpp +++ b/perception/ground_segmentation/src/ray_ground_filter/node.cpp @@ -29,12 +29,12 @@ * v1.0: amc-nu (abrahammonrroy@yahoo.com) */ -#include "ground_segmentation/ray_ground_filter_nodelet.hpp" +#include "node.hpp" #include #include -namespace ground_segmentation +namespace autoware::ground_segmentation { using pointcloud_preprocessor::get_param; @@ -250,8 +250,9 @@ void RayGroundFilterComponent::ClassifyPointCloud( // // Enable the dynamic reconfigure service // has_service = true; // srv_ = boost::make_shared< -// dynamic_reconfigure::Server >(nh); -// dynamic_reconfigure::Server::CallbackType f = +// dynamic_reconfigure::Server >(nh); +// dynamic_reconfigure::Server::CallbackType +// f = // boost::bind(&RayGroundFilterComponent::config_callback, this, _1, _2); // srv_->setCallback(f); // return (true); @@ -394,7 +395,7 @@ rcl_interfaces::msg::SetParametersResult RayGroundFilterComponent::paramCallback return result; } -} // namespace ground_segmentation +} // namespace autoware::ground_segmentation #include -RCLCPP_COMPONENTS_REGISTER_NODE(ground_segmentation::RayGroundFilterComponent) +RCLCPP_COMPONENTS_REGISTER_NODE(autoware::ground_segmentation::RayGroundFilterComponent) diff --git a/perception/ground_segmentation/include/ground_segmentation/ray_ground_filter_nodelet.hpp b/perception/ground_segmentation/src/ray_ground_filter/node.hpp similarity index 95% rename from perception/ground_segmentation/include/ground_segmentation/ray_ground_filter_nodelet.hpp rename to perception/ground_segmentation/src/ray_ground_filter/node.hpp index 6e2638e8566d8..8bb17cdaf8a09 100644 --- a/perception/ground_segmentation/include/ground_segmentation/ray_ground_filter_nodelet.hpp +++ b/perception/ground_segmentation/src/ray_ground_filter/node.hpp @@ -42,8 +42,8 @@ * v1.0: amc-nu (abrahammonrroy@yahoo.com) */ -#ifndef GROUND_SEGMENTATION__RAY_GROUND_FILTER_NODELET_HPP_ -#define GROUND_SEGMENTATION__RAY_GROUND_FILTER_NODELET_HPP_ +#ifndef RAY_GROUND_FILTER__NODE_HPP_ +#define RAY_GROUND_FILTER__NODE_HPP_ #include @@ -58,14 +58,7 @@ #include #endif -#include - -#include -#include -#include -// #include - -#include "ground_segmentation/gencolors.hpp" +#include "gencolors.hpp" #include "pointcloud_preprocessor/filter.hpp" #include @@ -76,11 +69,17 @@ #include #include +#include + +#include +#include +#include + namespace bg = boost::geometry; using Point = bg::model::d2::point_xy; using Polygon = bg::model::polygon; -namespace ground_segmentation +namespace autoware::ground_segmentation { class RayGroundFilterComponent : public pointcloud_preprocessor::Filter { @@ -206,6 +205,6 @@ class RayGroundFilterComponent : public pointcloud_preprocessor::Filter EIGEN_MAKE_ALIGNED_OPERATOR_NEW explicit RayGroundFilterComponent(const rclcpp::NodeOptions & options); }; -} // namespace ground_segmentation +} // namespace autoware::ground_segmentation -#endif // GROUND_SEGMENTATION__RAY_GROUND_FILTER_NODELET_HPP_ +#endif // RAY_GROUND_FILTER__NODE_HPP_ diff --git a/perception/ground_segmentation/src/scan_ground_filter_nodelet.cpp b/perception/ground_segmentation/src/scan_ground_filter/node.cpp similarity index 98% rename from perception/ground_segmentation/src/scan_ground_filter_nodelet.cpp rename to perception/ground_segmentation/src/scan_ground_filter/node.cpp index 7853aa400b6a5..26db036f79bbe 100644 --- a/perception/ground_segmentation/src/scan_ground_filter_nodelet.cpp +++ b/perception/ground_segmentation/src/scan_ground_filter/node.cpp @@ -12,18 +12,18 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "ground_segmentation/scan_ground_filter_nodelet.hpp" +#include "node.hpp" -#include -#include -#include -#include +#include "autoware/universe_utils/geometry/geometry.hpp" +#include "autoware/universe_utils/math/normalization.hpp" +#include "autoware/universe_utils/math/unit_conversion.hpp" +#include "autoware_vehicle_info_utils/vehicle_info_utils.hpp" #include #include #include -namespace ground_segmentation +namespace autoware::ground_segmentation { using autoware::universe_utils::calcDistance3d; using autoware::universe_utils::deg2rad; @@ -33,7 +33,7 @@ using autoware::vehicle_info_utils::VehicleInfoUtils; using pointcloud_preprocessor::get_param; ScanGroundFilterComponent::ScanGroundFilterComponent(const rclcpp::NodeOptions & options) -: Filter("ScanGroundFilter", options) +: pointcloud_preprocessor::Filter("ScanGroundFilter", options) { // set initial parameters { @@ -715,7 +715,7 @@ rcl_interfaces::msg::SetParametersResult ScanGroundFilterComponent::onParameter( return result; } -} // namespace ground_segmentation +} // namespace autoware::ground_segmentation #include -RCLCPP_COMPONENTS_REGISTER_NODE(ground_segmentation::ScanGroundFilterComponent) +RCLCPP_COMPONENTS_REGISTER_NODE(autoware::ground_segmentation::ScanGroundFilterComponent) diff --git a/perception/ground_segmentation/include/ground_segmentation/scan_ground_filter_nodelet.hpp b/perception/ground_segmentation/src/scan_ground_filter/node.hpp similarity index 97% rename from perception/ground_segmentation/include/ground_segmentation/scan_ground_filter_nodelet.hpp rename to perception/ground_segmentation/src/scan_ground_filter/node.hpp index 3ae41173a7a7d..0e6ed598053ba 100644 --- a/perception/ground_segmentation/include/ground_segmentation/scan_ground_filter_nodelet.hpp +++ b/perception/ground_segmentation/src/scan_ground_filter/node.hpp @@ -12,14 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef GROUND_SEGMENTATION__SCAN_GROUND_FILTER_NODELET_HPP_ -#define GROUND_SEGMENTATION__SCAN_GROUND_FILTER_NODELET_HPP_ +#ifndef SCAN_GROUND_FILTER__NODE_HPP_ +#define SCAN_GROUND_FILTER__NODE_HPP_ +#include "autoware_vehicle_info_utils/vehicle_info.hpp" #include "pointcloud_preprocessor/filter.hpp" #include "pointcloud_preprocessor/transform_info.hpp" -#include - #include #include @@ -41,7 +40,7 @@ class ScanGroundFilterTest; -namespace ground_segmentation +namespace autoware::ground_segmentation { using autoware::vehicle_info_utils::VehicleInfo; @@ -291,6 +290,6 @@ class ScanGroundFilterComponent : public pointcloud_preprocessor::Filter // for test friend ScanGroundFilterTest; }; -} // namespace ground_segmentation +} // namespace autoware::ground_segmentation -#endif // GROUND_SEGMENTATION__SCAN_GROUND_FILTER_NODELET_HPP_ +#endif // SCAN_GROUND_FILTER__NODE_HPP_ diff --git a/perception/ground_segmentation/test/test_ransac_ground_filter.cpp b/perception/ground_segmentation/test/test_ransac_ground_filter.cpp index 79e28b6b1ccd8..fb66ba9e05b6d 100644 --- a/perception/ground_segmentation/test/test_ransac_ground_filter.cpp +++ b/perception/ground_segmentation/test/test_ransac_ground_filter.cpp @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "../src/ransac_ground_filter/node.hpp" #include "ament_index_cpp/get_package_share_directory.hpp" #include "tf2_ros/transform_broadcaster.h" #include -#include #include "geometry_msgs/msg/transform_stamped.hpp" #include @@ -68,7 +68,7 @@ class RansacGroundFilterTestSuite : public ::testing::Test void TearDown() { (void)rclcpp::shutdown(); } }; -class RansacGroundFilterTest : public ground_segmentation::RANSACGroundFilterComponent +class RansacGroundFilterTest : public autoware::ground_segmentation::RANSACGroundFilterComponent { public: explicit RansacGroundFilterTest(const rclcpp::NodeOptions & options) diff --git a/perception/ground_segmentation/test/test_ray_ground_filter.cpp b/perception/ground_segmentation/test/test_ray_ground_filter.cpp index 68dddf0c68bc7..4233b8bb18ebe 100644 --- a/perception/ground_segmentation/test/test_ray_ground_filter.cpp +++ b/perception/ground_segmentation/test/test_ray_ground_filter.cpp @@ -12,11 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "../src/ray_ground_filter/node.hpp" #include "ament_index_cpp/get_package_share_directory.hpp" #include "tf2_ros/transform_broadcaster.h" -#include - #include "geometry_msgs/msg/transform_stamped.hpp" #include @@ -37,7 +36,7 @@ class RayGroundFilterComponentTestSuite : public ::testing::Test void TearDown() { (void)rclcpp::shutdown(); } }; // sanity_check -class RayGroundFilterComponentTest : public ground_segmentation::RayGroundFilterComponent +class RayGroundFilterComponentTest : public autoware::ground_segmentation::RayGroundFilterComponent { public: explicit RayGroundFilterComponentTest(const rclcpp::NodeOptions & options) diff --git a/perception/ground_segmentation/test/test_scan_ground_filter.cpp b/perception/ground_segmentation/test/test_scan_ground_filter.cpp index af97f7e0112fd..f5faecd59d6d3 100644 --- a/perception/ground_segmentation/test/test_scan_ground_filter.cpp +++ b/perception/ground_segmentation/test/test_scan_ground_filter.cpp @@ -12,11 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "../src/scan_ground_filter/node.hpp" #include "ament_index_cpp/get_package_share_directory.hpp" #include "tf2_ros/transform_broadcaster.h" -#include - #include #include @@ -126,7 +125,8 @@ class ScanGroundFilterTest : public ::testing::Test options.parameter_overrides(parameters); - scan_ground_filter_ = std::make_shared(options); + scan_ground_filter_ = + std::make_shared(options); // read pcd to pointcloud sensor_msgs::msg::PointCloud2::SharedPtr origin_input_msg_ptr = @@ -161,7 +161,7 @@ class ScanGroundFilterTest : public ::testing::Test ~ScanGroundFilterTest() override { rclcpp::shutdown(); } public: - std::shared_ptr scan_ground_filter_; + std::shared_ptr scan_ground_filter_; rclcpp::Node::SharedPtr dummy_node_; rclcpp::Publisher::SharedPtr input_pointcloud_pub_; rclcpp::Publisher::SharedPtr output_pointcloud_pub_;