File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -66,9 +66,10 @@ impl OrientationFilter {
6666 let angular_velocity_sum = measured_angular_velocity. abs ( ) . inner . sum ( ) ;
6767
6868 let mut recalibrated_this_cycle = false ;
69+ let is_steady = angular_velocity_sum < * context. calibration_steady_threshold ;
6970 match & mut self . calibration_state {
7071 State :: WaitingForSteady => {
71- if angular_velocity_sum < * context . calibration_steady_threshold {
72+ if is_steady {
7273 self . calibration_state = State :: CalibratingGravity {
7374 filtered_gravity : LowPassFilter :: with_smoothing_factor (
7475 measured_acceleration,
@@ -82,7 +83,7 @@ impl OrientationFilter {
8283 filtered_gravity,
8384 number_of_cycles,
8485 } => ' update: {
85- if angular_velocity_sum >= * context . calibration_steady_threshold {
86+ if !is_steady {
8687 self . calibration_state = State :: WaitingForSteady ;
8788 break ' update;
8889 }
You can’t perform that action at this time.
0 commit comments