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

Issues on advertising a service #32

Closed
jeff214103 opened this issue May 21, 2021 · 1 comment
Closed

Issues on advertising a service #32

jeff214103 opened this issue May 21, 2021 · 1 comment

Comments

@jeff214103
Copy link

jeff214103 commented May 21, 2021

Hi, I am facing an issue in advertising a service as server.

Once I advertise a service (node.advertiseService), it works pretty well. Some time later I shutdown and disconnect (service.shutdown(), service.disconnect()) the service, in rosnode info can be cleaned. However, once I would like to reconnect or re advertise the service by the same code (node.advertiseService), the service no longer be found in rosnode info. Although I can simply disconnect to ROS without running service.shutdown() nor service.disconnect(), but later the connection cannot be even established.

As I am using flutter, once I hot reload the app and do advertiseService, without re run the roscore, the service can be back.

I am not sure if it is an issue related to #18 , but I would appreciate if the fix can be made.

Edit: service will become null in second time connection. And the following message displayed. And later, shutdown cannot be called as the service variable become null
Screenshot from 2021-05-21 12-40-16

@TimWhiting
Copy link
Collaborator

TimWhiting commented May 22, 2021

If you are calling shutdown and disconnect manually, you should instead be calling node.unadvertiseService(service), because there is some state internal to the node that keeps track of the services. I'm not sure that will resolve all the issues you mention, but let me know what problems still exist after that. I probably should make .shutdown and .disconnect private methods to avoid confusion.

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

2 participants