How to add a service in a node?
I have checked a node I am using for my application and what I found out is that there's only publishers and subscribers for this node. I would be doing a record and play function for bag files and I think using a service would be most beneficial. I was just wondering how to add a service in a selected node. Right now, there is no services on the node when I checked rosnode info /node_name.
Any help would be appreciated.
Asked by ros.beginner on 2019-10-11 03:07:17 UTC
Comments
You can refer to tutorial on how to make a service.
Asked by Choco93 on 2019-10-11 05:06:12 UTC
Thanks for the response. For this, I was already able to create a service and was successful to perform play function on my app. My concern is before launching the app, i need to manually run the service on a terminal so that my app wont crash because if I dont do that, the service I created isnt available at ROS master. I am thinking of adding the service on the node my app calls on startup. But i dont know how to do that.
Asked by ros.beginner on 2019-10-11 22:20:58 UTC
You can make a separate service node that will be launched first and client will be in your node where you call the service.
Asked by Choco93 on 2019-10-12 08:05:02 UTC