HomeForum Home → Hardware → Camera & Sensors → Thread

   

IMU data units and data sheet

Rank

Total Posts: 1

Joined 2014-10-19

PM

I am unable to find any information on how to interpret the values from the IMU, can you please offer a detailed explanation and perhaps information (data sheet) on the specific hardware unit in the mini lx?

G, degs/sec, etc. 

Thanks

     
Avatar
RankRankRank

Total Posts: 58

Joined 2012-06-01

PM

As we know from the docs we have:

pFrameData->accelerometerPresent - Flag for check if a MPU sensor is available.
pFrameData->accelData[0,1,2] - Array containing the accelerometer data (x,y,z)
pFrameData->gyroData[0,1,2] - Array containing the gyroscope data (x,y,z)
pFrameData->tempData - Float with the temperature data (0.0C)

First its good to allow for up to 100 frames to pass before using the IMU data as it takes time to initialize.

Accessing the data is rather straight forward and can be put into a standard Vector3D structure.

Vector3D(pFrameData->accelData[0], pFrameData->accelData[1], pFrameData->accelData[2]
Vector3D(pFrameData->gyroData[0] - gyroOffsetX, pFrameData->gyroData[1] - gyroOffsetY, pFrameData->gyroData[2] - gyroOffsetZ)

Next set up some vars to keep track of the timeDelta:

static float prevTime = 0;
float timeNow = pFrameData->timeStamp / 10000.0f;
float deltaTime = timeNow - prevTime;
prevTime = timeNow;

With these two things in place you can determine angle by fusing the accel and gryoscope data and knowing the time difference. I’ll follow up with a bit more details.