|
@@ -67,6 +67,8 @@ Smoothed<float> yaw_smooth;
|
|
|
Smoothed<float> pitch_smooth;
|
|
|
Smoothed<float> roll_smooth;
|
|
|
|
|
|
+ResponsiveAnalogRead gyro_rar(-1, false, 0.000001);
|
|
|
+
|
|
|
ResponsiveAnalogRead yaw_rar(-1, true, 0.001);
|
|
|
ResponsiveAnalogRead pitch_rar(-1, true);
|
|
|
ResponsiveAnalogRead roll_rar(-1, true);
|
|
@@ -209,6 +211,7 @@ void setup_imu()
|
|
|
pitch_smooth.begin(SMOOTHED_EXPONENTIAL, 10);
|
|
|
roll_smooth.begin(SMOOTHED_EXPONENTIAL, 10);
|
|
|
|
|
|
+ gyro_rar.setAnalogResolution(4096);
|
|
|
yaw_rar.setAnalogResolution(3600);
|
|
|
pitch_rar.setAnalogResolution(3600);
|
|
|
roll_rar.setAnalogResolution(3600);
|
|
@@ -285,6 +288,7 @@ void handle_imu()
|
|
|
pitch_smooth.add(pitch);
|
|
|
roll_smooth.add(roll);
|
|
|
|
|
|
+ gyro_rar.update(gyroZ + 2048);
|
|
|
|
|
|
yaw_rar.update(10.*yaw);
|
|
|
pitch_rar.update((int)10*pitch);
|