rosservice call give error "ERROR: Unable to send request. One of the fields has an incorrect type" [closed]

asked 2014-12-09 10:42:02 -0500

peci1 gravatar image

Hi there, this is just a description of a problem I have faced and finally also solved.

My call:

rosservice call /check_flipper_configs_safety "safety_threshold: 0.5
  flipper_angles_to_test: [-2 0 2]"

gave me the following error:

ERROR: Unable to send request. One of the fields has an incorrect type:
<class 'struct.error'>: 'required argument is not a float' when writing 'safety_threshold: 0.5
flipper_angles_to_test: ['-2 0 2']'

I was wondering about the error, because the numbers I provided were actually floats.

The solution is pretty simple: I had a syntax error in the service call:

flipper_angles_to_test: [-2 0 2]

is correctly written with commas as separators, i.e.

flipper_angles_to_test: [-2, 0, 2]

That's all. I leave this here just for reference and for other beginners to be able to find a solution for this unobvious typo error.

edit retag flag offensive reopen merge delete

Closed for the following reason Question does not follow our guidelines for questions. Please see: http://wiki.ros.org/Support for more details. by peci1
close date 2014-12-09 10:42:34.956934