Any way to re rospy.init_node
I am trying to write an optimizer that launches many simulation ie. roslaunch.start()/shutdown()
If I init one node to subsrcibea and publish topics, after I shutdown the roslaunch sim, I signal_shutdown() the node. The next attempt to init that node doesn't work but issues no error. I do get a ROSInterruptexception when trying the call a publisher/subsriber (these are unregistered at the end of each sim run).
So I try to run roscore first and only issue one rospy.init_node before the roslaunch startup()/shutdown() loop. This seems to sort of work. But I get a terminal full of TF_OLD_DATA errors and after a few runs the code crashes. I found answer suggesting running reset_time message but no such topic exists in indigo. It appears that while the im clock is reset with a new roslaunch, the tf buffer or some other sim time artifact still has the sim time from the previous run.
I can't be the only person running multiple sim runs. Please advise
Edit: I am trying to run simulations in sequence. Which I can do with import roslaunch module.
But rospy.init_doesn't like to be called a second time.
I have it working by running roscore first and then only one rospy.init_node and declaring subscribers and publishers then unregistering them each roslaunch. However, this generates many "TF_OLD_DATA" warnings ten times a second on the screen. Makes it hard to debug code.
sorr about duplicate new to ROS