Open Donny9 opened 3 years ago
@davids5 @dagar What do you think?
I think I understand what you're saying. I was vaguely aware of the imperfect interaction between subscriptions with intervals (eg uORB::SubscriptionInterval) and queued topics, but didn't necessarily think it would be a real problem.
For various reasons I've wanted to push the publication timestamp into uORB itself so that it's set atomically with the actual data copy. If we had the timestamp for each msg within uORB::DeviceNode
then we'd be able to do this perfectly for queued topics and subscriptions with intervals right?
Hi @dagar @Donny9 , Any news w.r.t to this problem?
If I understand the problem described correctly than for example:
If this is the case than this uORB::SubscriptionInterval_ is not at all doing what it should do and should not be used
Thanks in advance Ronen L.
Describe the bug
I find that in the current code I can't get really downsampled topic data for topics whose queue isn't 1 and has more than one subscriber by uORB API.
The following example: A topic has one publisher(name is P) whose queue is 10 to publish data in freq:100HZ, and it has three subscriber(name are A, B and C), they subscribe at 100Hz , 50Hz, 30HZ respectively, they correspond to intervals of 10000us , 20000us 33333 us respectively.
Use the last 10 data publish to illustrate for correct downsampled case:
Theoretically, subscribers with different frequencies get sample data which should be the sample data at the corresponding time point.
But the current code obtains the sample value from the queue in order after satisfying the sampling interval.
Use the last 10 data publish to illustrate for master:
so that's wrong, the corresponding code is:
To solve this problem, my current measure is to add up the generation intervals according to the multiples of the highest sampling frequency and the current subscription frequency.
However, for the relationship between the highest sampling frequency and the current subscription frequency is not divisible, the error between the time point and the sampling value will become larger and larger.
So, Do you have good suggestion for this problem?