Skip to content

Commit 71334c8

Browse files
authored
Merge pull request #6795 from iNavFlight/avs-altitude-debug
Altitude debug mode
2 parents c26a676 + 1b8d890 commit 71334c8

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

src/main/build/debug.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,5 +82,6 @@ typedef enum {
8282
DEBUG_DYNAMIC_GYRO_LPF,
8383
DEBUG_FW_D,
8484
DEBUG_IMU2,
85+
DEBUG_ALTITUDE,
8586
DEBUG_COUNT
8687
} debugType_e;

src/main/fc/settings.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ tables:
8787
"FLOW", "SBUS", "FPORT", "ALWAYS", "SAG_COMP_VOLTAGE",
8888
"VIBE", "CRUISE", "REM_FLIGHT_TIME", "SMARTAUDIO", "ACC",
8989
"ERPM", "RPM_FILTER", "RPM_FREQ", "NAV_YAW", "DYNAMIC_FILTER", "DYNAMIC_FILTER_FREQUENCY",
90-
"IRLOCK", "CD", "KALMAN_GAIN", "PID_MEASUREMENT", "SPM_CELLS", "SPM_VS600", "SPM_VARIO", "PCF8574", "DYN_GYRO_LPF", "FW_D", "IMU2"]
90+
"IRLOCK", "CD", "KALMAN_GAIN", "PID_MEASUREMENT", "SPM_CELLS", "SPM_VS600", "SPM_VARIO", "PCF8574", "DYN_GYRO_LPF", "FW_D", "IMU2", "ALTITUDE"]
9191
- name: async_mode
9292
values: ["NONE", "GYRO", "ALL"]
9393
- name: aux_operator

src/main/navigation/navigation_pos_estimator.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,15 @@ static bool estimationCalculateCorrection_Z(estimationContext_t * ctx)
612612
return true;
613613
}
614614

615+
DEBUG_SET(DEBUG_ALTITUDE, 0, posEstimator.est.pos.z); // Position estimate
616+
DEBUG_SET(DEBUG_ALTITUDE, 2, posEstimator.baro.alt); // Baro altitude
617+
DEBUG_SET(DEBUG_ALTITUDE, 4, posEstimator.gps.pos.z); // GPS altitude
618+
DEBUG_SET(DEBUG_ALTITUDE, 6, accGetVibrationLevel()); // Vibration level
619+
DEBUG_SET(DEBUG_ALTITUDE, 1, posEstimator.est.vel.z); // Vertical speed estimate
620+
DEBUG_SET(DEBUG_ALTITUDE, 3, posEstimator.imu.accelNEU.z); // Vertical acceleration on earth frame
621+
DEBUG_SET(DEBUG_ALTITUDE, 5, posEstimator.gps.vel.z); // GPS vertical speed
622+
DEBUG_SET(DEBUG_ALTITUDE, 7, accGetClipCount()); // Clip count
623+
615624
return false;
616625
}
617626

0 commit comments

Comments
 (0)