fkie / multimaster_fkie

ROS stack with FKIE packages for multi-robot (discovering, synchronizing and management GUI)
BSD 3-Clause "New" or "Revised" License
267 stars 107 forks source link

Writing a node that turns On/Off capabilities just like node_manager? #121

Closed olamarre closed 4 years ago

olamarre commented 4 years ago

Hi! I've been using node_manager's Capabilities View to turn On/Off specific capability groups (it's great, thanks!). Now, I would like to do the same but from a Python node (instead of using the node_manager GUI). Would you be able to advice which python package(s) & method(s) to use to accomplish this? Thank you very much.

atiderko commented 4 years ago

Hi! you can call the ROS service /node_manager_daemon/run to run a node of a loaded launch file. Load a launch file by itself is more complicated, see launch_servicer.py and launcher.py.

To stop a ROS node the XMLRPC API of a ROS node is used, see node manager code. For this call you need the XML-RPC URI of the node. You get this from ROS-Master XMLRPC by calling lookupNode (Master API).

I hope this helps you achieve your goal.

olamarre commented 4 years ago

Great, thank you for the detailed answer! I'll definitely refer to those to implement what I need.