So basically, what I want to have is this:
Have ROS collect data, and process this data into a vector. (This is done)
Once the data has been recorded, write the vector to a text file (Not done)
The problem that I have is, how do I stop ros from spinning? How can I then just simply run the function which writes the text to the file?
I've been thinking along the lines of threading, I create a thread that subscribes handles the callback function and another thread that handles writing to the text file. So in essence, the plan would be to have
thread1 run for a set amount of time, then halt
thread1 and begin to start
Is this possible using ROS? And, is this the only method to solving the above?
Post score: 0
Comment by demmeln on 2014-01-21:
Do you want to do 1) and 2) repeatedly, or just once? In any case try checking out the suggestion by @ahendrix.