diff options
author | Joshua Allen <axlecrusher@gmail.com> | 2017-05-05 15:50:41 -0400 |
---|---|---|
committer | Joshua Allen <axlecrusher@gmail.com> | 2017-05-05 15:50:41 -0400 |
commit | d53ef13d5f8154d225c9f763131129d179db2441 (patch) | |
tree | f1b9e450c15b3b548b7bd500d5fde3026330e6aa /src/survive_vive.c | |
parent | 29c36df48dd824b98d4d61c021ed63eced82f981 (diff) | |
download | libsurvive-d53ef13d5f8154d225c9f763131129d179db2441.tar.gz libsurvive-d53ef13d5f8154d225c9f763131129d179db2441.tar.bz2 |
calibration values from MPU-6500 datasheet.
I'm pretty sure the accelerometer values are correct.
The gyroscope values may not be correct.
Diffstat (limited to 'src/survive_vive.c')
-rwxr-xr-x | src/survive_vive.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/survive_vive.c b/src/survive_vive.c index 030db8a..88b9fee 100755 --- a/src/survive_vive.c +++ b/src/survive_vive.c @@ -1127,6 +1127,17 @@ void survive_data_cb( SurviveUSBInterface * si ) acceldata[3], acceldata[4], acceldata[5], 0,0,0 }; + //1G for accelerometer, from MPU6500 datasheet + //this can change if the firmware changes the sensitivity. + agm[0]/=8192.0f; + agm[1]/=8192.0f; + agm[2]/=8192.0f; + + //1000 deg/s for gyroscope, from MPU6500 datasheet + agm[3]/=65.5f; + agm[4]/=65.5f; + agm[5]/=65.5f; + ctx->imuproc( obj, 3, agm, timecode, code ); } } |