[ros-users] [Discourse.ros.org] Suggestions for std_srvs

William Woodall ros.discourse at gmail.com
Wed Jan 11 21:27:55 UTC 2017




There are some predefined services already:

- `Empty`: https://github.com/ros/ros_comm_msgs/blob/indigo-devel/std_srvs/srv/Empty.srv
- `SetBool`: https://github.com/ros/ros_comm_msgs/blob/indigo-devel/std_srvs/srv/SetBool.srv
- `Trigger`: https://github.com/ros/ros_comm_msgs/blob/indigo-devel/std_srvs/srv/Trigger.srv

>From the list proposed, I could see enough grey area to allow `GetBool`, but the others I don't think are good ideas. With bool, as @fmauch pointed out, you know what the valid inputs are (true and false). If only one of those, or neither, were valid, then you would use `Empty` or `Trigger` instead.

With the get/set of the other types, I think the possible values are not clear and would benefit from a more specific type. String is on the fence for me, but int and float I feel pretty strongly should have constants or units attached to them by using a custom Service type with comments. For example, using `SetFloat32` for a service called `/set_desired_temp` is the kind of abuse of these types we want to avoid. In the case of string, I could see cases where using just a set/get string service type would be ok, but most all of them would benefit from, if not require, further clarification in a custom service type.






---
[Visit Topic](https://discourse.ros.org/t/suggestions-for-std-srvs/1079/17) or reply to this email to respond.




More information about the ros-users mailing list