From e58fa5b3c8209238f63335c0f9026ab315d4c87a Mon Sep 17 00:00:00 2001 From: kminoda Date: Tue, 9 Apr 2024 09:44:22 +0900 Subject: [PATCH] feat(shape_estimation): add glog Signed-off-by: kminoda --- perception/shape_estimation/CMakeLists.txt | 9 ++++-- perception/shape_estimation/src/main.cpp | 34 ++++++++++++++++++++++ 2 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 perception/shape_estimation/src/main.cpp diff --git a/perception/shape_estimation/CMakeLists.txt b/perception/shape_estimation/CMakeLists.txt index 8eb7a15b5a885..8b51d1cce3587 100644 --- a/perception/shape_estimation/CMakeLists.txt +++ b/perception/shape_estimation/CMakeLists.txt @@ -57,9 +57,12 @@ target_link_libraries(shape_estimation_node shape_estimation_lib ) -rclcpp_components_register_node(shape_estimation_node - PLUGIN "ShapeEstimationNode" - EXECUTABLE shape_estimation +ament_auto_add_executable(${PROJECT_NAME} + src/main.cpp +) + +target_link_libraries(${PROJECT_NAME} + shape_estimation_node glog ) ament_auto_package(INSTALL_TO_SHARE diff --git a/perception/shape_estimation/src/main.cpp b/perception/shape_estimation/src/main.cpp new file mode 100644 index 0000000000000..9479c21144b4b --- /dev/null +++ b/perception/shape_estimation/src/main.cpp @@ -0,0 +1,34 @@ +// Copyright 2024 TIER IV, inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "node.hpp" + +#include + +#include + +int main(int argc, char ** argv) +{ + google::InitGoogleLogging(argv[0]); // NOLINT + google::InstallFailureSignalHandler(); + + rclcpp::init(argc, argv); + rclcpp::NodeOptions options; + auto shape_estimation_node = std::make_shared(options); + rclcpp::executors::SingleThreadedExecutor exec; + exec.add_node(shape_estimation_node); + exec.spin(); + rclcpp::shutdown(); + return 0; +}