ServiceNotFoundException when creating serviceclient in Android

asked 2014-03-09 00:35:03 -0500

ruderik gravatar image

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<beginner_tutorials::addtwoints>("add_two_ints");

In java on android i tried this: serviceClient = connectedNode.newServiceClient("/beginner_tutorials/add_two_ints",beginner_tutorials.AddTwoInts._TYPE); serviceClient = connectedNode.newServiceClient("/beginner_tutorials/AddTwoInts",beginner_tutorials.AddTwoInts._TYPE); serviceClient = connectedNode.newServiceClient("/AddTwoInts",beginner_tutorials.AddTwoInts._TYPE); serviceClient = connectedNode.newServiceClient("/add_two_ints",beginner_tutorials.AddTwoInts._TYPE);

and the same service names with different type (was running out of options...) serviceClient = connectedNode.newServiceClient(....,beginner_tutorials.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>
edit retag flag offensive close merge delete