Let's assume I have class cA, which has a node that subscribe from topic and publisher with a "constant" frequency. Class cA is a mamber of class cB. Where I should put "while(ros::ok())" for publishing purpose? Cose if i put it in constructor it'll bloc constructor of "higher" class (ofc. I can make a function cA::Publish() and run everything further in cB::Publish() or split classes to more nodes and classes, but i am looking for beter solution).
Should I use threads? I have never used them so I don't know if i should. I found this cant_post_links_http://wiki.ros.org/roscpp/Overview/Callbacks%20and%20Spinning
Is there an easy example?
thanks in advance
Originally posted by BP on ROS Answers with karma: 176 on 2014-03-13
Post score: 1