ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

I can see two possible problems here. I'm not sure what you actually ask, as the question is not completely precise...

  1. You don't connect to the correct server (or any server at all):

When you set up the client, you connect to the service call <node_namespace>/water_current_client. The test you provide, you call the service /get_water_current. If this is the problem, change the Service client to /get_water_current and you should be okay. Maybe also think of checking for the server existence with the exists() or waitForService()functions (see the API docs).

  1. The call to current_lookup_client_.call() returns false:

This seems to be a problem in your Service Server, not in the client.

Check if you have a return false in the Service Server callback somewhere. The call() function basically returns what you return from the Service Server Callback (which should return a bool), except if there is any communication error (in which case it also returns 'false' ).