30#include "generated/airframe.h"
35#include "pprzlink/messages.h"
40#ifndef AOA_ANGLE_OFFSET
41#define AOA_ANGLE_OFFSET M_PI
46#define AOA_T4_OFFSET 0.0f
50#ifndef AOA_T4_USE_FILTER
51#define AOA_T4_USE_FILTER FALSE
60#define AOA_T4_FILTER 0.15f
71#ifndef AOA_T4_SYNC_SEND
72#define AOA_T4_SYNC_SEND FALSE
76#ifndef AOA_T4_SERVO_ID
77#error "No AOA_T4_SERVO_ID defined, however it must be defined to be able to use the aoa_t4 module"
80#ifdef AOA_T4_USE_FILTER
82#ifndef AOA_T4_FILTER_SAMPLING_TIME
83#define AOA_T4_FILTER_SAMPLING_TIME 0.0005
90#ifndef AOA_T4_USE_COMPENSATION
91#define AOA_T4_USE_COMPENSATION FALSE
98#define AOA_T4_COMP_A1 0.0f
101#ifndef AOA_T4_COMP_B1
102#define AOA_T4_COMP_B1 0.0f
105#ifndef AOA_T4_COMP_A2
106#define AOA_T4_COMP_A2 -0.5457f
109#ifndef AOA_T4_COMP_B2
110#define AOA_T4_COMP_B2 0.0f
116#ifndef SSA_ANGLE_OFFSET
117#define SSA_ANGLE_OFFSET M_PI
122#define SSA_T4_OFFSET 0.0f
126#ifndef SSA_T4_USE_FILTER
127#define SSA_T4_USE_FILTER FALSE
131#define SSA_T4_FILTER 0.20f
135#define SSA_T4_SIGN -1
140#ifdef SSA_T4_USE_FILTER
159#if PERIODIC_TELEMETRY
241#ifdef SSA_T4_SERVO_ID
324#if PERIODIC_TELEMETRY
331#if USE_AOA || USE_SIDESLIP
341#if AOA_T4_USE_COMPENSATION
376#if USE_AOA || USE_SIDESLIP
Main include for ABI (AirBorneInterface).
#define ABI_BROADCAST
Broadcast address.
Event structure to store callbacks in a linked list.
Aoa_Type
Selection of sensor type to be send over telemetry.
Butterworth2LowPass aoa_t4_lowpass_filter
Servo ID to use for the modified servo as AOA sensor.
#define AOA_T4_FILTER
Default filter value for reasonable minimum filtering.
void aoa_t4_init_filters(void)
#define AOA_T4_OFFSET
Small offset value in radians to get the sensor perfectly lined out.
struct FloatEulers eulers_t4
Butterworth2LowPass ssa_t4_lowpass_filter
#define SSA_T4_OFFSET
Small offset value in radians to get the sensor perfectly lined out.
struct ActuatorsT4In actuators_t4_in_local
void ssa_t4_init_filters(void)
#define SSA_ANGLE_OFFSET
Default offset value (assuming 0 SSA is in the middle of the range)
#define AOA_T4_SIGN
To set reverse direction on readings use true.
static void actuators_t4_abi_in(uint8_t sender_id, struct ActuatorsT4In *actuators_t4_in_ptr, float *actuators_t4_extra_data_in_ptr)
static abi_event ACTUATORS_T4_IN
#define AOA_ANGLE_OFFSET
Default offset value (assuming 0 AOA is in the middle of the range)
enum Aoa_Type aoa_send_type
uint32_t convert_angle_x100_to_raw(int16_t angle)
static void send_aoa(struct transport_tx *trans, struct link_device *dev)
#define AOA_T4_FILTER_SAMPLING_TIME
Angle of Attack and optionally Sideslip Angle sensor using T4 Actuators Board and a modified serial b...
float angle
Angle of attack in radians after applying direction and offset.
float filter
Filter level for sensor output, where 0.0 is no filtering and 0.95 for extreme filtering,...
float offset
Angle of attack offset in radians.
uint32_t raw
Measurement in degrees times 100 from the sensor before applying direction and offset and unit scale ...
void float_eulers_of_quat_zxy(struct FloatEulers *e, struct FloatQuat *q)
euler rotation 'ZXY' This rotation order is useful if you need 90 deg pitch
static struct FloatQuat * stateGetNedToBodyQuat_f(void)
Get vehicle body attitude quaternion (float).
Simple first order low pass filter with bilinear transform.
static void init_butterworth_2_low_pass(Butterworth2LowPass *filter, float tau, float sample_time, float value)
Init a second order Butterworth filter.
static float update_butterworth_2_low_pass(Butterworth2LowPass *filter, float value)
Update second order Butterworth low pass filter state with a new value.
Second order low pass filter structure.
API to get/set the generic vehicle states.
static const struct usb_device_descriptor dev
int16_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint16_t _id, telemetry_cb _cb)
Register a telemetry callback function.
Periodic telemetry system header (includes downlink utility and generated code).
#define DefaultPeriodic
Set default periodic telemetry.
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
int int32_t
Typedef defining 32 bit int type.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
short int16_t
Typedef defining 16 bit short type.
unsigned long long uint64_t
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.