Re: [ros-users] Multiple init/start/shutdown cycles without …

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: User discussions
Date:  
To: User discussions
Subject: Re: [ros-users] Multiple init/start/shutdown cycles without restart
> 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: actually i want to be able to restart the ROS node. This may include
different command line arguments, mappings, whatever. Therefore the cycle should
cover all aspect including the initialization.


> Out of curiosity, what's your use case?


@Blaise: good question, difficult answer :-)
Currently it is more a prototype and testing than a real world application.
I build a ROS node (or a ROS Nodeletmanager) in a shared library. This library
is then loaded and run from an other binary. This binary should be capable of
restarting the ROS node with e.g. modified command line arguments if needed.
If the library is rebuild the binary must unload/reload the modified lib. But
if only command line arguments are changed it should keep the current lib
loaded and just perform a second cycle.
I will post more details of the use case when i am some steps further...

Currently i am dealing with multiple issues:

- after the first cycle of init(), start() and shutdown() i can't perform a
uninit() and therefore no second init(), etc. cycle

- when unloading the library containing the ROS node (which uses log4cxx) my
application crashes with a segfault due to some internals of log4cxx

- likely more to come...

Dirk