I'm not sure if you need to un-init to stop and start ROS (for example, to contact multiple masters, etc). The ros::init() function only processes command line arguments.<br><br>There's some example code in wgtest_status_indicator that runs a persistent node that can reacquire the ROS Master, and start and stop ROS.<br>
<br><a href="https://code.ros.org/svn/wg-ros-pkg/stacks/wg_hardware_test/trunk/wgtest_status_indicator/src/nodes">https://code.ros.org/svn/wg-ros-pkg/stacks/wg_hardware_test/trunk/wgtest_status_indicator/src/nodes</a><br>
<br>Kevin<br><br><br><div class="gmail_quote">On Fri, Jan 7, 2011 at 4:26 AM, Dirk Thomas <span dir="ltr"><<a href="mailto:dthomas@sim.tu-darmstadt.de">dthomas@sim.tu-darmstadt.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi,<br>
<br>
i would like to use multiple cycles of ros::init/ros::start/ros::shutdown<br>
without restarting the binary every time. Currently the ros::init function<br>
protects itself from multiple calls (using the bool g_initialized).<br>
<br>
I added/hacked an additional function ros::uninit() which currently just resets<br>
the bool to false. Multiple ros::init/ros::start/ros::shutdown/ros::uninit<br>
cycles are now working (without extensive testing).<br>
<br>
I suppose that the uninit-function needs to perform more cleaning and resetting.<br>
<br>
Are there any sideeffects i should be aware of?<br>
Can such a function be integrated into ROS (with a more comprehensive<br>
implementation than my one, of course)?<br>
<br>
Dirk<br>
_______________________________________________<br>
ros-users mailing list<br>
<a href="mailto:ros-users@code.ros.org">ros-users@code.ros.org</a><br>
<a href="https://code.ros.org/mailman/listinfo/ros-users" target="_blank">https://code.ros.org/mailman/listinfo/ros-users</a><br>
</blockquote></div><br>