[ros-users] [Discourse.ros.org] Suggestions for std_srvs
Tully Foote
ros.discourse at gmail.com
Mon Jan 9 18:56:34 UTC 2017
As with std_msgs we have learned from experience that it's better to have semantic meaning. I would strongly recommend against using `myorganization_srvs/GetBool` for the same reasons that we discourage it in `std_srvs`.
The example of `mypackage1_srvs/GetAwesomeVariable` has semantic meaning such that if you do a rosservice list you know that this service represents `AwesomeVariable`.
As an example, if you have another service which is `mypackage1_srvs/GetStatus` which simply returns an `int`.
The status might be {0: OK, 1: ERROR, 2: UNINITIALIZED} whereas the Awesome Variable represents a real value such as what floor of the building you're on.
They both carry the same data structure, and have the same fields. But the data carries different meanings.
If you were to remap the Status service topic to the AwesomeVariable topic suddenly your robot would be happy on the ground floor, but as soon as you moved to the 1st floor it would start erroring and say you went down to the basement, suddenly your status would be negative which is undefined behavior. Since the data is not semantically interchangeable it should be represented as a different type.
---
[Visit Topic](https://discourse.ros.org/t/suggestions-for-std-srvs/1079/12) or reply to this email to respond.
More information about the ros-users
mailing list