From 6459f7c6f5da2a005fbc39d8755888ae34dbacd2 Mon Sep 17 00:00:00 2001 From: cyy Date: Fri, 3 Jul 2026 08:21:05 +0000 Subject: [PATCH] Fix: use node clock for cone tick timing (avoid time source mismatch) --- src/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 5aeed60..885696d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -266,9 +266,9 @@ private: } // READY: online cone discovery (3Hz) + optional dynamic obstacles if (has_scan_) { - auto now = rclcpp::Clock().now(); - if (online_cone_enable_ && (now - last_cone_tick_).seconds() > 0.3) { - last_cone_tick_ = now; + auto cone_now = this->now(); + if (online_cone_enable_ && (cone_now - last_cone_tick_).seconds() > 0.3) { + last_cone_tick_ = cone_now; cone_updater_.update(latest_scan_, pose, fence_model_, known_cones_); auto new_cones = cone_updater_.popConfirmed(); for (auto& c : new_cones) {