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

Add maximum publication rate parameter #5

Merged
merged 2 commits into from
Dec 13, 2023

Conversation

dyackzan
Copy link
Collaborator

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.

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.
@dyackzan dyackzan requested a review from eholum December 13, 2023 00:06
Copy link

@eholum eholum left a 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_);
Copy link

Choose a reason for hiding this comment

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

Suggested change
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_);

Copy link
Collaborator Author

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();
Copy link

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?

Copy link
Collaborator Author

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

@dyackzan dyackzan force-pushed the add-max-publication-rate-params branch from f736d80 to e66ca77 Compare December 13, 2023 19:23
@dyackzan dyackzan requested a review from eholum December 13, 2023 19:23
@dyackzan dyackzan merged commit 2d9d086 into ros2 Dec 13, 2023
@delete-merged-branch delete-merged-branch bot deleted the add-max-publication-rate-params branch December 13, 2023 19:41
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.

2 participants