ROSbridge: "Service does not exist"

asked 2018-09-21 02:47:39 -0500

mneumann gravatar image

updated 2018-09-21 04:02:40 -0500

I am trying to call the service /cac/GetMapInfo in a stage simulator from ROSbridge in a simple test program:

from websocket import create_connection
import json

test_json3 = { 
    "op": "call_service",
    "service": "cac/GetMapInfo"
}
test_json = json.dumps(test_json3)
ws = create_connection("ws://localhost:9090")
ws.send(test_json)                 
while(1):
    print(ws.recv())               # print what ever is published on topic

However, the websocket returns this:

call_service InvalidServiceException: Service /cac/GetMapInfo does not exist

Running the script results in:

{"values": "Service /cac/GetMapInfo does not exist", "result": false, "service": "cac/GetMapInfo", "op": "service_response"}

But when I run rossrv list | grep cac, the service does exist. Am I missing something? Calling topics through ROSbridge works just fine.

edit retag flag offensive close merge delete

Comments

what is the service called? is it /cac/getMapInfo as written in the first line or /cac/GetMapInfo as in your code. This is case sensitive!

Also, the error message about /cac/getBatteryStatus is probably a c'n'p error, or not?

mgruhler gravatar image mgruhler  ( 2018-09-21 03:59:47 -0500 )edit

Yes, I have multiple services I tried to call, all in the same cac package. I tried both /cac/GetMapInfo as well as /cac/getMapInfo. Further, I tried cac/GetMapInfo as well, and none of them worked. I edited my post to avoid confusion.

mneumann gravatar image mneumann  ( 2018-09-21 04:02:06 -0500 )edit

Please show us the output of rosservice list | grep cac.

gvdhoorn gravatar image gvdhoorn  ( 2018-09-21 05:44:48 -0500 )edit