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

Integrated Navigation System interface. More...

#include "std.h"
#include "math/pprz_geodetic_int.h"
#include "math/pprz_algebra_float.h"
#include "state.h"
+ Include dependency graph for ins.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Ins
 Inertial Navigation System state. More...
 

Enumerations

enum  InsStatus { INS_UNINIT =0, INS_RUNNING =1 }
 

Functions

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_reset_utm_zone (struct UtmCoor_f *utm)
 INS utm zone reset. More...
 
void ins_propagate (void)
 Propagation. More...
 
void 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.h.

Enumeration Type Documentation

enum InsStatus
Enumerator
INS_UNINIT 
INS_RUNNING 

Definition at line 35 of file ins.h.

Function Documentation

void ins_init ( void  )

INS initialization.

Called at startup. Needs to be implemented by each INS algorithm.

Definition at line 76 of file ins_alt_float.c.

References LlaCoor_i::alt, UtmCoor_f::alt, alt_kalman(), alt_kalman_init(), b2_hff_init(), InsAltFloat::baro_alt, baro_cb(), baro_ev, InsAltFloat::baro_initialized, InsInt::baro_initialized, UtmCoor_f::east, ecef_of_lla_i(), FALSE, InsFloatInv::gains, ground_alt, InsInt::hf_realign, LtpDef_i::hmsl, init_invariant_state(), ins, INS_BARO_ID, ins_impl, ins_init_origin_from_flightplan(), INS_INV_LB, INS_INV_LV, INS_INV_MH, INS_INV_MV, INS_INV_MVZ, INS_INV_NH, INS_INV_NX, INS_INV_NXZ, INS_INV_OB, INS_INV_OV, INS_INV_RH, INS_INV_RV, INS_INV_SH, INS_RUNNING, INS_UNINIT, INT32_VECT3_ZERO, LlaCoor_i::lat, inv_gains::lb, LlaCoor_i::lon, InsArdrone2::ltp_accel, InsGpsPassthrough::ltp_accel, InsInt::ltp_accel, InsArdrone2::ltp_def, InsGpsPassthrough::ltp_def, ltp_def_from_ecef_i(), InsArdrone2::ltp_initialized, InsInt::ltp_initialized, InsGpsPassthrough::ltp_initialized, InsArdrone2::ltp_pos, InsGpsPassthrough::ltp_pos, InsInt::ltp_pos, InsArdrone2::ltp_speed, InsGpsPassthrough::ltp_speed, InsInt::ltp_speed, inv_gains::lv, inv_gains::mh, inv_gains::mv, inv_gains::mvz, nav_utm_east0, nav_utm_north0, nav_utm_zone0, inv_gains::nh, UtmCoor_f::north, inv_gains::nx, inv_gains::nxz, inv_gains::ob, inv_gains::ov, InsAltFloat::qfe, register_periodic_telemetry(), InsFloatInv::reset, InsAltFloat::reset_alt_ref, inv_gains::rh, inv_gains::rv, inv_gains::sh, stateSetLocalOrigin_i(), stateSetLocalUtmOrigin_f(), stateSetPositionUtm_f(), Ins::status, TRUE, InsInt::vf_reset, vff_init_zero(), and UtmCoor_f::zone.

Referenced by init_ap(), and main_init().

+ 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 71 of file ins_ardrone2.c.

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

Referenced by sensors_task().

+ Here is the caller 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 124 of file ins_alt_float.c.

References LlaCoor_i::alt, UtmCoor_f::alt, gps, GpsState::hmsl, LtpDef_i::hmsl, ins_impl, LlaCoor_i::lat, LtpDef_i::lla, GpsState::lla_pos, LlaCoor_i::lon, InsArdrone2::ltp_def, InsGpsPassthrough::ltp_def, InsInt::ltp_def, ltp_def_from_lla_i(), State::ned_origin_i, InsAltFloat::reset_alt_ref, state, stateSetLocalOrigin_i(), stateSetLocalUtmOrigin_f(), TRUE, State::utm_origin_f, and InsInt::vf_reset.

Referenced by nav_reset_alt().

+ 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.

INS local origin reset.

Definition at line 101 of file ins_alt_float.c.

References LlaCoor_i::alt, UtmCoor_f::alt, UtmCoor_f::east, UtmCoor_i::east, GpsState::ecef_pos, FALSE, gps, InsInt::hf_realign, GpsState::hmsl, LtpDef_i::hmsl, ins_impl, LtpDef_i::lla, LLA_FLOAT_OF_BFP, GpsState::lla_pos, LlaCoor_i::lon, InsGpsPassthrough::ltp_def, ltp_def_from_ecef_i(), InsArdrone2::ltp_initialized, InsInt::ltp_initialized, InsGpsPassthrough::ltp_initialized, UtmCoor_f::north, UtmCoor_i::north, InsAltFloat::reset_alt_ref, stateSetLocalOrigin_i(), stateSetLocalUtmOrigin_f(), TRUE, utm_of_lla_f(), GpsState::utm_pos, InsInt::vf_reset, UtmCoor_f::zone, and UtmCoor_i::zone.

Referenced by ins_update_gps(), and nav_reset_reference().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void 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 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 166 of file ins_alt_float.c.

References InsAltFloat::alt, LlaCoor_i::alt, UtmCoor_f::alt, InsAltFloat::alt_dot, alt_kalman(), alt_kalman_reset(), b2_hff_realign(), b2_hff_update_gps(), UtmCoor_f::east, UtmCoor_i::east, GpsState::ecef_pos, GpsState::ecef_vel, FALSE, GpsState::fix, gps, GPS_FIX_3D, InsInt::hf_realign, GpsState::hmsl, LtpDef_i::hmsl, ins_impl, ins_ned_to_state(), ins_reset_local_origin(), INS_VFF_R_GPS, INT32_POS_OF_CM_DEN, INT32_POS_OF_CM_NUM, INT32_SPEED_OF_CM_S_DEN, INT32_SPEED_OF_CM_S_NUM, INT32_VECT2_SCALE_2, INT32_VECT3_SCALE_2, LtpDef_i::lla, GpsState::lla_pos, InsArdrone2::ltp_def, InsGpsPassthrough::ltp_def, InsInt::ltp_def, ltp_def_from_ecef_i(), InsArdrone2::ltp_initialized, InsInt::ltp_initialized, InsGpsPassthrough::ltp_initialized, InsArdrone2::ltp_pos, InsGpsPassthrough::ltp_pos, InsInt::ltp_pos, InsGpsPassthrough::ltp_speed, InsInt::ltp_speed, nav_utm_zone0, ned_of_ecef_point_i(), ned_of_ecef_vect_i(), GpsState::ned_vel, UtmCoor_f::north, UtmCoor_i::north, InsAltFloat::reset_alt_ref, stateSetLocalOrigin_i(), stateSetPositionNed_i(), stateSetPositionUtm_f(), stateSetSpeedNed_f(), stateSetSpeedNed_i(), TRUE, GpsState::utm_pos, VECT2_ASSIGN, VECT2_SDIV, vff_update_z_conf(), NedCoor_i::x, NedCoor_i::y, NedCoor_i::z, and UtmCoor_f::zone.

Referenced by on_gps_event(), and on_gps_solution().

+ Here is the call graph for this function:

+ Here is the caller 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().