How to change g_initialized in ros::init
Hi,
I'm developing a QT interface to manage two or more robots, each having its own ros master (this is mandatory). My QT interface consists of a qtalker, and I'd like to switch it runtime from a robot to another (i.e. from a ros master to another). To do so, I shutdown the current qtalker node, and then I restart it (runtime) calling again ros::init after passing it new master IP/port in remappings. The problem I find is that new parameters are not received, so that old master is again linked to qtalker.
I found, in init.cpp, the static variable "g_initialized", which is set to "true" the first time ros::init is called, and than doesn't allow new remappings are read the second time ros::init is called. I think this is the reason for which the new master cannot be linked.
Two questions:
1) Am I right?
2) There is any workaround?
Thanks very much
Paolo