HAPSRG / Mbed 2 deprecated HAPStail

Dependencies:   mbed MatrixMath LPS25HB_I2C LSM9DS1 Matrix2 PIDcontroller LoopTicker SBUS_without_mainfile UsaPack solaESKF_wind Vector3 CalibrateMagneto FastPWM

Revision:
79:aa2631950f46
Parent:
76:f6617891a867
Child:
84:028bd650e8bc
diff -r 2b9f268ad84c -r aa2631950f46 run.cpp
--- a/run.cpp	Wed Sep 29 03:20:39 2021 +0000
+++ b/run.cpp	Wed Sep 29 06:32:46 2021 +0000
@@ -78,23 +78,14 @@
         getIMUval();
         ekf.updateNominal(gyro,acc,accref,att_dt);
         ekf.updateErrState(gyro,acc, att_dt);
-        if(obsCount == 50){
-            if(ekf.determinDynStatus(acc,accref)){
-                ekf.updateMeasures(gyro,acc,accref);
-            }else{
-                ekf.updateStaticMeasures(gyro,acc,accref);
-            }
-            obsCount = 0;
-        }else{
-            if(ekf.determinDynStatus(acc,accref)){
-                ekf.updateAccMeasures(acc,accref);
-            }else{   
-                ekf.updateStaticAccMeasures(acc,accref);
-            }
-            obsCount += 1;
+        if(ekf.determinDynStatus(acc,accref)){
+            ekf.updateAccMeasures(acc,accref);
+        }else{   
+            ekf.updateStaticAccMeasures(acc,accref);
         }
-        
-        ekf.updateGPSVelocity(0.0f,0.0f);
+        if(itowVEL_log == updateValues.gps_itowVEL){
+            ekf.updateGPSVelocity(updateValues.vgps[0],updateValues.vgps[1],updateValues.vgps[2],acc,accref);
+        }
         
         ekf.updateGyroBiasConstraints(gyro);
         ekf.fuseErr2Nominal();