Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update frequency for IMU #443

Open
gb2111 opened this issue Apr 13, 2021 · 4 comments
Open

Update frequency for IMU #443

gb2111 opened this issue Apr 13, 2021 · 4 comments

Comments

@gb2111
Copy link

gb2111 commented Apr 13, 2021

Hello.
I was testing examples and they seem to use a high CPU. My idea is that if there is no data they create "empty" iterations.
After adding some code seems like I can get 300 FPS which of course is not easy to schedule on Windows.
I wonder if number 300 is something you can confirm or it might be something specific to my PC?
Thanks.

@nitsch
Copy link
Collaborator

nitsch commented Apr 17, 2021 via email

@gb2111
Copy link
Author

gb2111 commented Apr 20, 2021

Thanks for reply @nitsch . I am testing example.c file. Added some code to check FPS separately when I have returned zero or non-zero. I am using timeGetTime function and count how many I can get in one second.
When I have one device I have about 580FPS. When I have 2 devices I have about half of that, which is in practice 280FPS. Those numbers are not fixed and can vary even by 10-20. So can vary even 40 between min and max. No info about dropping frames what seem to be good indicator.

Then I see also about 5000000 fps for non-pooled values that is causing quite a overhead for CPU. The fans go loud immediately.

I changed code to disable noblocking and got only 'proper' values with same FPS. But there was no 'zero' calls from psmove_pool(). My CPU was almost idle and fans quiet.

@thp
I wonder if you would see it useful to have some flag to allow 'blocking' code or better just some timeout to give CPU idle time before waiting for new data. That seem relatively simple and I could do that part if you agree.
If I missed anything where this is already in place then sorry for that :)

@nitsch
Copy link
Collaborator

nitsch commented Apr 26, 2021 via email

@thp
Copy link
Owner

thp commented Sep 17, 2022

Feel free to make a pull request. The example code, however, usually has the right way to do it -- for integrating sensor readings over time, you want to poll until it returns zero, and process every event, if you just care about the "latest" values, just poll until it returns zero, and then process only the last event (throwing away all in-between values, as they are "old data" anyway).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants