[ros-users] Multiple init/start/shutdown cycles without restart

Kevin Watts watts at willowgarage.com
Fri Jan 7 17:47:42 UTC 2011


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.

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.

https://code.ros.org/svn/wg-ros-pkg/stacks/wg_hardware_test/trunk/wgtest_status_indicator/src/nodes

Kevin


On Fri, Jan 7, 2011 at 4:26 AM, Dirk Thomas <dthomas at sim.tu-darmstadt.de>wrote:

> Hi,
>
> i would like to use multiple cycles of ros::init/ros::start/ros::shutdown
> without restarting the binary every time. Currently the ros::init function
> protects itself from multiple calls (using the bool g_initialized).
>
> I added/hacked an additional function ros::uninit() which currently just
> resets
> the bool to false. Multiple ros::init/ros::start/ros::shutdown/ros::uninit
> cycles are now working (without extensive testing).
>
> I suppose that the uninit-function needs to perform more cleaning and
> resetting.
>
> Are there any sideeffects i should be aware of?
> Can such a function be integrated into ROS (with a more comprehensive
> implementation than my one, of course)?
>
> Dirk
> _______________________________________________
> ros-users mailing list
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ros.org/pipermail/ros-users/attachments/20110107/10a374d3/attachment-0003.html>


More information about the ros-users mailing list