I was testing the AHRS code and while it seems the arduino code is working properly, Python code seems to have pitch and roll axis flipped and I don’t know how to change this.
In the Arduino AHRS code, if I use the default axis setting:
int SENSOR_SIGN[9] = {1,1,1,-1,-1,-1,1,1,1};
Then there’s massive drift with the gyroscope and incorrect yaw.
But if I use the next setting:
int SENSOR_SIGN[9] = {1,-1,-1,-1,1,1,1,-1,-1};
The sensor is very responsive and yaw works correctly. The only problem is that pitch and roll are flipped. If I tilt the pitch nose down, the python script draws nose pitch up. Roll is flipped likewise.
I tried changing each axis setting in the Arduino code but it doesn’t seem to be having any positive effect. When making changes, I made sure I consider each axis in each sensors in the code above. x,y,z,x,y,z,x,y,z
I have already calibrated the magnetometer using the Arduino library for lsm303.