So I wrote a sketch using Dr Owens tutorial to see the sensor values the ardupilot 2.6 was outputting. When I upload the code to the ardupilot and run serial monitor, my pitch goes to -2.1 and stays there. My roll goes to -1.4 and stops there. My yaw is the worst. It just keeps incrementing towards negative. I do not move the APM at all. It is completely stationary when I initialise it. Could it be the code I'm using. I also took off the cover of the board and put it back on. Could that be it. Has anyone else had this problem before?
PS, I using the libraries Dr Owen posted on his "How to proram your own Autopilot" tutorial.
Also, my Pitch is confined to -88<P<88.
I wasnt having any issues yesterday
My code is below
// MPU6050 accel/gyro chip
const AP_HAL::HAL& hal = AP_HAL_AVR_APM2; // Hardware abstraction layer
// Turn off Barometer to avoid bus collisions
// Turn on MPU6050 - quad must be kept still as gyros will calibrate
// initialise sensor fusion on MPU6050 chip (aka DigitalMotionProcessing/DMP)
hal.scheduler->suspend_timer_procs(); // stop bus collisions
// We're ready to go! Now over to loop()
// Ask MPU6050 for orientation
ins.quaternion.to_euler(&roll, &pitch, &yaw);
roll = ToDeg(roll) ;
pitch = ToDeg(pitch) ;
yaw = ToDeg(yaw) ;
// Ask MPU6050 for gyro data
Vector3f gyro = ins.get_gyro();
float gyroPitch = ToDeg(gyro.y), gyroRoll = ToDeg(gyro.x), gyroYaw = ToDeg(gyro.z);
PSTR("P:%4.1f R:%4.1f Y:%4.1f\n"),