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

Forside
Vedhæftede filer:
Indlæg som e-mail
+ (text/plain)
Slet denne besked
Besvar denne besked
Skribent: William Woodall via ros-users
Dato:  
Til: ros-users
Emne: [ros-users] [Discourse.ros.org] Suggestions for std_srvs



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.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list

http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>