panda-official / TimeSwipe

PANDA Timeswipe driver and firmware
GNU General Public License v3.0
3 stars 5 forks source link

Looks like we are loosing data #15

Closed IngoKaiser closed 4 years ago

IngoKaiser commented 4 years ago
Bildschirmfoto 2019-11-12 um 16 26 12

This is a triangle signal on the data. It looks like I was to slow with lib. We need to get 48k fps. Do we get that? Whats the cpu load like?

Please do some testing.

iluxa commented 4 years ago

At first we can add data losing check for intto the library criteria might be if data received later than 500ms after previous data received

How is it possible to measure fps? Is it expecting to receive 48k records per second?

iluxa commented 4 years ago

Going to resolve https://github.com/panda-official/TimeSwipe/issues/11 before continue testing, it seems data are losing because of real sleep is different from intended

iluxa commented 4 years ago

After some testing, I found that printing data takes a lot of time and causes losing data. Even not printing but formatting float pointer numbers. The issue can be solved by multithread application with lockfree queue. I get it working without losing data by using boost::lockfree:spsc_queue We can generate errors counter from the driver side to the user application.

iluxa commented 4 years ago

PR: https://github.com/panda-official/TimeSwipe/pull/23 driver reads from sensors to its own buffer in own thread application reads data from driver buffer application also reads error counter - how many entries have been lost in the buffer add debian 32bit packed build

iluxa commented 4 years ago

checked on raspbian - getting 48K fps

IngoKaiser commented 4 years ago
image