Paparazzi UAS  v5.2.2_stable-0-gd6b9f29
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
ins_int.c File Reference

INS for rotorcrafts combining vertical and horizontal filters. More...

#include "subsystems/ins/ins_int.h"
#include "subsystems/abi.h"
#include "subsystems/imu.h"
#include "subsystems/gps.h"
#include "generated/airframe.h"
#include "subsystems/ins/vf_float.h"
#include "math/pprz_geodetic_int.h"
#include "math/pprz_isa.h"
#include "generated/flight_plan.h"
+ Include dependency graph for ins_int.c:

Go to the source code of this file.

Macros

#define INS_VFF_R_GPS   2.0
 
#define USE_INS_NAV_INIT   TRUE
 
#define INS_BARO_ID   ABI_BROADCAST
 default barometer to use in INS More...
 

Functions

static void baro_cb (uint8_t sender_id, const float *pressure)
 
static void ins_init_origin_from_flightplan (void)
 initialize the local origin (ltp_def) from flight plan position More...
 
static void ins_ned_to_state (void)
 copy position and speed to state interface More...
 
static void ins_update_from_vff (void)
 update ins state from vertical filter More...
 
void ins_init (void)
 INS initialization. More...
 
void ins_periodic (void)
 INS periodic call. More...
 
void ins_reset_local_origin (void)
 INS local origin reset. More...
 
void ins_reset_altitude_ref (void)
 INS altitude reference reset. More...
 
void ins_propagate (void)
 Propagation. More...
 
void ins_update_gps (void)
 Update INS state with GPS measurements. More...
 

Variables

abi_event baro_ev
 
struct InsInt ins_impl
 global INS state More...
 

Detailed Description

INS for rotorcrafts combining vertical and horizontal filters.

Definition in file ins_int.c.

Macro Definition Documentation

#define INS_BARO_ID   ABI_BROADCAST

default barometer to use in INS

Definition at line 112 of file ins_int.c.

Referenced by ins_init().

#define INS_VFF_R_GPS   2.0

Definition at line 95 of file ins_int.c.

Referenced by ins_update_gps().

#define USE_INS_NAV_INIT   TRUE

Definition at line 99 of file ins_int.c.

Function Documentation

static void baro_cb ( uint8_t  sender_id,
const float *  pressure 
)
static

Definition at line 252 of file ins_int.c.

References InsInt::baro_initialized, InsInt::baro_z, FALSE, ins_ned_to_state(), ins_update_from_vff(), pprz_isa_height_of_pressure(), InsInt::qfe, TRUE, InsInt::vf_reset, vff_realign(), vff_update(), and vff_update_baro().

Referenced by ins_init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ins_init_origin_from_flightplan ( void  )
static

initialize the local origin (ltp_def) from flight plan position

Definition at line 359 of file ins_int.c.

References LlaCoor_i::alt, ecef_of_lla_i(), LtpDef_i::hmsl, LlaCoor_i::lat, LlaCoor_i::lon, InsInt::ltp_def, ltp_def_from_ecef_i(), and stateSetLocalOrigin_i().

Referenced by ins_init().

+ Here is the call graph for this function:

+ 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 377 of file ins_int.c.

References InsInt::ltp_accel, InsInt::ltp_pos, InsInt::ltp_speed, stateSetAccelNed_i(), stateSetPositionNed_i(), and stateSetSpeedNed_i().

Referenced by baro_cb(), ins_propagate(), and ins_update_gps().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ins_periodic ( void  )

INS periodic call.

Does nothing if not implemented by specific INS algorithm.

Definition at line 193 of file ins_int.c.

References ins, INS_RUNNING, InsInt::ltp_initialized, and Ins::status.

void ins_propagate ( void  )

Propagation.

Usually integrates the gyro rates to angles. Reads the global imu data struct. Does nothing if not implemented by specific INS algorithm.

Definition at line 220 of file ins_int.c.

References Imu::accel, ACCEL_BFP_OF_REAL, ACCEL_FLOAT_OF_BFP, b2_hff_propagate(), InsInt::baro_initialized, Imu::body_to_imu, imu, ins_ned_to_state(), ins_update_from_vff(), INT32_RMAT_TRANSP_VMULT, InsInt::ltp_accel, orientationGetRMat_i(), stateGetNedToBodyRMat_i(), vff_propagate(), NedCoor_i::x, Int32Vect3::x, NedCoor_i::y, Int32Vect3::y, NedCoor_i::z, and Int32Vect3::z.

+ Here is the call graph for this function:

void ins_reset_altitude_ref ( void  )

INS altitude reference reset.

Reset only vertical reference to the current altitude. Does nothing if not implemented by specific INS algorithm.

Definition at line 206 of file ins_int.c.

References LlaCoor_i::alt, gps, GpsState::hmsl, LtpDef_i::hmsl, LlaCoor_i::lat, LtpDef_i::lla, GpsState::lla_pos, LlaCoor_i::lon, InsInt::ltp_def, ltp_def_from_lla_i(), State::ned_origin_i, state, stateSetLocalOrigin_i(), TRUE, and InsInt::vf_reset.

+ Here is the call 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.

INS local origin reset.

Definition at line 198 of file ins_int.c.

References FALSE, InsInt::hf_realign, InsInt::ltp_initialized, TRUE, and InsInt::vf_reset.

static void ins_update_from_vff ( void  )
static

update ins state from vertical filter

Definition at line 389 of file ins_int.c.

References ACCEL_BFP_OF_REAL, InsInt::ltp_accel, InsInt::ltp_pos, InsInt::ltp_speed, POS_BFP_OF_REAL, SPEED_BFP_OF_REAL, vff, VffExtended::z, NedCoor_i::z, VffExtended::zdot, and VffExtended::zdotdot.

Referenced by baro_cb(), and ins_propagate().

+ Here is the caller graph for this function:

Variable Documentation

abi_event baro_ev

Definition at line 116 of file ins_int.c.

struct InsInt ins_impl

global INS state

Definition at line 119 of file ins_int.c.