mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-26 01:35:35 +03:00
Add WIND_ESTIMATOR debug mode
Uses debug[0-2] to log estimated wind in earth frame X, Y, Z.
This commit is contained in:
parent
c21718bcbd
commit
eb0fd005c1
3 changed files with 8 additions and 1 deletions
|
@ -56,6 +56,7 @@ typedef enum {
|
|||
DEBUG_FLOW_RAW,
|
||||
DEBUG_SBUS,
|
||||
DEBUG_FPORT,
|
||||
DEBUG_WIND_ESTIMATOR,
|
||||
DEBUG_ALWAYS,
|
||||
DEBUG_STAGE2,
|
||||
DEBUG_COUNT
|
||||
|
|
|
@ -67,7 +67,7 @@ tables:
|
|||
- name: i2c_speed
|
||||
values: ["400KHZ", "800KHZ", "100KHZ", "200KHZ"]
|
||||
- name: debug_modes
|
||||
values: ["NONE", "GYRO", "NOTCH", "NAV_LANDING", "FW_ALTITUDE", "AGL", "FLOW_RAW", "SBUS", "FPORT", "ALWAYS", "STAGE2"]
|
||||
values: ["NONE", "GYRO", "NOTCH", "NAV_LANDING", "FW_ALTITUDE", "AGL", "FLOW_RAW", "SBUS", "FPORT", "ALWAYS", "STAGE2", "WIND_ESTIMATOR"]
|
||||
- name: async_mode
|
||||
values: ["NONE", "GYRO", "ALL"]
|
||||
- name: aux_operator
|
||||
|
|
|
@ -18,12 +18,14 @@
|
|||
#include "platform.h"
|
||||
|
||||
#if defined(USE_WIND_ESTIMATOR)
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "build/build_config.h"
|
||||
#include "build/debug.h"
|
||||
|
||||
#include "common/axis.h"
|
||||
#include "common/filter.h"
|
||||
|
@ -145,6 +147,10 @@ void updateWindEstimator(timeUs_t currentTimeUs)
|
|||
estimatedWind[X] = estimatedWind[X] * 0.95f + wind[X] * 0.05f;
|
||||
estimatedWind[Y] = estimatedWind[Y] * 0.95f + wind[Y] * 0.05f;
|
||||
estimatedWind[Z] = estimatedWind[Z] * 0.95f + wind[Z] * 0.05f;
|
||||
|
||||
DEBUG_SET(DEBUG_WIND_ESTIMATOR, 0, estimatedWind[X] * 100);
|
||||
DEBUG_SET(DEBUG_WIND_ESTIMATOR, 1, estimatedWind[Y] * 100);
|
||||
DEBUG_SET(DEBUG_WIND_ESTIMATOR, 2, estimatedWind[Z] * 100);
|
||||
}
|
||||
|
||||
lastUpdateUs = currentTimeUs;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue