30 #include "message_pragmas.h"
34 #ifndef USE_INS_NAV_INIT
35 #define USE_INS_NAV_INIT TRUE
43 #ifndef INS_MODULE_BARO_ID
45 #define INS_MODULE_BARO_ID BARO_BOARD_SENDER_ID
47 #define INS_MODULE_BARO_ID ABI_BROADCAST
53 #ifndef INS_MODULE_IMU_ID
54 #define INS_MODULE_IMU_ID ABI_BROADCAST
61 #ifndef INS_MODULE_GPS_ID
62 #define INS_MODULE_GPS_ID GPS_MULTI_ID
81 #if defined SITL && USE_NPS
92 static void baro_cb(
uint8_t __attribute__((unused)) sender_id, __attribute__((unused))
uint32_t stamp,
float pressure)
105 if (last_stamp > 0) {
106 float dt = (float)(stamp - last_stamp) * 1e-6;
120 if (last_stamp > 0) {
121 float dt = (float)(stamp - last_stamp) * 1e-6;
Main include for ABI (AirBorneInterface).
Event structure to store callbacks in a linked list.
int32_t hmsl
height above mean sea level (MSL) in mm
struct LlaCoor_i lla_pos
position in LLA (lat,lon: deg*1e7; alt: mm over ellipsoid)
#define GPS_VALID_VEL_ECEF_BIT
#define GPS_VALID_VEL_NED_BIT
struct EcefCoor_i ecef_pos
position in ECEF in cm
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)
int32_t hmsl
Height above mean sea level in mm.
int32_t alt
in millimeters above WGS84 reference ellipsoid
struct LlaCoor_i lla
Reference point in lla.
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 North East Down coordinates
static void stateSetAccelNed_i(struct NedCoor_i *ned_accel)
Set acceleration in NED coordinates (int).
static struct Int32RMat * stateGetNedToBodyRMat_i(void)
Get vehicle body attitude rotation matrix (int).
static void stateSetPositionNed_i(struct NedCoor_i *ned_pos)
Set position from local NED coordinates (int).
static void stateSetLocalOrigin_i(struct LtpDef_i *ltp_def)
Set the local (flat earth) coordinate frame origin (int).
static void stateSetAccelBody_i(struct Int32Vect3 *body_accel)
Set acceleration in Body coordinates (int).
static void stateSetSpeedNed_i(struct NedCoor_i *ned_speed)
Set ground speed in local NED coordinates (int).
void ins_init_origin_i_from_flightplan(struct LtpDef_i *ltp_def)
initialize the local origin (ltp_def in fixed point) from flight plan position
void WEAK ins_module_propagate(struct Int32Vect3 *accel, float dt)
void ins_reset_local_origin(void)
INS local origin reset.
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)
static abi_event accel_ev
void WEAK ins_module_update_baro(float pressure)
#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.
struct NedCoor_i ltp_speed
velocity in m/s in BFP with INT32_SPEED_FRAC
struct NedCoor_i ltp_pos
position in m in BFP with INT32_POS_FRAC
struct GpsState gps
internal copy of last GPS message
struct NedCoor_i ltp_accel
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.