ROS spin and initialize
Hi. I'm new to ROS and I'm working with ros cpp. I have a question.
I know that if I call ros::spin(), then it enter a loop, pumping callbacks. But there are certain function that I just want to call, only once in the whole execution time.(and probably at the beginning) Like initializing device(not ros::init), setting which device to use through stdin.
I know that i can use inifinite while loop, but I don't think that it's a good idea. Because ros::spin() is made for that purpose.
Is there any function to solve this problem?
Is there anything that prevents you from doing all of your initialization before you call ros::spin()?