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

Assume publisher qos depth of 1 if the middleware reports the qos history as unknown #239

Merged
merged 4 commits into from Jul 5, 2023

Conversation

achim-k
Copy link
Collaborator

@achim-k achim-k commented Jun 30, 2023

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

…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
@achim-k achim-k changed the title Achim/fg 4047 unknown qos depth fix Assume publisher qos depth of 1 if the middleware reports the qos history as unknown Jun 30, 2023
@achim-k achim-k requested a review from jtbandes June 30, 2023 17:02
// 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>>();
Copy link
Member

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?

Copy link
Collaborator Author

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

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.

Copy link
Collaborator Author

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

@achim-k achim-k merged commit 6660b0d into main Jul 5, 2023
8 checks passed
@achim-k achim-k deleted the achim/fg-4047-unknown-qos-depth-fix branch July 5, 2023 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

ROS2 static transforms partially propagating through the web bridge to studio
2 participants