I'm using the 9150 and the axes for how how it's mounted on my PCB are different from the default Invensense mounting. The documentation says to use the orientation matrix (or Axis Transformation Matrix) to perform this transformation. My problem is that making any changes at all to the gyro_pdata.orientation matrix introduces significant drift. If the matrix is left as the default orientation it works fine, there is almost no drift in my 3D model.
static struct platform_data_s gyro_pdata = {
.orientation = { 1, 0, 0,
0, 1, 0,
0, 0, 1}
};
But say if I want to swap and negate x and y, my 3D model will start to drift significantly.
static struct platform_data_s gyro_pdata = {
.orientation = { 0, -1, 0,
-1, 0, 0,
0, 0, 1}
};
The gyro_pdata.orientation matrix is set as the orientation for both the accelerometer and gyro.
The DMP documentation says that the orientation matrix is the only thing that needs to be changed when changing the chip mounting orientation. I was wondering if anyone else has experience this issue and how they fixed it?
Thanks.