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.c File Reference

Integrated Navigation System interface. More...

#include "subsystems/ins.h"
#include "subsystems/gps.h"
#include "state.h"
+ Include dependency graph for ins.c:

Go to the source code of this file.

Macros

#define WEAK   __attribute__((weak))
 

Functions

void WEAK ins_periodic (void)
 INS periodic call. More...
 
void WEAK ins_reset_local_origin (void)
 INS local origin reset. More...
 
void WEAK ins_reset_altitude_ref (void)
 INS altitude reference reset. More...
 
void WEAK ins_reset_utm_zone (struct UtmCoor_f *utm)
 INS utm zone reset. More...
 
void WEAK ins_propagate (void)
 Propagation. More...
 
void WEAK ins_update_gps (void)
 Update INS state with GPS measurements. More...
 

Variables

struct Ins ins
 global INS state More...
 

Detailed Description

Integrated Navigation System interface.

Definition in file ins.c.

Macro Definition Documentation

#define WEAK   __attribute__((weak))

Definition at line 39 of file ins.c.

Function Documentation

void WEAK ins_periodic ( void  )

INS periodic call.

Does nothing if not implemented by specific INS algorithm.

Definition at line 42 of file ins.c.

References ins, ins_impl, INS_RUNNING, InsArdrone2::ltp_initialized, and Ins::status.

void WEAK 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 65 of file ins.c.

References AhrsARDrone::accel, ahrs_impl, AhrsARDrone::altitude, FLOAT_RMAT_VECT3_TRANSP_MUL, ins_impl, INT32_POS_OF_CM_DEN, INT32_POS_OF_CM_NUM, InsArdrone2::ltp_accel, InsArdrone2::ltp_pos, InsArdrone2::ltp_speed, AhrsARDrone::speed, stateGetNedToBodyRMat_f(), stateSetAccelNed_f(), stateSetPositionNed_i(), stateSetSpeedNed_f(), NedCoor_f::z, and NedCoor_i::z.

+ Here is the call graph for this function:

void WEAK 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 46 of file ins.c.

References UtmCoor_f::alt, gps, GpsState::hmsl, ins_impl, InsAltFloat::reset_alt_ref, state, stateSetLocalUtmOrigin_f(), TRUE, and State::utm_origin_f.

+ Here is the call graph for this function:

void WEAK 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 44 of file ins.c.

References UtmCoor_f::alt, UtmCoor_f::east, UtmCoor_i::east, gps, GpsState::hmsl, ins_impl, LLA_FLOAT_OF_BFP, GpsState::lla_pos, LlaCoor_i::lon, UtmCoor_f::north, UtmCoor_i::north, InsAltFloat::reset_alt_ref, stateSetLocalUtmOrigin_f(), TRUE, utm_of_lla_f(), GpsState::utm_pos, UtmCoor_f::zone, and UtmCoor_i::zone.

+ Here is the call graph for this function:

void WEAK ins_reset_utm_zone ( struct UtmCoor_f utm)

INS utm zone reset.

Reset UTM zone according te the actual position. Only used with fixedwing firmware. Can be overwritte by specifc INS implementation.

Parameters
utminitial utm zone, returns the corrected utm position

Definition at line 49 of file ins.c.

References gps, lla_of_utm_f(), GpsState::lla_pos, LlaCoor_i::lon, stateSetLocalUtmOrigin_f(), utm_of_lla_f(), GpsState::utm_pos, UtmCoor_f::zone, and UtmCoor_i::zone.

Referenced by nav_reset_utm_zone().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void WEAK ins_update_gps ( void  )

Update INS state with GPS measurements.

Reads the global gps data struct. Does nothing if not implemented by specific INS algorithm.

Todo:
maybe use gps.ned_vel directly??

Definition at line 67 of file ins.c.

References InsAltFloat::alt, UtmCoor_f::alt, InsAltFloat::alt_dot, alt_kalman(), alt_kalman_reset(), UtmCoor_f::east, UtmCoor_i::east, FALSE, gps, GpsState::hmsl, ins_impl, nav_utm_zone0, GpsState::ned_vel, UtmCoor_f::north, UtmCoor_i::north, InsAltFloat::reset_alt_ref, stateSetPositionUtm_f(), stateSetSpeedNed_f(), GpsState::utm_pos, NedCoor_i::x, NedCoor_i::y, NedCoor_i::z, and UtmCoor_f::zone.

+ Here is the call graph for this function:

Variable Documentation

struct Ins ins

global INS state

Definition at line 36 of file ins.c.

Referenced by ahrs_align(), ahrs_propagate(), ahrs_update_gps(), error_output(), ins_init(), and ins_periodic().