From 04d8aa8af2be064dae0e51dc3ad63b45a65ccf9a Mon Sep 17 00:00:00 2001 From: Tomohito ANDO Date: Fri, 24 Nov 2023 20:14:29 +0900 Subject: [PATCH] feat(ndt_scan_matcher): use glog (#5465) (#1031) * feat(ndt_scan_matcher): use glog * style(pre-commit): autofix * update * style(pre-commit): autofix --------- Signed-off-by: kminoda Co-authored-by: kminoda <44218668+kminoda@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- localization/ndt_scan_matcher/CMakeLists.txt | 3 ++- localization/ndt_scan_matcher/package.xml | 1 + localization/ndt_scan_matcher/src/ndt_scan_matcher_node.cpp | 5 +++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/localization/ndt_scan_matcher/CMakeLists.txt b/localization/ndt_scan_matcher/CMakeLists.txt index 1d5a9d5ac5320..88223793d5584 100644 --- a/localization/ndt_scan_matcher/CMakeLists.txt +++ b/localization/ndt_scan_matcher/CMakeLists.txt @@ -22,6 +22,7 @@ else() endif() endif() +find_package(glog REQUIRED) find_package(PCL REQUIRED COMPONENTS common io registration) include_directories(${PCL_INCLUDE_DIRS}) @@ -37,7 +38,7 @@ ament_auto_add_executable(ndt_scan_matcher ) link_directories(${PCL_LIBRARY_DIRS}) -target_link_libraries(ndt_scan_matcher ${PCL_LIBRARIES}) +target_link_libraries(ndt_scan_matcher ${PCL_LIBRARIES} glog::glog) ament_auto_package( INSTALL_TO_SHARE diff --git a/localization/ndt_scan_matcher/package.xml b/localization/ndt_scan_matcher/package.xml index 92c690a708492..d5ee50b58f5e2 100644 --- a/localization/ndt_scan_matcher/package.xml +++ b/localization/ndt_scan_matcher/package.xml @@ -18,6 +18,7 @@ diagnostic_msgs fmt geometry_msgs + libgoogle-glog-dev libpcl-all-dev nav_msgs ndt_omp diff --git a/localization/ndt_scan_matcher/src/ndt_scan_matcher_node.cpp b/localization/ndt_scan_matcher/src/ndt_scan_matcher_node.cpp index be6b398d7738e..d5ea544d3c5e5 100644 --- a/localization/ndt_scan_matcher/src/ndt_scan_matcher_node.cpp +++ b/localization/ndt_scan_matcher/src/ndt_scan_matcher_node.cpp @@ -16,8 +16,13 @@ #include +#include + int main(int argc, char ** argv) { + google::InitGoogleLogging(argv[0]); + google::InstallFailureSignalHandler(); + rclcpp::init(argc, argv); auto ndt_scan_matcher = std::make_shared(); rclcpp::executors::MultiThreadedExecutor exec;