30#include "message_pragmas.h"
34#ifndef USE_INS_NAV_INIT
35#define USE_INS_NAV_INIT TRUE
43#ifndef INS_MODULE_BARO_ID
44#define INS_MODULE_BARO_ID AIR_DATA_SENDER_ID
49#ifndef INS_MODULE_IMU_ID
50#define INS_MODULE_IMU_ID ABI_BROADCAST
57#ifndef INS_MODULE_GPS_ID
58#define INS_MODULE_GPS_ID GPS_MULTI_ID
78#if defined SITL && USE_NPS
120 if (last_stamp > 0) {
121 float dt = (float)(stamp - last_stamp) * 1e-6;
135 if (last_stamp > 0) {
136 float dt = (float)(stamp - last_stamp) * 1e-6;
Main include for ABI (AirBorneInterface).
struct abi_struct abi_event
#define ABI_BROADCAST
Broadcast address.
static void gps_cb(uint8_t sender_id, uint32_t stamp, struct GpsState *gps_s)
static abi_event accel_ev
static void accel_cb(uint8_t sender_id, uint32_t stamp, struct Int32Vect3 *accel)
struct EcefCoor_i ecef_int_from_gps(struct GpsState *gps_s)
Get GPS ecef pos (integer) Converted on the fly if not available.
#define GPS_VALID_VEL_ECEF_BIT
#define GPS_VALID_VEL_NED_BIT
#define GPS_VALID_POS_LLA_BIT
struct EcefCoor_i ecef_vel
speed ECEF in cm/s
#define GPS_VALID_POS_ECEF_BIT
struct NedCoor_i ned_vel
speed NED in cm/s
uint8_t valid_fields
bitfield indicating valid fields (GPS_VALID_x_BIT)
#define GPS_FIX_3D
3D GPS fix
data structure for GPS information
#define VECT3_COPY(_a, _b)
#define INT32_POS_OF_CM_DEN
#define INT32_SPEED_OF_CM_S_NUM
#define INT32_SPEED_OF_CM_S_DEN
#define INT32_POS_OF_CM_NUM
#define INT32_VECT3_ZERO(_v)
void int32_rmat_transp_vmult(struct Int32Vect3 *vb, struct Int32RMat *m_b2a, struct Int32Vect3 *va)
rotate 3D vector by transposed rotation matrix.
#define INT32_VECT3_SCALE_2(_a, _b, _num, _den)
void ltp_def_from_ecef_i(struct LtpDef_i *def, struct EcefCoor_i *ecef)
void ned_of_ecef_point_i(struct NedCoor_i *ned, struct LtpDef_i *def, struct EcefCoor_i *ecef)
Convert a point from ECEF to local NED.
void ned_of_ecef_vect_i(struct NedCoor_i *ned, struct LtpDef_i *def, struct EcefCoor_i *ecef)
Rotate a vector from ECEF to NED.
vector in EarthCenteredEarthFixed coordinates
vector in North East Down coordinates
static void stateSetAccelNed_i(uint16_t id, struct NedCoor_i *ned_accel)
Set acceleration in NED coordinates (int).
static void stateSetAccelBody_i(uint16_t id, struct Int32Vect3 *body_accel)
Set acceleration in Body coordinates (int).
static struct Int32RMat * stateGetNedToBodyRMat_i(void)
Get vehicle body attitude rotation matrix (int).
static void stateSetLocalOrigin_i(uint16_t id, struct LtpDef_i *ltp_def)
Set the local (flat earth) coordinate frame origin (int).
static void stateSetPositionNed_i(uint16_t id, struct NedCoor_i *ned_pos)
Set position from local NED coordinates (int).
static void stateSetSpeedNed_i(uint16_t id, struct NedCoor_i *ned_speed)
Set ground speed in local NED coordinates (int).
void ins_init_origin_i_from_flightplan(uint16_t id, struct LtpDef_i *ltp_def)
initialize the local origin (ltp_def in fixed point) from flight plan position
#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 ins_ned_to_state(void)
copy position and speed to state interface
void WEAK ins_module_propagate(struct Int32Vect3 *accel, float dt)
static void gps_cb(uint8_t sender_id, uint32_t stamp, struct GpsState *gps_s)
#define INS_MODULE_GPS_ID
ABI binding for gps data.
void WEAK ins_module_reset_local_origin(void)
void ins_module_wrapper_init(void)
void WEAK ins_module_update_baro(float pressure)
static void reset_cb(uint8_t sender_id UNUSED, uint8_t flag)
#define INS_MODULE_BARO_ID
baro
static void ins_ned_to_state(void)
copy position and speed to state interface
static void baro_cb(uint8_t sender_id, uint32_t stamp, float pressure)
void WEAK ins_module_init(void)
static void accel_cb(uint8_t sender_id, uint32_t stamp, struct Int32Vect3 *accel)
void WEAK ins_module_update_gps(struct GpsState *gps_s, float dt)
#define INS_MODULE_IMU_ID
IMU (accel).
struct InsModuleInt ins_module
global INS state
Paparazzi specific wrapper to run simple module based INS.
Ins implementation state (fixed point).
PRINT_CONFIG_MSG("USE_INS_NAV_INIT defaulting to TRUE")
void sim_overwrite_ins(void)
PRINT_CONFIG_VAR(ONELOOP_ANDI_FILT_CUTOFF)
API to get/set the generic vehicle states.
Architecture independent timing functions.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.