Skip to content

Commit

Permalink
chore(watchdog_timer): add explanatory comment
Browse files Browse the repository at this point in the history
  • Loading branch information
mojomex committed Jun 6, 2024
1 parent ae0e291 commit 7f53f06
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions nebula_ros/include/nebula_ros/common/watchdog_timer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_;
Expand Down

0 comments on commit 7f53f06

Please sign in to comment.