31 #include "message_pragmas.h"
33 #ifndef INS_FINV_FILTER_ID
34 #define INS_FINV_FILTER_ID 2
43 #if PERIODIC_TELEMETRY && !INS_FINV_USE_UTM
50 pprz_msg_send_INS_REF(trans, dev, AC_ID,
66 if (t_diff > 50000) { mde = 5; }
67 pprz_msg_send_STATE_FILTER_STATUS(trans, dev, AC_ID, &
id, &mde, &val);
76 #ifndef INS_FINV_BARO_ID
78 #define INS_FINV_BARO_ID BARO_BOARD_SENDER_ID
80 #define INS_FINV_BARO_ID ABI_BROADCAST
86 #ifndef INS_FINV_IMU_ID
87 #define INS_FINV_IMU_ID ABI_BROADCAST
92 #ifndef INS_FINV_MAG_ID
93 #define INS_FINV_MAG_ID ABI_BROADCAST
119 #if USE_AUTO_INS_FREQ || !defined(INS_PROPAGATE_FREQUENCY)
124 if (last_stamp > 0) {
125 float dt = (float)(stamp - last_stamp) * 1e-6;
130 PRINT_CONFIG_MSG(
"Using fixed INS_PROPAGATE_FREQUENCY for INS float_invariant propagation.")
131 PRINT_CONFIG_VAR(INS_PROPAGATE_FREQUENCY)
132 const float dt = 1. / (INS_PROPAGATE_FREQUENCY);
140 uint32_t stamp __attribute__((unused)),
147 uint32_t stamp __attribute__((unused)),
156 uint32_t stamp __attribute__((unused)),
177 uint32_t stamp __attribute__((unused)),
198 #if PERIODIC_TELEMETRY && !INS_FINV_USE_UTM
static void accel_cb(uint8_t sender_id, uint32_t stamp, struct Int32Vect3 *accel)
void ins_float_invariant_update_mag(struct Int32Vect3 *mag)
Event structure to store callbacks in a linked list.
static abi_event aligner_ev
#define INS_FINV_IMU_ID
IMU (gyro, accel)
void ins_float_invariant_propagate(struct Int32Rates *gyro, struct Int32Vect3 *accel, float dt)
static void aligner_cb(uint8_t sender_id, uint32_t stamp, struct Int32Rates *lp_gyro, struct Int32Vect3 *lp_accel, struct Int32Vect3 *lp_mag)
static void body_to_imu_cb(uint8_t sender_id, struct FloatQuat *q_b2i_f)
static void gyro_cb(uint8_t sender_id, uint32_t stamp, struct Int32Rates *gyro)
Call ins_float_invariant_propagate on new gyro measurements.
Generic transmission transport header.
static abi_event geo_mag_ev
Periodic telemetry system header (includes downlink utility and generated code).
void ins_float_invariant_register(void)
Main include for ABI (AirBorneInterface).
void ins_float_invariant_update_gps(struct GpsState *gps_s)
struct EcefCoor_i ecef
Reference point in ecef.
int32_t hmsl
Height above mean sea level in mm.
int32_t alt
in millimeters above WGS84 reference ellipsoid
static uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
Paparazzi specific wrapper to run INVARIANT filter.
#define INS_FINV_MAG_ID
magnetometer
Architecture independent timing functions.
static struct Int32Vect3 ins_finv_accel
last accel measurement
data structure for GPS information
static abi_event accel_ev
PRINT_CONFIG_MSG("USE_INS_NAV_INIT defaulting to TRUE")
static void geo_mag_cb(uint8_t sender_id, struct FloatVect3 *h)
struct LlaCoor_i lla
Reference point in lla.
#define DefaultPeriodic
Set default periodic telemetry.
int32_t lon
in degrees*1e7
static const struct usb_device_descriptor dev
struct LtpDef_i ned_origin_i
Definition of the local (flat earth) coordinate system.
void ins_float_invariant_update_baro(float pressure)
static abi_event body_to_imu_ev
static void mag_cb(uint8_t sender_id, uint32_t stamp, struct Int32Vect3 *mag)
void ins_float_inv_set_body_to_imu_quat(struct FloatQuat *q_b2i)
API to get/set the generic vehicle states.
static void gps_cb(uint8_t sender_id, uint32_t stamp, struct GpsState *gps_s)
#define ABI_BROADCAST
Broadcast address.
void ins_float_invariant_align(struct Int32Rates *lp_gyro, struct Int32Vect3 *lp_accel, struct Int32Vect3 *lp_mag)
bool_t ned_initialized_i
true if local int coordinate frame is initialsed
static uint32_t ins_finv_last_stamp
last gyro msg timestamp
int32_t lat
in degrees*1e7
struct InsFloatInv ins_float_inv
void ins_register_impl(InsInit init)
#define INS_FINV_FILTER_ID
void ins_float_invariant_init(void)
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.
static void baro_cb(uint8_t sender_id, float pressure)
#define INS_FINV_BARO_ID
baro