Skip to content

Commit bdcbdb0

Browse files
committed
mod to componentize and use glog
Signed-off-by: a-maumau <maumaumaumaumaumaumaumaumaumau@gmail.com>
1 parent 673e36d commit bdcbdb0

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

localization/ndt_scan_matcher/CMakeLists.txt

+8-6
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,24 @@ else()
2222
endif()
2323
endif()
2424

25-
find_package(glog REQUIRED)
2625
find_package(PCL REQUIRED COMPONENTS common io registration)
2726
include_directories(${PCL_INCLUDE_DIRS})
2827

29-
ament_auto_add_executable(ndt_scan_matcher
28+
ament_auto_add_library(${PROJECT_NAME} SHARED
3029
src/diagnostics_module.cpp
3130
src/map_update_module.cpp
3231
src/ndt_scan_matcher_core.cpp
33-
src/ndt_scan_matcher_node.cpp
3432
src/particle.cpp
3533
)
3634

3735
link_directories(${PCL_LIBRARY_DIRS})
38-
target_link_libraries(ndt_scan_matcher ${PCL_LIBRARIES} glog::glog)
36+
target_link_libraries(ndt_scan_matcher ${PCL_LIBRARIES})
37+
38+
rclcpp_components_register_node(${PROJECT_NAME}
39+
PLUGIN "NDTScanMatcher"
40+
EXECUTABLE ${PROJECT_NAME}_node
41+
EXECUTOR MultiThreadedExecutor
42+
)
3943

4044
if(BUILD_TESTING)
4145
add_launch_test(
@@ -49,15 +53,13 @@ if(BUILD_TESTING)
4953
src/diagnostics_module.cpp
5054
src/map_update_module.cpp
5155
src/ndt_scan_matcher_core.cpp
52-
# src/ndt_scan_matcher_node.cpp
5356
src/particle.cpp
5457
)
5558
ament_auto_add_gtest(once_initialize_at_out_of_map_then_initialize_correctly
5659
test/test_cases/once_initialize_at_out_of_map_then_initialize_correctly.cpp
5760
src/diagnostics_module.cpp
5861
src/map_update_module.cpp
5962
src/ndt_scan_matcher_core.cpp
60-
# src/ndt_scan_matcher_node.cpp
6163
src/particle.cpp
6264
)
6365
endif()

localization/ndt_scan_matcher/package.xml

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
<depend>ndt_omp</depend>
3030
<depend>pcl_conversions</depend>
3131
<depend>rclcpp</depend>
32+
<depend>rclcpp_components</depend>
3233
<depend>sensor_msgs</depend>
3334
<depend>std_msgs</depend>
3435
<depend>std_srvs</depend>

localization/ndt_scan_matcher/src/ndt_scan_matcher_core.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -1069,3 +1069,6 @@ geometry_msgs::msg::PoseWithCovarianceStamped NDTScanMatcher::align_pose(
10691069

10701070
return result_pose_with_cov_msg;
10711071
}
1072+
1073+
#include <rclcpp_components/register_node_macro.hpp>
1074+
RCLCPP_COMPONENTS_REGISTER_NODE(NDTScanMatcher)

0 commit comments

Comments
 (0)