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?
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.
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
Asked: 2022-06-20 13:12:03 -0500
Seen: 686 times
Last updated: Jun 21 '22
Running Python launch files with arguments
Rviz slows down publisher when subscribed to /map topic?
Is there a way to throttle publisher rate in ROS2?
rclcpp::Time() without nodehandles in ROS2 Foxy
Callback upon parameter change in other node
ROS - SerializationError when writing a bagfile with custom ROS message
[ROS2 Foxy] rclcpp_action "no match for ‘operator=’ "
Passing parameter for launch testing in ros2
Maybe try adding delay between starting nodes in launch file. You can see more detail in this post.