How to correctly skip messages in zcm?
RocketFlash opened this issue · comments
I am trying to implement object detection using zcm and I faced the following problem: camera frame rate equals 30 fps, but detector can only process on 15 fps. And I don't understand how to correctly skip frames, because without it, it looks like frames are queued up and processed sequentially. Could you show how to implement it on Python?
Hey Rauf,
Generally you want to make sure you're not doing any long running work from
inside a subscription. So what you'd want to do is just copy the data out
to another thread (could just be the main thread) and process it there.
That then frees up the subscription handler to continue getting called
while you work on processing the first frame. In your subscription you'd
just simply ignore all messages (just an early return) until you're ready
to accept more data.
Hope that helps and let me know if you have any other questions or if I can
clarify anything!
Best,
Jonathan
…On Fri, Jan 29, 2021 at 3:51 PM Rauf ***@***.***> wrote:
I am trying to implement object detection using zcm and I faced the
following problem: camera frame rate equals 30 fps, but detector can only
process on 15 fps. And I don't understand how to correctly skip frames,
because without it, it looks like frames are queued up and processed
sequentially. Could you show how to implement it on Python?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#321>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXKUUGC27WYYCYEMA2J46TS4MNTTANCNFSM4WZQPLXQ>
.
Thank you, @jbendes ! It helped