ServiceNotFoundException when creating serviceclient in Android
I have a service (the tutorial sum service implemented in C++) running on my ubuntu/ROS host and want to call this service from my Android device. Unfortunately no matter what i try, i always get a ServiceNotFoundException back. I can access the service locally on the ubuntu host. Traced the network traffic with wireshark, and indeed see that the lookupService call fails.
In the cpp client, the client is created like this: ros::ServiceClient client = n.serviceClient
In java on android i tried this: serviceClient = connectedNode.newServiceClient("/beginnertutorials/addtwo_ints",beginnertutorials.AddTwoInts.TYPE); serviceClient = connectedNode.newServiceClient("/beginner_tutorials/AddTwoInts",beginnertutorials.AddTwoInts.TYPE); serviceClient = connectedNode.newServiceClient("/AddTwoInts",beginnertutorials.AddTwoInts.TYPE); serviceClient = connectedNode.newServiceClient("/addtwoints",beginnertutorials.AddTwoInts.TYPE);
and the same service names with different type (was running out of options...) serviceClient = connectedNode.newServiceClient(....,beginnertutorials.AddTwoIntsRequest.TYPE);
The exception and response is the same in all cases (except the names off course).
I'm a novice ROS user, not novice programmer.
Thanks for reading...
POST / HTTP/1.1
Content-Type: text/xml
User-Agent: Apache XML RPC ${project.version} (Jakarta Commons httpclient Transport)
Host: 192.168.178.45:11311
Content-Length: 222
<?xml version="1.0" encoding="UTF-8"?><methodCall><methodName>lookupService</methodName><params><param><value>/rosjava_tutorial_services/client</value></param><param><value>/AddTwoInts</value></param></params></methodCall>HTTP/1.0 200 OK
Server: BaseHTTP/0.3 Python/2.7.3
Date: Sun, 09 Mar 2014 11:17:00 GMT
Content-type: text/xml
Content-length: 244
<?xml version='1.0'?>
<methodResponse>
<params>
<param>
<value><array><data>
<value><int>-1</int></value>
<value><string>no provider</string></value>
<value><string></string></value>
</data></array></value>
</param>
</params>
</methodResponse>
Asked by ruderik on 2014-03-09 01:35:03 UTC
Comments