Creating own service (not copying from some other package)
Hi!
So I am new to ROS and I went through most of the beginner tutorials. I am at the point where I am learning how to create my own services. In the ROS tutorial on the link below, they tell you how to copy a service from some other package, using 'roscp'.
http://www.ros.org/wiki/ROS/Tutorials/CreatingMsgAndSrv#Creating_a_srv
A few questions come to mind after following the tutorial on the link above, and the subsequent 2-3 tutorials:
1) How do I create my OWN service? This tutorial shows how to copy one from some other package. Any steps that I can follow to create my own service with my own choice of messages?
2) Can anyone tell me how the client-server model works with the services? Its hard to understand what's going on without namespaces in the tutorial. A step-by-step description of what exactly is going on, would be really helpful.
3) This is not an essential piece of knowledge, but I am just curious about why there exist two commands rosservice and rossrv. Can't the functionality of both these commands be captured into one, say 'rosservice' only?
4) In the tutorial link above, they use the function advertiseService() with the nodehandle pointer. Is this a new addition to ROS? I remember seeing something like advertise() which does the same thing as advertiseService() on some other tutorial page.
Thanks for the patience to go through my post!
Nishant.
Thanks Lindzey and joq for your insights! Especially for (1) and (4). I will post a new question if I have any further doubts! :)