What it the ROS way to represent invalid data in a message
I have a sensor that outputs static or slowly changing data at a low rate and dynamically changing data at a higher rate.
I would like to have one message that aggregates this data together but doesn't have to wait for a 'static data' update before it publishes the first message (due to the lossy medium these messages come over it may never get one).
I'm looking for a way that a subscriber can tell which fields of the message are populated and which are not.
The options so far:
- Have a bitfield that holds whether each field is valid or not.
- Have pre-defined invalid values as default values for each field.
- Represent each value as an array of the corresponding message type and publish an array of length 0 or 1.
Am I missing a ROS way to specify that a field in a message is optional or invalid?
Unfortunately it's not as simple as just having a seperate message for static vs. dynamic data because depending on the source of the data some fields in each of those messages may also be omitted...
For interest I am trying to integrate an AIS receiver ( http://en.wikipedia.org/wiki/Automati... )
I'd say: It depends. Can you come up with an exemplary message for your data + comments which kind of data might not be filled? I have seen 2) and 3) being used in standard messages.