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

Geoffviola ros.discourse at gmail.com
Tue Dec 20 16:52:10 UTC 2016

> Do you want to distinguish an unset value from any other value? 

Yes, the goal is to specify an unset or unused value from another value, but maintain compatibility. 

>If the value is not set do you want it to not use any space on the wire?

I don't care about the wire representation at this point. I was concentrating on the user perspective.

> Do you want an older message definition (without the optional field) be compatible with a newer variation of the message (with the optional field added)?

 That would be nice and could be another way of getting the same thing. For example, somehow relating the 1D gyro to the 9D IMU message without much overhead or specification. I was mostly thinking about the inherent compatibility with one message type.

> I don't understand how C++14 / C++17 is related to this and what you mean with "experimental optional implementation". Maybe you can clarify that part.

Sorry, I started to get into the weeds. I like the use of std::array and std::vector in the C++ message API. I thought it would be nice to use std::optional, which is available in C++14 as a pseudo experimental feature: http://en.cppreference.com/w/cpp/experimental/optional. Basically, some compilers added it in the std::experimental namespace before it was officially released in C++17.

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

More information about the ros-users mailing list