Can't poll acceleration at 1000Hz from Unity
I'm pretty sure this is a Unity quirk, but hopefully someone with more Unity knowledge can confirm. I'm trying to poll accelerometer data at 1000Hz from Unity, but I seem to only get something like 200Hz on average - it keeps repeating the same data over and over. My project has a fixed timestep of 0.001 (1000Hz). In "FixedUpdate" for a particular script, I try to poll as follows:
I have code to buffer this data per tick and flush it to disk. Example subset of the data (time, accelx, accely, accelz):
As you can see.. I get the same data over a non trivial time period. Is this some quirk / feature of Unity where it is batching FixedUpdate iterations within the same actual millisecond - as opposed to actually scheduling them? Or is this an Oculus SDK issue?
Thanks in advance,
Ben
ovrTrackingState ss = HMD.GetTrackingState();
ax = ss.RawSensorData.Accelerometer.x;
ay = ss.RawSensorData.Accelerometer.y;
az = ss.RawSensorData.Accelerometer.z;
I have code to buffer this data per tick and flush it to disk. Example subset of the data (time, accelx, accely, accelz):
0.353 -0.03393399 9.838906 -0.4828066
0.354 -0.03393399 9.838906 -0.4828066
0.355 -0.03393399 9.838906 -0.4828066
0.356 -0.03393399 9.838906 -0.4828066
0.357 0.1041964 9.800008 -0.4017263
0.358 0.1041964 9.800008 -0.4017263
0.359 0.1041964 9.800008 -0.4017263
0.36 0.1041964 9.800008 -0.4017263
0.361 0.1041964 9.800008 -0.4017263
0.362 0.1041964 9.800008 -0.4017263
As you can see.. I get the same data over a non trivial time period. Is this some quirk / feature of Unity where it is batching FixedUpdate iterations within the same actual millisecond - as opposed to actually scheduling them? Or is this an Oculus SDK issue?
Thanks in advance,
Ben
