Fix rawdata z axis
This commit is contained in:
parent
d579c0dcf5
commit
f8f279563f
2 changed files with 4 additions and 4 deletions
|
|
@ -15,8 +15,8 @@
|
||||||
#if defined(LINUX)
|
#if defined(LINUX)
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <GL/gl.h>
|
#include <GL/gl.h> // sudo apt install mesa-common-dev
|
||||||
#include <GL/glu.h>
|
#include <GL/glu.h> // sudo apt install libglu1-mesa-dev freeglut3-dev
|
||||||
#elif defined(WINDOWS)
|
#elif defined(WINDOWS)
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <GL/gl.h>
|
#include <GL/gl.h>
|
||||||
|
|
|
||||||
|
|
@ -186,10 +186,10 @@ void raw_data(const int16_t *data)
|
||||||
z = (float)data[2] * G_PER_COUNT;
|
z = (float)data[2] * G_PER_COUNT;
|
||||||
accel.GpFast[0] = x;
|
accel.GpFast[0] = x;
|
||||||
accel.GpFast[1] = y;
|
accel.GpFast[1] = y;
|
||||||
accel.GpFast[2] = y;
|
accel.GpFast[2] = z;
|
||||||
accel.Gp[0] += x;
|
accel.Gp[0] += x;
|
||||||
accel.Gp[1] += y;
|
accel.Gp[1] += y;
|
||||||
accel.Gp[2] += y;
|
accel.Gp[2] += z;
|
||||||
|
|
||||||
x = (float)data[3] * DEG_PER_SEC_PER_COUNT;
|
x = (float)data[3] * DEG_PER_SEC_PER_COUNT;
|
||||||
y = (float)data[4] * DEG_PER_SEC_PER_COUNT;
|
y = (float)data[4] * DEG_PER_SEC_PER_COUNT;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue