[ros-users] [Discourse.ros.org] [Next Generation ROS] Optional Fields in Message

Martin Günther ros.discourse at gmail.com
Tue Dec 20 20:19:33 UTC 2016




> The best use case I can currently think of is to get rid of the geometry_msgs/FooWithCovariance message types and merge them into one geometry_msgs/Foo message with an optional covariance field

While I agree that there may be valid use cases for optional fields, I don't think this is one of them. In a different robot framework that I regularly use, there is no `PoseStamped` message, only a `RigidBodyState`, which is the logical conclusion of what you propose and which has these fields:

- position, cov_position
- orientation, cov_orientation
- velocity, cov_velocity
- angular_velocity, cov_angular_velocity

In contrast, I like the ROS messages (`Pose`, `PoseStamped`, `PoseWithCovariance` ...) better. The signature of the topic tells me immediately which fields are used or supposed to be filled. I don't have to do a `rostopic echo` or read the code to find out, and if they later decide to use a covariance, the API changes, so my code breaks and I know I have to adjust it.






---
[Visit Topic](https://discourse.ros.org/t/optional-fields-in-message/991/7) or reply to this email to respond.




More information about the ros-users mailing list