47#ifndef DRAGSPEED_SEND_ABI_MESSAGE
48#define DRAGSPEED_SEND_ABI_MESSAGE TRUE
51#ifndef DRAGSPEED_ACCEL_ID
52#define DRAGSPEED_ACCEL_ID ABI_BROADCAST
55#ifndef DRAGSPEED_COEFF_X
56#define DRAGSPEED_COEFF_X 1.0
59#ifndef DRAGSPEED_COEFF_Y
60#define DRAGSPEED_COEFF_Y 1.0
64#define DRAGSPEED_R 0.25
67#ifndef DRAGSPEED_FILTER
68#define DRAGSPEED_FILTER 0.8
88#ifdef DRAGSPEED_ZERO_X
91#ifdef DRAGSPEED_ZERO_Y
94#if defined(DRAGSPEED_ZERO_X) && defined(DRAGSPEED_ZERO_Y)
134#if DRAGSPEED_SEND_ABI_MESSAGE
176 "[dragspeed] Error: zero measurement should be calibrated before drag coefficient!\n");
Main include for ABI (AirBorneInterface).
Common tools for ABI middelware.
Event structure to store callbacks in a linked list.
void dragspeed_init(void)
bool dragspeed_is_calibrating(void)
#define DRAGSPEED_ACCEL_ID
static void calibrate_zero(struct Int32Vect3 *accel)
Calibrate zero velocity by measuring the accelerations while the drone hovers in-place.
static abi_event accel_ev
struct dragspeed_t dragspeed
bool dragspeed_calibrate_coeff(void)
static void send_dragspeed(struct transport_tx *trans, struct link_device *dev)
#define DRAGSPEED_COEFF_X
bool dragspeed_calibrate_zero(void)
static void accel_cb(uint8_t sender_id, uint32_t stamp, struct Int32Vect3 *accel)
static void calibrate_coeff(struct Int32Vect3 *accel)
Calibrate drag coefficient by comparing accelerometer measurements to INS velocities.
#define DRAGSPEED_COEFF_Y
#define ACCEL_FLOAT_OF_BFP(_ai)
static struct FloatEulers * stateGetNedToBodyEulers_f(void)
Get vehicle body attitude euler angles (float).
static struct EnuCoor_f * stateGetSpeedEnu_f(void)
Get ground speed in local ENU coordinates (float).
vector in East North Up coordinates Units: meters
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.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.