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

Revision history [back]

click to hide/show revision 1
initial version

Your thrusterstate() function should be returning a SetBoolResponse object.

If you don't provide one (and I think it is a terrible feature), the RosService code tries to auto-convert whatever you did return into a SetBoolResponse object. It screws this up a lot, so you are better off just returning the proper thing in the first place.

You can look at the SetBool python class definition file to understand how to create the SetBoolResponse object:

/opt/ros/melodic/lib/python2.7/dist-packages/std_srvs/srv/_SetBool.py

A quick look indicates this should work (untested):

resp = SetBoolResponse(False, "thruster off")
return resp