I'm trying to create a service that returns an array of a custom msg. However, when I call this using **roservice call /myservice [input params...]** I get the following error:
ERROR: service [/myservice] responded with an error: service cannot process request: handler returned wrong number of values: Invalid number of arguments, args should be ['parsed'] args are(operation: travel_to target: a1 time_step: 0, operation:open ... )Based on this I assumed that the type I was returning was wrong, so outputted the type just before the return statement in Python, however they seem to be what I expect them to be based on the documentation here
type: type 'list' element type: class 'asp_model.msg._SubGoal.SubGoal'.srv file
string goal string entityA string entityB --- Subgoal[] parsed.msg file
string operation string target int16 time_stepSome additional info: I also tried simply returning a list of integers **[1, 2, 3]**, which with the response type set to **Int16[]** which resulted in the same error. I'm running on ROS Hydro, Ubuntu 12.04, no other errors show up when running catkin_make or running the server
Any ideas on how to go about fixing this? I'm not sure if I'm completely misunderstanding the error message!
**Edit1**: Python on server, I've removed code indicated by the '...' as its some lengthy regex and string parsing stuff:
def parse_answer(self, raw):
parsed = [] # Use this to save list of SubGoals
....
....
for step in anslist:
....
....
if step:
parsed.append(SubGoal(operation=operation[0], target=target[0], time_step=int(time_step)))
return parsed