Callback receives old data
Closed this issue · 0 comments
Hello!
I am trying to use an YDLidar X4 directly on an Lego EV3 brick running ev3dev (Debian derivative).
Now, I am experiencing a performance issue with the ydlidar driver: The data received via the callback function are getting older and older during runtime of my test application. E.g., after one minute, the incoming data is already about 10s behind. I found that the ydlidar driver is using quite big caches internally. Instead of caching a lot of data, I'd rather like to discard old measurements and receive the latest measurements instead. What can I do to achieve better the performance?
For the record: I call spinOnce() in an infinite loop and process incoming data inside the callback, which takes about 40ms for each run.
Thanks in advance!