Running ros nodes sequentially
Hello,
I have 3 ROS nodes in Python and they run in a loop. The 1st node publishes the command to the 2nd node. The 2nd node subscribes to the 1st node and also to the feedback from the 3rd node and based on that, it publishes to the third node. The 3rd node which is subscribed to the 2nd node then publishes its feedback back to the 2nd node. When the feedback arrives, the 1st node should again publish to the 2nd node (until then, the publishing should be stopped/blocked from the 1st node) and this loop continues. How can I achieve this workflow? Right now, I launch 3 nodes in a launch file and this is not giving me desired result. I tested by running all nodes separately one after another. In this case, they do not connect with each other and I can see 3 unconnected nodes in rqt graph. In the first increment, I initialize feedback from the 3rd node to some default value so that the 2nd node can start working. Can someone please suggest to me how to tackle this? Should I use Ros services? Currently, I am just using subscribers and publishers. Could someone give me some hints?
Thanks in advance