31#include "message_pragmas.h"
36#ifndef INS_FINV_FILTER_ID
37#define INS_FINV_FILTER_ID 2
46#if PERIODIC_TELEMETRY && !INS_FINV_USE_UTM
52 if (
state.ned_initialized_i) {
56 pprz_msg_send_INS_REF(trans,
dev, AC_ID, &ecef.
x, &ecef.
y, &ecef.
z, &lla.
lat, &lla.
lon, &lla.
alt, &hmsl, &
foo);
68 if (t_diff > 50000) { mde = 5; }
69 pprz_msg_send_STATE_FILTER_STATUS(trans,
dev, AC_ID, &
id, &mde, &
val);
78#ifndef INS_FINV_BARO_ID
79#define INS_FINV_BARO_ID AIR_DATA_SENDER_ID
84#ifndef INS_FINV_IMU_ID
85#define INS_FINV_IMU_ID ABI_BROADCAST
91#ifndef INS_FINV_MAG_ID
92#define INS_FINV_MAG_ID ABI_BROADCAST
102#ifndef INS_FINV_GPS_ID
103#define INS_FINV_GPS_ID GPS_MULTI_ID
140#if USE_AUTO_INS_FREQ || !defined(INS_PROPAGATE_FREQUENCY)
145 if (last_stamp > 0) {
146 float dt = (float)(stamp - last_stamp) * 1e-6;
151 PRINT_CONFIG_MSG(
"Using fixed INS_PROPAGATE_FREQUENCY for INS float_invariant propagation.")
153 const float dt = 1. / (INS_PROPAGATE_FREQUENCY);
161 uint32_t stamp __attribute__((unused)),
168 uint32_t stamp __attribute__((unused)),
186 uint32_t stamp __attribute__((unused)),
203 uint32_t stamp __attribute__((unused)),
245#if PERIODIC_TELEMETRY && !INS_FINV_USE_UTM
static void h(const real32_T x[7], const real32_T q[4], real32_T y[6])
Main include for ABI (AirBorneInterface).
struct abi_struct abi_event
#define ABI_BROADCAST
Broadcast address.
void ahrs_aligner_init(void)
static void gyro_cb(uint8_t sender_id, uint32_t stamp, struct Int32Rates *gyro)
void ahrs_aligner_restart(void)
Interface to align the AHRS via low-passed measurements at startup.
static void gps_cb(uint8_t sender_id, uint32_t stamp, struct GpsState *gps_s)
static void mag_cb(uint8_t sender_id, uint32_t stamp, struct Int32Vect3 *mag)
static abi_event aligner_ev
static abi_event geo_mag_ev
static void send_filter_status(struct transport_tx *trans, struct link_device *dev)
static void geo_mag_cb(uint8_t sender_id, struct FloatVect3 *h)
static void aligner_cb(uint8_t sender_id, uint32_t stamp, struct Int32Rates *lp_gyro, struct Int32Vect3 *lp_accel, struct Int32Vect3 *lp_mag)
uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
static struct uart_periph * dev
static abi_event accel_ev
static void accel_cb(uint8_t sender_id, uint32_t stamp, struct Int32Vect3 *accel)
data structure for GPS information
#define MAGS_FLOAT_OF_BFP(_ef, _ei)
#define RATES_FLOAT_OF_BFP(_rf, _ri)
#define ACCELS_FLOAT_OF_BFP(_ef, _ei)
int32_t lat
in degrees*1e7
int32_t alt
in millimeters above WGS84 reference ellipsoid
int32_t lon
in degrees*1e7
vector in EarthCenteredEarthFixed coordinates
vector in Latitude, Longitude and Altitude
int32_t stateGetHmslOrigin_i(void)
Get the HMSL of the frame origin (int).
struct LlaCoor_i stateGetLlaOrigin_i(void)
Get the LLA position of the frame origin (int).
struct EcefCoor_i stateGetEcefOrigin_i(void)
Get the ECEF position of the frame origin (int).
#define INS_RESET_VERTICAL_REF
#define INS_RESET_REF
flags for INS reset
static void reset_cb(uint8_t sender_id, uint8_t flag)
static abi_event reset_ev
static void baro_cb(uint8_t sender_id, uint32_t stamp, float pressure)
static void send_ins_ref(struct transport_tx *trans, struct link_device *dev)
void ins_float_invariant_reset_ref(void)
void ins_float_invariant_align(struct FloatRates *lp_gyro, struct FloatVect3 *lp_accel, struct FloatVect3 *lp_mag)
void ins_float_invariant_propagate(struct FloatRates *gyro, struct FloatVect3 *accel, float dt)
void ins_float_invariant_init(void)
void ins_float_invariant_update_gps(struct GpsState *gps_s)
void ins_float_invariant_update_mag(struct FloatVect3 *mag)
struct InsFloatInv ins_float_inv
void ins_float_invariant_update_baro(float pressure)
void ins_float_invariant_reset_vertical_ref(void)
static void gps_cb(uint8_t sender_id, uint32_t stamp, struct GpsState *gps_s)
#define INS_FINV_MAG_ID
magnetometer
static void gyro_cb(uint8_t sender_id, uint32_t stamp, struct Int32Rates *gyro)
Call ins_float_invariant_propagate on new gyro measurements.
static void mag_cb(uint8_t sender_id, uint32_t stamp, struct Int32Vect3 *mag)
#define INS_FINV_BARO_ID
baro
static void send_ins_ref(struct transport_tx *trans, struct link_device *dev)
static void reset_cb(uint8_t sender_id UNUSED, uint8_t flag)
#define INS_FINV_IMU_ID
IMU (gyro, accel).
#define INS_FINV_GPS_ID
ABI binding for gps data.
static void send_filter_status(struct transport_tx *trans, struct link_device *dev)
static void baro_cb(uint8_t sender_id, uint32_t stamp, float pressure)
static void accel_cb(uint8_t sender_id, uint32_t stamp, struct Int32Vect3 *accel)
static void geo_mag_cb(uint8_t sender_id, struct FloatVect3 *h)
static void aligner_cb(uint8_t sender_id, uint32_t stamp, struct Int32Rates *lp_gyro, struct Int32Vect3 *lp_accel, struct Int32Vect3 *lp_mag)
void ins_float_invariant_wrapper_init(void)
static uint32_t ins_finv_last_stamp
last gyro msg timestamp
static struct FloatVect3 ins_finv_accel
last accel measurement
#define INS_FINV_FILTER_ID
Paparazzi specific wrapper to run INVARIANT filter.
PRINT_CONFIG_MSG("USE_INS_NAV_INIT defaulting to TRUE")
PRINT_CONFIG_VAR(ONELOOP_ANDI_FILT_CUTOFF)
API to get/set the generic vehicle states.
Architecture independent timing functions.
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.
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
int int32_t
Typedef defining 32 bit int type.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.