Giving permission to a node

asked 2017-07-13 04:00:08 -0500

Enriq gravatar image

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?

edit retag flag offensive close merge delete


why not use a service or action call?

mgruhler gravatar image mgruhler  ( 2017-07-13 05:49:43 -0500 )edit

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

Enriq gravatar image Enriq  ( 2017-07-13 06:37:38 -0500 )edit

The server is the node, because this is doing the work. smach is just calling, thus: client. See 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

mgruhler gravatar image mgruhler  ( 2017-07-13 07:40:54 -0500 )edit