microsoft / HoloLens2ForCV

Sample code and documentation for using the Microsoft HoloLens 2 for Computer Vision research.
MIT License
480 stars 145 forks source link

IMU Framerate #28

Closed dakesse closed 3 years ago

dakesse commented 3 years ago

In which frame rate can the IMU sensor data be retrieved? As i understand, via polling (with GetNextBuffer()) you can get the first sensor value of an IMU frame (GetCalibratedAccelaration()) or all of them batched (GetCalibratedAccelarationSamples()). however, the IMU frames themselve are limited to a certain rate, which makes this access method not particularly suitable for realtime data processing. I figured out 12fps for the accel and around 24fps for the gyro. Is there also an event based approach? So that you get values ​​as soon as new ones are available from the sensor.

dorinung commented 3 years ago

Your fps estimates are correct. Sensor reading can not be retrieved one by one, On Hololens2 IMU sensors deliver readings in batches. As far as event use you could have dedicated worker thread for each sensor that sits in loop reading batches. On batch arrival the batch could be placed in a work queue that has an associated work event that is signaled. The queue could be read by a different processing thread.

Hope this helps.

dakesse commented 3 years ago

Thank you, that helps a bit. But to be sure: It is not possible to get sensor data simultaneously with a respective render frame?

dorinung commented 3 years ago

Due to hardware architecture each sensor generates frames at its own cadence and they can not be synchronized with an external timeline. They can not be synchronized with other events/threads.

dakesse commented 3 years ago

Thank you for the further explanation.