Eigen Revision
Dependencies: mbed LPS25HB_I2C LSM9DS1 PIDcontroller Autopilot_Eigen LoopTicker GPSUBX_UART_Eigen SBUS_without_mainfile MedianFilter Eigen UsaPack solaESKF_Eigen Vector3 CalibrateMagneto FastPWM
Diff: main.cpp
- Revision:
- 14:468ccb88e387
- Parent:
- 13:ac7c1c861aaf
- Child:
- 15:6abaac6e5b03
--- a/main.cpp Thu Jan 28 04:11:38 2021 +0000 +++ b/main.cpp Thu Jan 28 04:41:40 2021 +0000 @@ -17,6 +17,8 @@ float pitch = 0.0; float roll = 0.0; float yaw = 0.0; +float gyro[3] = {0,0,0}; +float acc[3] = {0,0,1.0}; int out1, out2; long map(long x, long in_min, long in_max, long out_min, long out_max) @@ -59,11 +61,16 @@ void interrupt_Gyro() { - filter.updateFilter(0, 0, 0, 0, 0, 1.0); + // gx gy gz ax ay az + mpu.getGyro(gyor); + mpu.getAccelero(acc); + filter.updateFilter(gyro[0],gyro[1],gyro[2],acc[0],acc[1],acc[2]); } int main() { + mpu.setAcceleroRange(MPU6050_ACCELERO_RANGE_8G); + mpu.setGyroRange(MPU6050_GYRO_RANGE_250) pc.baud(9600); servo1.period(0.020); servo2.period(0.020);