Standby mode for nodes depending on topic value
Let's assume we have 10 nodes performing various operations. We run all the nodes with one launch file at a time. We also have one topic "/mode" in which we specify the value of int. Now we want certain nodes to execute depending on the value of "/mode". Is there any better way to do this in the ROS environment than subscribe the "/mode" topic, check the value, and if it is incorrect, we just do return in callbacks? Can I freeze the nodes somehow depending on topic value? I mean, nodes should be in standby mode and wait for specific output of "/mode" topic and run callbacks until "/mode" is correct. I want to run and stop node several times through topic value.