From 0e1d1e566ac0f51cbb9871592bdce1b12cd32329 Mon Sep 17 00:00:00 2001 From: rafal-gorecki Date: Mon, 20 Nov 2023 16:27:43 +0100 Subject: [PATCH] refactor --- healthcheck.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/healthcheck.cpp b/healthcheck.cpp index 78f25c6..1e032e3 100644 --- a/healthcheck.cpp +++ b/healthcheck.cpp @@ -18,7 +18,7 @@ void msg_callback(const nav_msgs::msg::Odometry::SharedPtr msg) { last_msg_time = std::chrono::steady_clock::now(); } -void healthy_check(const rclcpp::Node::SharedPtr &node) { +void healthy_check() { std::chrono::steady_clock::time_point current_time = std::chrono::steady_clock::now(); std::chrono::duration elapsed_time = current_time - last_msg_time; @@ -39,7 +39,7 @@ int main(int argc, char *argv[]) { while (rclcpp::ok()) { rclcpp::spin_some(node); - healthy_check(node); + healthy_check(); std::this_thread::sleep_for(LOOP_PERIOD); }