Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure all swri::Subscriber members are initialized #505

Merged
merged 5 commits into from Dec 18, 2017

Conversation

pjreed
Copy link
Contributor

@pjreed pjreed commented Dec 13, 2017

Some member variables in swri::Subscriber were uninitialized by default; this ensures all of them are initialized.

@pjreed
Copy link
Contributor Author

pjreed commented Dec 13, 2017

As long as I'm in here, looking at subscriber_impl.h:73, it appears that if the stamp in a header is 0, this will very quickly cause an overflow of total_latency_. Maybe processHeader should skip the latency check if the header's stamp isn't set?

@@ -75,7 +75,8 @@ class SubscriberImpl
min_latency_ = latency;
max_latency_ = latency;
total_latency_ = latency;
} else {
}
else {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommend undoing these style changes to remain consistent.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any opinions on how that check should be handled if the header stamp isn't set?

@evenator
Copy link
Contributor

LGTM

@pjreed pjreed merged commit 507fbbb into swri-robotics:master Dec 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants