Skip to content

Commit 81c432e

Browse files
technolojinpre-commit-ci[bot]kminoda
authored
chore(multi_object_tracker): change node and glog implementation (#6780)
* chore: change node and glog impl Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp> * style(pre-commit): autofix --------- Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: kminoda <44218668+kminoda@users.noreply.github.com>
1 parent 2b48d25 commit 81c432e

File tree

3 files changed

+40
-8
lines changed

3 files changed

+40
-8
lines changed

perception/multi_object_tracker/CMakeLists.txt

+6-4
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,14 @@ ament_auto_add_library(multi_object_tracker_node SHARED
4747

4848
target_link_libraries(multi_object_tracker_node
4949
Eigen3::Eigen
50-
glog::glog
5150
)
5251

53-
rclcpp_components_register_node(multi_object_tracker_node
54-
PLUGIN "MultiObjectTracker"
55-
EXECUTABLE multi_object_tracker
52+
ament_auto_add_executable(${PROJECT_NAME}
53+
src/multi_object_tracker_node.cpp
54+
)
55+
56+
target_link_libraries(${PROJECT_NAME}
57+
multi_object_tracker_node glog
5658
)
5759

5860
ament_auto_package(INSTALL_TO_SHARE

perception/multi_object_tracker/src/multi_object_tracker_core.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,6 @@ MultiObjectTracker::MultiObjectTracker(const rclcpp::NodeOptions & node_options)
7272
tf_buffer_(this->get_clock()),
7373
tf_listener_(tf_buffer_)
7474
{
75-
// glog for debug
76-
google::InitGoogleLogging("multi_object_tracker");
77-
google::InstallFailureSignalHandler();
78-
7975
// Create publishers and subscribers
8076
detected_object_sub_ = create_subscription<autoware_auto_perception_msgs::msg::DetectedObjects>(
8177
"input", rclcpp::QoS{1},
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Copyright 2024 TIER IV, inc.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
#include "multi_object_tracker/multi_object_tracker_core.hpp"
16+
17+
#include <rclcpp/rclcpp.hpp>
18+
19+
#include <glog/logging.h>
20+
21+
int main(int argc, char ** argv)
22+
{
23+
google::InitGoogleLogging(argv[0]); // NOLINT
24+
google::InstallFailureSignalHandler();
25+
26+
rclcpp::init(argc, argv);
27+
rclcpp::NodeOptions options;
28+
auto multi_object_tracker = std::make_shared<MultiObjectTracker>(options);
29+
rclcpp::executors::SingleThreadedExecutor exec;
30+
exec.add_node(multi_object_tracker);
31+
exec.spin();
32+
rclcpp::shutdown();
33+
return 0;
34+
}

0 commit comments

Comments
 (0)