Skip to content

Creating subscriber after spin doesn't work #475

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

Open
George-Gi opened this issue May 8, 2025 · 4 comments
Open

Creating subscriber after spin doesn't work #475

George-Gi opened this issue May 8, 2025 · 4 comments

Comments

@George-Gi
Copy link

George-Gi commented May 8, 2025

If I haven't created any subscribers before spin and after spin I create a subscriber, triggered by a callback, the subscriber doesn't work, i.e. the subscriber callback is never executed.
If I create a random subscriber before spin and then create the desired subscriber after spin, the callback of the desired subscriber works. I googled a bit around and I found this issue for ROS2, but it looked quite old and probably has been fixed.
Any ideas on that?

@jhdcs
Copy link
Collaborator

jhdcs commented May 8, 2025

May I ask why you're creating a subscriber after spinning the node? This feels like an unusual design pattern to me - usually your node has all desired/needed subscribers/publishers/clients/services already created before spinning.

@George-Gi
Copy link
Author

May I ask why you're creating a subscriber after spinning the node? This feels like an unusual design pattern to me - usually your node has all desired/needed subscribers/publishers/clients/services already created before spinning.

We have a certain infrastructure so that the topics for some subscribers are set on the fly with a service

@mxgrey
Copy link
Collaborator

mxgrey commented May 8, 2025

Creating subscribers on the fly will work after #446 is merged, but that's currently blocked on #430 getting approved.

@jhdcs I think this capability will be extremely important for lifecycle node use-cases.

@jhdcs
Copy link
Collaborator

jhdcs commented May 8, 2025

Creating subscribers on the fly will work after #446 is merged, but that's currently blocked on #430 getting approved.

I knew I was forgetting about something. My apologies. Review has been submitted.

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

3 participants