Skip to content

Commit

Permalink
chore(multi_object_tracker): change node and glog implementation (aut…
Browse files Browse the repository at this point in the history
…owarefoundation#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>
  • Loading branch information
3 people authored Apr 10, 2024
1 parent 2b48d25 commit 81c432e
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 8 deletions.
10 changes: 6 additions & 4 deletions perception/multi_object_tracker/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,14 @@ ament_auto_add_library(multi_object_tracker_node SHARED

target_link_libraries(multi_object_tracker_node
Eigen3::Eigen
glog::glog
)

rclcpp_components_register_node(multi_object_tracker_node
PLUGIN "MultiObjectTracker"
EXECUTABLE multi_object_tracker
ament_auto_add_executable(${PROJECT_NAME}
src/multi_object_tracker_node.cpp
)

target_link_libraries(${PROJECT_NAME}
multi_object_tracker_node glog
)

ament_auto_package(INSTALL_TO_SHARE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@ MultiObjectTracker::MultiObjectTracker(const rclcpp::NodeOptions & node_options)
tf_buffer_(this->get_clock()),
tf_listener_(tf_buffer_)
{
// glog for debug
google::InitGoogleLogging("multi_object_tracker");
google::InstallFailureSignalHandler();

// Create publishers and subscribers
detected_object_sub_ = create_subscription<autoware_auto_perception_msgs::msg::DetectedObjects>(
"input", rclcpp::QoS{1},
Expand Down
34 changes: 34 additions & 0 deletions perception/multi_object_tracker/src/multi_object_tracker_node.cpp
Original file line number Diff line number Diff line change
@@ -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 "multi_object_tracker/multi_object_tracker_core.hpp"

#include <rclcpp/rclcpp.hpp>

#include <glog/logging.h>

int main(int argc, char ** argv)
{
google::InitGoogleLogging(argv[0]); // NOLINT
google::InstallFailureSignalHandler();

rclcpp::init(argc, argv);
rclcpp::NodeOptions options;
auto multi_object_tracker = std::make_shared<MultiObjectTracker>(options);
rclcpp::executors::SingleThreadedExecutor exec;
exec.add_node(multi_object_tracker);
exec.spin();
rclcpp::shutdown();
return 0;
}

0 comments on commit 81c432e

Please sign in to comment.