File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -580,6 +580,7 @@ void imuCheckVibrationLevels(void)
580
580
DEBUG_SET (DEBUG_VIBE , 1 , accVibeLevels .y * 100 );
581
581
DEBUG_SET (DEBUG_VIBE , 2 , accVibeLevels .z * 100 );
582
582
DEBUG_SET (DEBUG_VIBE , 3 , accClipCount );
583
+ // DEBUG_VIBE values 4-7 are used by NAV estimator
583
584
}
584
585
585
586
void FAST_CODE NOINLINE imuUpdateAttitude (timeUs_t currentTimeUs )
Original file line number Diff line number Diff line change 25
25
#if defined(USE_NAV )
26
26
27
27
#include "build/build_config.h"
28
+ #include "build/debug.h"
28
29
29
30
#include "common/axis.h"
30
31
#include "common/log.h"
@@ -367,12 +368,17 @@ static void updateIMUEstimationWeight(const float dt)
367
368
const float relAlpha = dt / (dt + INAV_ACC_CLIPPING_RC_CONSTANT );
368
369
posEstimator .imu .accWeightFactor = posEstimator .imu .accWeightFactor * (1.0f - relAlpha ) + 1.0f * relAlpha ;
369
370
}
371
+
372
+ // DEBUG_VIBE[0-3] are used in IMU
373
+ DEBUG_SET (DEBUG_VIBE , 4 , posEstimator .imu .accWeightFactor * 1000 );
370
374
}
371
375
372
376
float navGetAccelerometerWeight (void )
373
377
{
374
- // TODO(digitalentity): consider accelerometer health in weight calculation
375
- return posEstimator .imu .accWeightFactor * positionEstimationConfig ()-> w_xyz_acc_p ;
378
+ const float accWeightScaled = posEstimator .imu .accWeightFactor * positionEstimationConfig ()-> w_xyz_acc_p ;
379
+ DEBUG_SET (DEBUG_VIBE , 5 , accWeightScaled * 1000 );
380
+
381
+ return accWeightScaled ;
376
382
}
377
383
378
384
static void updateIMUTopic (timeUs_t currentTimeUs )
You can’t perform that action at this time.
0 commit comments