Paparazzi UAS  v5.10_stable-5-g83a0da5-dirty
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
ins_skeleton.c File Reference

Paparazzi specific wrapper to run simple module based INS. More...

#include "modules/ins/ins_skeleton.h"
#include "subsystems/abi.h"
#include "mcu_periph/sys_time.h"
#include "message_pragmas.h"
#include "state.h"
+ Include dependency graph for ins_skeleton.c:

Go to the source code of this file.

Macros

#define USE_INS_NAV_INIT   TRUE
 
#define INS_MODULE_BARO_ID   ABI_BROADCAST
 baro More...
 
#define INS_MODULE_IMU_ID   ABI_BROADCAST
 IMU (accel, body_to_imu) More...
 
#define INS_MODULE_GPS_ID   GPS_MULTI_ID
 ABI binding for gps data. More...
 

Functions

void ins_module_wrapper_init (void)
 
void WEAK ins_module_init (void)
 
void WEAK ins_module_update_baro (float pressure)
 
void WEAK ins_module_update_gps (struct GpsState *gps_s, float dt)
 
void WEAK ins_module_propagate (struct Int32Vect3 *accel, float dt)
 
void WEAK ins_module_reset_local_origin (void)
 
void ins_reset_local_origin (void)
 INS local origin reset. More...
 
static void ins_ned_to_state (void)
 copy position and speed to state interface More...
 
static void baro_cb (uint8_t sender_id, float pressure)
 
static void accel_cb (uint8_t sender_id, uint32_t stamp, struct Int32Vect3 *accel)
 
static void gps_cb (uint8_t sender_id, uint32_t stamp, struct GpsState *gps_s)
 
static void body_to_imu_cb (uint8_t sender_id, struct FloatQuat *q_b2i_f)
 

Variables

static abi_event baro_ev
 
static abi_event accel_ev
 
static abi_event gps_ev
 
static abi_event body_to_imu_ev
 
struct InsModuleInt ins_module
 global INS state More...
 

Detailed Description

Paparazzi specific wrapper to run simple module based INS.

Definition in file ins_skeleton.c.

Macro Definition Documentation

#define INS_MODULE_BARO_ID   ABI_BROADCAST

baro

Definition at line 47 of file ins_skeleton.c.

Referenced by ins_module_wrapper_init().

#define INS_MODULE_GPS_ID   GPS_MULTI_ID

ABI binding for gps data.

Used for GPS ABI messages.

Definition at line 62 of file ins_skeleton.c.

Referenced by ins_module_wrapper_init().

#define INS_MODULE_IMU_ID   ABI_BROADCAST

IMU (accel, body_to_imu)

Definition at line 54 of file ins_skeleton.c.

Referenced by ins_module_wrapper_init().

#define USE_INS_NAV_INIT   TRUE

Definition at line 35 of file ins_skeleton.c.

Function Documentation

static void accel_cb ( uint8_t  sender_id,
uint32_t  stamp,
struct Int32Vect3 accel 
)
static

Definition at line 199 of file ins_skeleton.c.

References dt, ins_module_propagate(), and ins_ned_to_state().

Referenced by ins_module_wrapper_init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void baro_cb ( uint8_t  sender_id,
float  pressure 
)
static

Definition at line 192 of file ins_skeleton.c.

References ins_module_update_baro(), and ins_ned_to_state().

Referenced by ins_module_wrapper_init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void body_to_imu_cb ( uint8_t  sender_id,
struct FloatQuat q_b2i_f 
)
static

Definition at line 239 of file ins_skeleton.c.

References InsModuleInt::body_to_imu, ins_module, and orientationSetQuat_f().

Referenced by ins_module_wrapper_init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void gps_cb ( uint8_t  sender_id,
uint32_t  stamp,
struct GpsState gps_s 
)
static

Definition at line 214 of file ins_skeleton.c.

References dt, GpsState::fix, InsModuleInt::gps, GPS_FIX_3D, ins_module, ins_module_update_gps(), ins_ned_to_state(), ins_reset_local_origin(), and InsModuleInt::ltp_initialized.

Referenced by ins_module_wrapper_init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void WEAK ins_module_init ( void  )

Definition at line 79 of file ins_skeleton.c.

Referenced by ins_module_wrapper_init().

+ Here is the caller graph for this function:

void WEAK ins_module_propagate ( struct Int32Vect3 accel,
float  dt 
)

Definition at line 115 of file ins_skeleton.c.

References InsModuleInt::body_to_imu, ins_module, int32_rmat_transp_vmult(), InsModuleInt::ltp_accel, orientationGetRMat_i(), stateGetNedToBodyRMat_i(), and VECT3_COPY.

Referenced by accel_cb().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void WEAK ins_module_reset_local_origin ( void  )

Definition at line 127 of file ins_skeleton.c.

Referenced by ins_reset_local_origin().

+ Here is the caller graph for this function:

void WEAK ins_module_update_baro ( float  pressure)

Definition at line 83 of file ins_skeleton.c.

Referenced by baro_cb().

+ Here is the caller graph for this function:

static void ins_ned_to_state ( void  )
static

copy position and speed to state interface

Definition at line 175 of file ins_skeleton.c.

References ins_module, InsModuleInt::ltp_accel, InsModuleInt::ltp_pos, InsModuleInt::ltp_speed, nps_bypass_ins, sim_overwrite_ins(), stateSetAccelNed_i(), stateSetPositionNed_i(), and stateSetSpeedNed_i().

Referenced by accel_cb(), baro_cb(), and gps_cb().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ins_reset_local_origin ( void  )

INS local origin reset.

Reset horizontal and vertical reference to the current position. Does nothing if not implemented by specific INS algorithm.

Definition at line 136 of file ins_skeleton.c.

Referenced by gps_cb(), and nav_reset_reference().

+ Here is the caller graph for this function:

Variable Documentation

abi_event accel_ev
static

Definition at line 67 of file ins_skeleton.c.

Referenced by ins_module_wrapper_init().

abi_event baro_ev
static

Definition at line 66 of file ins_skeleton.c.

Referenced by ins_module_wrapper_init().

abi_event body_to_imu_ev
static

Definition at line 69 of file ins_skeleton.c.

Referenced by ins_module_wrapper_init().

abi_event gps_ev
static

Definition at line 68 of file ins_skeleton.c.

Referenced by ins_module_wrapper_init().