Robotics StackExchange | Archived questions

Giving permission to a node

Hello, maybe my question is a bit silly, but here it goes.

How can I give permission to a node (Python) to execute? Which is the best approach? I'm making a SMACH code to control some behaviours of the robot, but I need to give and take away the permission to a node to execute. It's better to do service and client (who will be the client or service)? Maybe could I start & stop the node from the code in some way?

Asked by Enriq on 2017-07-13 04:00:08 UTC

Comments

why not use a service or action call?

Asked by mgruhler on 2017-07-13 05:49:43 UTC

How can I use it as a service? Who will be server and client; my smach code or the node? Which type of srv I should use? Actionlib is a bit complicated to use, I have no feedback. Just activate or deactivate the node

Sorry for so many questions

Asked by Enriq on 2017-07-13 06:37:38 UTC

The server is the node, because this is doing the work. smach is just calling, thus: client. See http://wiki.ros.org/smach/Tutorials/ServiceState Which type of service is up to you and depends on your use case. For just "De/Activation", I'd use a std_srvs/Trigger or std_srvs/SetBool

Asked by mgruhler on 2017-07-13 07:40:54 UTC

Answers