ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

launch a node within another node

asked 2011-09-09 08:58:08 -0500

HZ gravatar image

updated 2011-09-12 20:05:00 -0500

kwc gravatar image

Hi All,

I have two nodes: A and B implemented in C++. Now I want Node A to be launched (by the program, not by users' input in the terminal) within the execution of Node B that is launched by users in the terminal. Is there a ROS way to do this? Or should I just encode a shell command in B's source code to launch A, like executing a shell command in C++ programs?


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2011-09-09 13:35:36 -0500

joq gravatar image

The usual ROS way is running them both from a roslaunch script.

edit flag offensive delete link more


This will bring up A and B at the beginning, and then B can designed to idle until it is contacted, thus not providing significant overhead. This also has the advantage that it decreases issues like latency at startup.
tfoote gravatar image tfoote  ( 2011-09-10 05:45:35 -0500 )edit

Question Tools


Asked: 2011-09-09 08:58:08 -0500

Seen: 954 times

Last updated: Sep 09 '11