Design Question: Where Does The Business Logic Go?
Hi Everyone,
I'm trying to design ROS nodes using best practice... the problem is I'm still trying to figure out what best practice is.
Let's say I've made a complex C++ class that does image recognition using OpenCV, Poco, and whatever libraries I could get my hands on.
Question #1:
Would it make more sense to keep the contents of a given ROS node to a minimum - just the boiler plate code - and then instantiate an object of this complex class inside the node (this way I could just use the class's interface and reduce the complexity)? Or would it make more sense to expand the logic of the class into one or more ROS nodes?
Question #2:
How efficient is it to use ROS node services to perform complex computation? For example, let's say I have an image that will get processed in a FOR loop 100 times, each time with a different set of parameters. Should I:
- Keep this looped process within one class within a single node and have it do all the work.
- Make a node that does the computation once, but instantiate 100 nodes to do the job?
Is there a latency between nodes that would not make this computationally practical? Does the communication between nodes suffer if the data being sent is large?
Thank you for your help!