Why we need to source package in order to use rosservice
I've implemented very simple node that contains service to reset a counter. When I open up a new terminal and perform the following
rosservice call /request 'reset'
I get this error:
ERROR: Unable to load type [srv_counter/CounterServiceMsg].
Have you typed 'make' in [srv_counter]?
Even though the node that contains this service is running and rosservice list
indeed shows the service in the list.
Sourcing my package source ./devel/setup.bash
solves the problem. I'm wondering why this occurs. Why rosservice
is able to see the service but fails to call it.