Capturing Frames Asynchronously
I have a project written in C#.
Lately, I've started adding migrating my code to async-await syntax for better performance.
I was wondering if there's a way (in C#), to capture asynchronously.
Currently, I am using the "WaitForFrames" method to capture frames, but this method is a blocking operation (obviously).
I was looking at the "PollForFrames" method, although this is not a blocking operation, I am not sure if it'll help with my issue.
Thanks for any help!
-
Hi Amitelle1337
poll_for_frames does not block, though you do have to manage manually how long the CPU is put to sleep for or the CPU can "max out" at or near 100% usage.
There is a class called rs2::asynchronous_syncer though it is not as well known as the rs2::syncer class.
http://docs.ros.org/kinetic/api/librealsense2/html/classrs2_1_1asynchronous__syncer.html
You may also find the link below useful:
Please sign in to leave a comment.
Comments
1 comment