From 7f53f06a6f54ef57e1a46b7708bc842e2d8e4dc8 Mon Sep 17 00:00:00 2001 From: Max Schmeller <6088931+mojomex@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:41:26 +0900 Subject: [PATCH] chore(watchdog_timer): add explanatory comment --- nebula_ros/include/nebula_ros/common/watchdog_timer.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nebula_ros/include/nebula_ros/common/watchdog_timer.hpp b/nebula_ros/include/nebula_ros/common/watchdog_timer.hpp index a5b2c2b75..522f9a32d 100644 --- a/nebula_ros/include/nebula_ros/common/watchdog_timer.hpp +++ b/nebula_ros/include/nebula_ros/common/watchdog_timer.hpp @@ -36,6 +36,8 @@ class WatchdogTimer { uint64_t now_ns = node_.get_clock()->now().nanoseconds(); + // As the clock is not steady, the update timestamp can be newer than clock.now(). + // Define that edge-case as not being late too. bool is_late = (last_update_ns_ > now_ns) ? false : (now_ns - last_update_ns_) > expected_update_interval_ns_;