Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
ins_skeleton.c File Reference

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

#include "modules/ins/ins_skeleton.h"
#include "modules/core/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   AIR_DATA_SENDER_ID
 baro
#define INS_MODULE_IMU_ID   ABI_BROADCAST
 IMU (accel).
#define INS_MODULE_GPS_ID   GPS_MULTI_ID
 ABI binding for gps data.

Functions

void ins_module_wrapper_init (void)
static void ins_ned_to_state (void)
 copy position and speed to state interface
static void reset_cb (uint8_t sender_id UNUSED, uint8_t flag)
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 gps_cb (uint8_t sender_id, uint32_t stamp, struct GpsState *gps_s)
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)

Variables

static abi_event baro_ev
static abi_event accel_ev
static abi_event gps_ev
static abi_event reset_ev
struct InsModuleInt ins_module
 global INS state

Detailed Description

Paparazzi specific wrapper to run simple module based INS.

Definition in file ins_skeleton.c.

Macro Definition Documentation

◆ INS_MODULE_BARO_ID

#define INS_MODULE_BARO_ID   AIR_DATA_SENDER_ID

baro

Definition at line 44 of file ins_skeleton.c.

Referenced by ins_module_wrapper_init().

◆ INS_MODULE_GPS_ID

#define INS_MODULE_GPS_ID   GPS_MULTI_ID

ABI binding for gps data.

Used for GPS ABI messages.

Definition at line 58 of file ins_skeleton.c.

Referenced by ins_module_wrapper_init().

◆ INS_MODULE_IMU_ID

#define INS_MODULE_IMU_ID   ABI_BROADCAST

IMU (accel).

Definition at line 50 of file ins_skeleton.c.

Referenced by ins_module_wrapper_init().

◆ USE_INS_NAV_INIT

#define USE_INS_NAV_INIT   TRUE

Definition at line 35 of file ins_skeleton.c.

Function Documentation

◆ accel_cb()

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

Definition at line 114 of file ins_skeleton.c.

References ins_module_propagate(), and ins_ned_to_state().

Here is the call graph for this function:

◆ baro_cb()

void baro_cb ( uint8_t sender_id,
uint32_t stamp,
float pressure )
static

Definition at line 107 of file ins_skeleton.c.

References ins_module_update_baro(), and ins_ned_to_state().

Here is the call graph for this function:

◆ gps_cb()

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

Definition at line 129 of file ins_skeleton.c.

References GpsState::fix, GPS_FIX_3D, ins_module, ins_module_update_gps(), ins_ned_to_state(), INS_RESET_REF, and reset_cb().

Here is the call graph for this function:

◆ ins_module_init()

void WEAK ins_module_init ( void )

Definition at line 158 of file ins_skeleton.c.

Referenced by ins_module_wrapper_init().

Here is the caller graph for this function:

◆ ins_module_propagate()

void WEAK ins_module_propagate ( struct Int32Vect3 * accel,
float dt )

Definition at line 196 of file ins_skeleton.c.

References ins_module, int32_rmat_transp_vmult(), stateGetNedToBodyRMat_i(), stateSetAccelBody_i(), and VECT3_COPY.

Referenced by accel_cb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ins_module_reset_local_origin()

void WEAK ins_module_reset_local_origin ( void )

Definition at line 206 of file ins_skeleton.c.

Referenced by reset_cb().

Here is the caller graph for this function:

◆ ins_module_update_baro()

void WEAK ins_module_update_baro ( float pressure)

Definition at line 162 of file ins_skeleton.c.

Referenced by baro_cb().

Here is the caller graph for this function:

◆ ins_module_update_gps()

void WEAK ins_module_update_gps ( struct GpsState * gps_s,
float dt )

◆ ins_module_wrapper_init()

void ins_module_wrapper_init ( void )

◆ ins_ned_to_state()

void ins_ned_to_state ( void )
static

copy position and speed to state interface

Definition at line 72 of file ins_skeleton.c.

References ins_module, ins_ned_to_state(), 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:

◆ reset_cb()

void reset_cb ( uint8_t sender_id UNUSED,
uint8_t flag )
static

Definition at line 89 of file ins_skeleton.c.

References ecef_int_from_gps(), GPS_FIX_3D, ins_module, ins_module_reset_local_origin(), INS_RESET_REF, ltp_def_from_ecef_i(), stateSetLocalOrigin_i(), and UNUSED.

Referenced by gps_cb().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ accel_ev

abi_event accel_ev
static

Definition at line 63 of file ins_skeleton.c.

◆ baro_ev

abi_event baro_ev
static

Definition at line 62 of file ins_skeleton.c.

◆ gps_ev

abi_event gps_ev
static

Definition at line 64 of file ins_skeleton.c.

◆ ins_module

struct InsModuleInt ins_module

◆ reset_ev

abi_event reset_ev
static

Definition at line 65 of file ins_skeleton.c.