Hello,
I'm trying to make a service call that keeps returning false using c++ code but works fine in the command line.
Can't find much information on reasons for the call function to return to or failure causes.
Here is the command line call:
rosservice call /service/url "request: '1.0'"
Outcome:
[Cheery success message from server]
And the cpp code:
bool ExampleListener::send(const std::string& _request, std::string& _resp) {
namespace__::ss::Request rosRequest;
rosRequest.request = _request;
namespace__::ss::Response rosResponse;
if(client.call(rosRequest, rosResponse)) {
_resp = rosResponse.response;
return true;
}else {
ROS_ERROR("Call to server failed, because of reasons.");
return false;
}
}
// some other place in code
std::string _resp;
send("1.0", _resp);
The service is defined as follows:
string request
---
string response
Outcome:
[ERROR] [1470218877.683985359, 8.242000000]: Call to server failed, because of reasons.
Any info would be greatly appreciated.
Originally posted by kotoko on ROS Answers with karma: 122 on 2016-08-03
Post score: 0