32 #include "generated/airframe.h"
42 #define AOA_OFFSET M_PI
46 #define AOA_FILTER 0.5
50 #define AOA_SENS ((2.0*M_PI)/1024)
56 #ifndef ADC_CHANNEL_AOA
57 #error "ADC_CHANNEL_AOA needs to be defined to use AOA_adc module"
60 #ifndef ADC_CHANNEL_AOA_NB_SAMPLES
61 #define ADC_CHANNEL_AOA_NB_SAMPLES DEFAULT_AV_NB_SAMPLE
77 static float prev_aoa = 0.0;
void aoa_adc_update(void)
float filter
Filtering value [0-1] 0: no filtering 1: output is a constant value.
Angle of Attack sensor via ADC.
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
uint32_t raw
raw ADC value
static void stateSetAngleOfAttack_f(float aoa)
Set angle of attack in radians (float).
float sens
sensitiviy, i.e. scale to conver raw to angle
#define AOA_OFFSET
Default offset value (assuming 0 AOA is in the middle of the range)
void adc_buf_channel(uint8_t adc_channel, struct adc_buf *s, uint8_t av_nb_sample)
Registers a buffer to be used to store the specified converted channel Usage:
#define AOA_SENS
Default sensitivity (2*pi on a 10 bit ADC)
#define DefaultChannel
SITL.
API to get/set the generic vehicle states.
float offset
Angle of attack offset in radians.
Common code for AP and FBW telemetry.
#define AOA_FILTER
Default filter value.
#define ADC_CHANNEL_AOA_NB_SAMPLES
float angle
Angle of attack in radians.