launch multiple nodes sequentially
I'm finding the ways to run multiple nodes sequentially (e.g., start node B after finished node A). Could you give me any advice?
ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
I'm finding the ways to run multiple nodes sequentially (e.g., start node B after finished node A). Could you give me any advice?
Look into tmux and tmuxp.
In tmuxp yaml file just add sleep (amount of time which is taken by node 1 to finish) and then launch second node. I use the same method to launch multiple launch files sequentially
I think you should look into the Lifecycle and Composition Nodes:
A managed life cycle for nodes allows greater control over the state of ROS system. It will allow roslaunch to ensure that all components have been instantiated correctly before it allows any component to begin executing its behaviour. It will also allow nodes to be restarted or replaced on-line.
ROS 2 introduces the concept of managed nodes, also called LifecycleNodes. In the following tutorial, we explain the purpose of these nodes, what makes them different from regular nodes and how they comply to a lifecycle management. Managed nodes contain a state machine with a set of predefined states. These states can be changed by invoking a transition id which indicates the succeeding consecutive state. The state machine is implemented as described at the ROS 2 design page.
Lifecycle is introduced in ROS 2 to systematically manage the bringup and shutdown of the different nodes involved in the robot’s operation. The use of Lifecycle nodes ensures that all nodes are successfully instantiated before they begin their execution and Nav2 shuts down all nodes if there is any unresponsive node.
Asked: 2022-06-20 13:12:03 -0600
Seen: 992 times
Last updated: Jun 21 '22
Do I need to know any specific computer language or framework to use ROS?
Is anybody in ROS community using PySide?
Any good examples of using dynamic_reconfigure for a python node?
is there a python equivalent of fromROSMsg/toROSMsg (pcl stack)
How to contributing python versions of tutorials? e.g. Tutorials for arm_navigation
How to recieve an array over Publisher and Subscriber? (Python)
Error assigning a python quaternion
Using python for automatically writing data in bag to csv file
Maybe try adding delay between starting nodes in launch file. You can see more detail in this post.