27 #include "uavcan/uavcan.h"
31 #ifndef AIRSPEED_UAVCAN_SEND_ABI
32 #define AIRSPEED_UAVCAN_SEND_ABI true
36 #ifndef AIRSPEED_UAVCAN_DIFF_P_SCALE
37 #define AIRSPEED_UAVCAN_DIFF_P_SCALE 1.0f
41 #ifdef USE_AIRSPEED_UAVCAN_LOWPASS_FILTER
44 #ifndef AIRSPEED_UAVCAN_LOWPASS_TAU
45 #define AIRSPEED_UAVCAN_LOWPASS_TAU 0.15
48 #ifndef AIRSPEED_UAVCAN_LOWPASS_PERIOD
49 #define AIRSPEED_UAVCAN_LOWPASS_PERIOD 0.1
56 #define UAVCAN_EQUIPMENT_AIR_DATA_RAWAIRDATA_ID 1027
57 #define UAVCAN_EQUIPMENT_AIR_DATA_RAWAIRDATA_SIGNATURE (0xC77DF38BA122F5DAULL)
58 #define UAVCAN_EQUIPMENT_AIR_DATA_RAWAIRDATA_MAX_SIZE ((397 + 7)/8)
64 #if PERIODIC_TELEMETRY
77 pprz_msg_send_AIRSPEED_RAW(trans,
dev,AC_ID,
100 float static_air_temp = canardConvertFloat16ToNativeFloat(tmp_float);
110 #ifdef USE_AIRSPEED_UAVCAN_LOWPASS_FILTER
118 #if AIRSPEED_UAVCAN_SEND_ABI
123 if(!isnan(static_air_temp)) {
125 #if AIRSPEED_UAVCAN_SEND_ABI
137 #ifdef USE_AIRSPEED_UAVCAN_LOWPASS_FILTER
144 #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
#define UAVCAN_EQUIPMENT_AIR_DATA_RAWAIRDATA_SIGNATURE
void airspeed_uavcan_init(void)
#define UAVCAN_EQUIPMENT_AIR_DATA_RAWAIRDATA_ID
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[]
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 int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
int transfer(const Mat *from, const image_t *to)