rosrospy

Is there a way to switch between which node I want active from a main node that monitors the robot?


Im still learning the basics of ROS. So I have a main navigator node that monitors a robot and what I want is for the main node to stop at lets say an obstacle and switch to a separate node that will give the Twist commands to go around the object and then switch back to a separate node for the rest of the navigation. Is there some sort of ros command for node switching?


Solution

  • This explains how to launch a node using rospy

    Then as for stopping a node as it allows two nodes to know when the other has terminated, bond should do what you want