Description
Offer the ability to subscribe to a topic until some some conditions are met
One concrete example is that we want to subscribe to the pose topic until x > 0
.
The idea is similar to std::condition_variable
's wait_until
function, where we can pass a predicate (function callback for evaluating conditions) to the function, and returns true when the requirements are met
Implementation suggestion
a) Extend SubscribeOptions
to pass a predicate for evaluation conditions. Given that Node::Subscribe
is non-blocking, we probably still want one final message callback to indicate that the conditions are met.
b) Alternatively, we could have a new blocking WaitUntil(topic, timeout, predicate)
API function for this purpose.
Something to be careful of is that once the condition is met, the node would need to Unsubscribe
to the topic. In this case, we should not stop subscription / remove other message handlers.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status