ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A answers.ros.org
Ask Your Question
1

launch a node within another node

asked 2011-09-09 08:58:08 -0600

HZ gravatar image

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

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?

Thanks,

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

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

joq gravatar image

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

edit flag offensive delete link more

Comments

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 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2011-09-09 08:58:08 -0600

Seen: 819 times

Last updated: Sep 09 '11