-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add maximum publication rate parameter #5
Conversation
This will expose an interface by which we can limit the rate of published images and reduce the load on the PC running this package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly just some testing edge case questions. If this all works then I think it's fine for our purposes in the near future! Someday we should refactor the publisher and spin functions, but can handle that down the road.
src/vision.cpp
Outdated
} | ||
else | ||
{ | ||
RCLCPP_WARN(node_->get_logger(), "Should have successfully set max_pub_rate: '%f'", max_pub_rate_hz_); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RCLCPP_WARN(node_->get_logger(), "Should have successfully set max_pub_rate: '%f'", max_pub_rate_hz_); | |
RCLCPP_WARN(node_->get_logger(), "Using max_pub_rate: '%f'", max_pub_rate_hz_); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, good catch. Had this in here for debugging
@@ -549,6 +563,7 @@ void Vision::run() | |||
} | |||
} | |||
rclcpp::spin_some(node_); | |||
max_pub_rate_->sleep(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is anything being caught in the sink or is it always pulling the latest image? ie, if you set the rate to something very very slow is it up to date our do we see lag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it pulls the latest image. I set the rate to 0.5 and I still see recent data
f736d80
to
e66ca77
Compare
This will expose an interface by which we can limit the rate of published images and reduce the load on the PC running this package.