Skip to content

Commit

Permalink
Fixing possible problem with calculating duration when time is misbeh…
Browse files Browse the repository at this point in the history
…aving (#734)
  • Loading branch information
danthony06 authored Jun 3, 2024
1 parent 3e3e332 commit da7f710
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions swri_roscpp/include/swri_roscpp/subscriber_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,9 @@ class SubscriberImpl
// timeout count.
checkTimeout(now);

// Do not use this message for statistics if it is arriving out of order
if (stamp >= last_header_stamp_) {
// Do not use this message for statistics if it is arriving out of order or time
// synchronization makes it appear that the new timestamp is from the future
if ((stamp >= last_header_stamp_) && (now >= stamp)) {
message_count_++;

if (!stamp.isZero() && !now.isZero()) {
Expand Down

0 comments on commit da7f710

Please sign in to comment.