Start and stop ros nodes using service calls
Hello everyone, I am trying to create a Node Manager which is responsible to start and stop/kill a node based on service requests. The issue is roslaunch API launches the nodes in the main process but since the Service server works on separate thread, ROS services are not usable directly. I have already tried running the launch files using the system calls in service callbacks, but they are blocking the thread.
I can create a separate process using the subprocess API but is there any "ROS" way to do this as I have to have complete control on starting and killing the nodes? Is there any better way than ROS services to reach the objective?