That's not how it works (a new sample does not "overlay" the "existing" state of the Instance). The last sample with optional fields is telling you that the instance no longer has those values. It sounds like you are looking for fractional reassembly.
I'd use some sort of "key frames" (periodically send one instance that has all the necessary values, even the optional ones). The periodicity of the key frame should be well-known (available in the documentation, or published in a Topic someplace, or in the RTPS Built-in Discovery information) such that a late joiner reader History can be set to deep enough that it ensures that at least one key frame is available. Your late joiner will need to have an internal copy, subscribe to the topic, and then build up the current state based on the key frame + any later samples.
Alternately, a reader's application-internal 'state' is invalid until it has received at least one key frame. Once it has, it can treat all subsequent samples as updates to its internal knowledge of the instance (so use .take() instead of .read())
That's not how it works (a new sample does not "overlay" the "existing" state of the Instance). The last sample with optional fields is telling you that the instance no longer has those values. It sounds like you are looking for fractional reassembly.
I'd use some sort of "key frames" (periodically send one instance that has all the necessary values, even the optional ones). The periodicity of the key frame should be well-known (available in the documentation, or published in a Topic someplace, or in the RTPS Built-in Discovery information) such that a late joiner reader History can be set to deep enough that it ensures that at least one key frame is available. Your late joiner will need to have an internal copy, subscribe to the topic, and then build up the current state based on the key frame + any later samples.
Alternately, a reader's application-internal 'state' is invalid until it has received at least one key frame. Once it has, it can treat all subsequent samples as updates to its internal knowledge of the instance (so use .take() instead of .read())
Hello, thanks for your quick response.
That you mention is what i am going to do.