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 callbacks to InputPort #872

Open
stewpend0us opened this issue Sep 23, 2024 · 0 comments
Open

Add callbacks to InputPort #872

stewpend0us opened this issue Sep 23, 2024 · 0 comments

Comments

@stewpend0us
Copy link

Is your feature request related to a problem? Please describe.
As far as I know: right now the only way to know that one of the nodes inputs has changed is to "poll" it by repeatedly calling "getInput". The easiest time to poll it is during a tick(). It would be nice to be able to respond to an input changing without needing to wait for tick() to be called.

Describe the solution you'd like
It would be great to be able to pass a callback into the "InputPort" call within "providedPorts". I guess the issue here would be that this is a "static" method? We'd probably want instance methods to be passed in.

Describe alternatives you've considered
I could probably achieve this by polling of the blackboard from another thread?

Additional context
My BT::Node is listening for ROS subscriptions. If the topic I'm listening to were changed dynamically I'll need to re-create my subscriber. If I have to wait until a tick() occurs then it's already too late and I'll have to either return FAILURE or RUNNING. From a timing perspective there's no reason I couldn't have a message ready and waiting by the time tick() is called.

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

No branches or pull requests

1 participant