27#include "uavcan/uavcan.h"
29#include "uavcan.equipment.air_data.RawAirData.h"
32#ifndef AIRSPEED_UAVCAN_SEND_ABI
33#define AIRSPEED_UAVCAN_SEND_ABI true
37#ifndef AIRSPEED_UAVCAN_DIFF_P_SCALE
38#define AIRSPEED_UAVCAN_DIFF_P_SCALE 1.0f
42#ifdef USE_AIRSPEED_UAVCAN_LOWPASS_FILTER
45#ifndef AIRSPEED_UAVCAN_LOWPASS_TAU
46#define AIRSPEED_UAVCAN_LOWPASS_TAU 0.15
49#ifndef AIRSPEED_UAVCAN_LOWPASS_PERIOD
50#define AIRSPEED_UAVCAN_LOWPASS_PERIOD 0.1
91 float diff_p =
msg.differential_pressure;
101#ifdef USE_AIRSPEED_UAVCAN_LOWPASS_FILTER
109#if AIRSPEED_UAVCAN_SEND_ABI
116#if AIRSPEED_UAVCAN_SEND_ABI
128#ifdef USE_AIRSPEED_UAVCAN_LOWPASS_FILTER
135#if PERIODIC_TELEMETRY
Main include for ABI (AirBorneInterface).
static void airspeed_uavcan_cb(struct uavcan_iface_t *iface, CanardRxTransfer *transfer)
#define AIRSPEED_UAVCAN_DIFF_P_SCALE
static void airspeed_uavcan_downlink(struct transport_tx *trans, struct link_device *dev)
void airspeed_uavcan_autoset_offset(bool set)
struct airspeed_uavcan_t airspeed_uavcan
static uavcan_event airspeed_uavcan_ev
void airspeed_uavcan_init(void)
Airspeed sensor on the uavcan bus.
float temperature
Temperature in Celsius.
float diff_p_offset
Differential pressure offset.
float diff_p
Differential pressure.
float diff_p_scale
Differential pressure scale.
Main uavcan event structure for registering/calling callbacks.
static const float offset[]
uint8_t msg[10]
Buffer used for general comunication over SPI (out buffer)
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.
static float sign(float x)
sign function
uavcan interface structure
static const struct usb_device_descriptor dev
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_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.
void uavcan_bind(uint16_t data_type_id, uint64_t data_type_signature, uavcan_event *ev, uavcan_callback cb)
Bind to a receiving message from uavcan.
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
int transfer(const Mat *from, const image_t *to)