Few basic questions regarding some ROS basic code
I have gone through the basic ROS tutorial but I am not still getting some parts of it. Could someone please provide me some explanations about them.
My confusions:
- Why most of the time I see, the way people who are embracing object-oriented paradigm code does not invoke a specific or every member function, instead, they just instantiate an object, then call ros::spin() and done (eg. a code found here)
- What is the use of ros::spin() and its effect of using it to the callback function?
- Why people tend to use callback function a lot, what is pros of it and when is it appropriate to utilize it?
- Can in a class contain more than one callback function?
Thanks in advance..