ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
I think you take things too "serious".
2 | No.2 Revision |
I think the answer to your primary question is clear, Yes they can have / be both!
There are several tutorials which describe the background, I dont think a all in one tutorial is needed.
Look at this tutorial for the ros main-loop behaviour: http://wiki.ros.org/ROS/Tutorials/WritingPublisherSubscriber%28c%2B%2B%29
Look at this tutorial for the server-client stuff: http://wiki.ros.org/ROS/Tutorials/WritingServiceClient%28c%2B%2B%29
If putting both together you take things too "serious".will have a basic understanding to find the solution for your problem. Of course you can also use Nodelet's but they are more C++ object oriented style, so there you don't have a main-loop anymore, you can only use callbacks which includes timer callbacks desribed here:
http://wiki.ros.org/roscpp/Overview/Timers
And now some notes regarding your code:
3 | No.3 Revision |
I think the answer to your primary question is clear, Yes they can have / be both!
There are several tutorials which describe the background, I dont think a all in one tutorial is needed.
Look at this tutorial for the ros main-loop behaviour: http://wiki.ros.org/ROS/Tutorials/WritingPublisherSubscriber%28c%2B%2B%29
Look at this tutorial for the server-client stuff: http://wiki.ros.org/ROS/Tutorials/WritingServiceClient%28c%2B%2B%29
If putting both together you will have a basic understanding to find the solution for your problem. Of course you can also use Nodelet's but they are more C++ object oriented style, so there you don't have a main-loop anymore, you can only use callbacks which includes timer callbacks desribed here:
http://wiki.ros.org/roscpp/Overview/Timers
And now some notes regarding your code: