. Can someone tell me what am I doing wrong here. Thanks
The other problem pertains to the subscriber and service. Both of them are associated with callback function but here my question is whether we need to have two different functions for both of them or can we have only one function. Please check the code below and let me know what is the right approach, thanks.
For the first issue, check that you have compiled ( catkin_make) and that you sourced it ( source devel/setup.bash )
Then check with rossrv show that your services are there ( check the unit of custom services of ROS basics course )
As for the second, normally the best way to do this is to encapsulate all in a class so that you have access to the data from the subscriber and then use it anywhere ( in the service callback for example ).
Thanks a lot for your help, one last thing, do you know about any example where I can see how the subscriber data is encapsulated inside a class and then used in the service callback. This is the step where I am bit confused, until now I was using procedural programming for all the tasks, so I am finding it bit diffcult. After this I will be able to finish services part of Rosject. For the procedural way, I will have to define, two functions, one for the subscriber and other function for the service but I don’t want that because the scan readings start without me calling the service which I don’t want. Thanks