Skip to content

Commit

Permalink
Sanity checking time before performing duration calculation (#735)
Browse files Browse the repository at this point in the history
  • Loading branch information
danthony06 authored Jun 3, 2024
1 parent 31e3525 commit a608051
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion swri_roscpp/include/swri_roscpp/subscriber_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ namespace swri

message_count_++;

if (stamp.nanoseconds() != 0) {
// Check for out of order messages and messages that appear to come from the future
if ((stamp.nanoseconds() != 0) && (now >= stamp)) {
rclcpp::Duration latency = now - stamp;
if (message_count_ == 1) {
min_latency_ = latency;
Expand Down

0 comments on commit a608051

Please sign in to comment.