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
Assume publisher qos depth of 1 if the middleware reports the qos history as unknown #239
Conversation
…epth Some RMWs do not retrieve history information of the publisher endpoint in which case the history depth is 0. We use a lower limit of 1 here, so that the history depth is at least equal to the number of publishers. This covers the case where there are multiple transient_local publishers with a depth of 1 (e.g. multiple tf_static transform broadcasters). See also #238 and #208
// Set up text message handler to resolve the promise when the topic is advertised | ||
foxglove::Client<websocketpp::config::asio_client> wsClient; | ||
auto wsClient = std::make_shared<foxglove::Client<websocketpp::config::asio_client>>(); |
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.
Why does this need to be a shared_ptr? Would unique_ptr work? I don't see the ownership being actually shared anywhere?
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.
You are right, will see what I can do. Can just pass a raw pointer to waitForChannel
then
@@ -118,6 +112,30 @@ std::future<Service> waitForService(std::shared_ptr<ClientInterface> client, | |||
return future; | |||
} | |||
|
|||
std::future<Channel> waitForChannel(std::shared_ptr<ClientInterface> client, | |||
const std::string& topicName) { | |||
auto promise = std::make_shared<std::promise<Channel>>(); |
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.
Why shared_ptr? The std::promise example code seems to allocate a promise on the stack and still move it into a thread or lambda.
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.
I remember that John and I had some issues with that but don't remember exactly why. Will see what I can do once I created a new release
Public-Facing Changes
Assume publisher qos depth of 1 if the middleware reports the qos history as unknown
Description
Some RMWs do not report history information of a publisher endpoint in which case the history depth is reported as 0. We internally use this depth to calculate an appropriate depth for the subscription, which uses the
KeepLast(depth)
history policy.In case a publisher's history depth is reported as 0, we assume a depth of 1 so that the final history depth is at least equal to the number of publishers. This covers the case where there are multiple transient_local publishers with a depth of 1 (e.g. multiple tf_static transform broadcasters). Before this PR, a user would have to manually specify a
min_qos_depth
of N when having N tf_static broadcasters.This PR also increases the max qos depth default value, 10 seemed very low. I'm not sure anymore why we added an upper limit in the first place. Additionally, a warning is logged when the upper limit is reached.
Fixes #238
See also #208