0
$\begingroup$

Rosanswers logo

I have the following code:

RouteRemainder.srv:

---
int64[] route_remainder

routes_manager,py:

...    
rospy.Service( "/route_remainder", RouteRemainder, self.route_remainder_callback)
...
def route_remainder_callback(self, msg):
    return [1, 2, 3]

When I call rosservice call /route_remainder, I get:

ERROR: service [/route_remainder] responded with an error: service cannot process request: handler returned wrong number of values: Invalid number of arguments, args should be ['route_remainder'] args are(1, 2, 3)

What could be the problem?


Originally posted by mbostic on ROS Answers with karma: 16 on 2021-04-24

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I had to wrap the return value into a tuple:

return ([1,2,3],)

Originally posted by mbostic with karma: 16 on 2021-04-24

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.