Running several nodes under a "top" node
I have organized my code in such a way that when I run a "main" file, it calls methods in other classes, from other packages, to accomplish a task. I soon realized that the classes written, requires a rospy node so that it can communicate with ROS_MASTER
.
But I cannot initialize other nodes under the "main" node as i think ROS only allows one node to be initialized and not a node inside another.
Example: The classes in the other packages use SimpleActionClient/action client which uses the actionlib, that requires to initialize a node to publish messages and call services.
I had only initialized a node for the "main" method.
And since I cannot initialize any more nodes, the code does not really do anything
Any advice on how to resolve this issue? or any alternative ideas?
Thanks!