Paparazzi UAS  v5.0.5_stable-7-g4b8bbb7
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
ins_ardrone2.c File Reference

INS implementation for ardrone2-sdk. More...

#include "subsystems/ins/ins_ardrone2.h"
#include "subsystems/ahrs.h"
#include "subsystems/gps.h"
#include "generated/airframe.h"
#include "generated/flight_plan.h"
#include "math/pprz_geodetic_int.h"
+ Include dependency graph for ins_ardrone2.c:

Go to the source code of this file.

Macros

#define USE_INS_NAV_INIT   TRUE
 

Functions

void ins_init ()
 INS initialization. More...
 
void ins_periodic (void)
 INS periodic call. More...
 
void ins_realign_h (struct FloatVect2 pos, struct FloatVect2 speed)
 INS horizontal realign. More...
 
void ins_realign_v (float z)
 INS vertical realign. More...
 
void ins_propagate ()
 Propagation. More...
 
void ins_update_baro ()
 Update INS state with barometer measurements. More...
 
void ins_update_gps (void)
 Update INS state with GPS measurements. More...
 
void ins_update_sonar ()
 Update INS state with sonar measurements. More...
 

Variables

int32_t ins_qfe
 
int32_t ins_baro_alt
 
struct NedCoor_i ins_ltp_pos
 
struct LtpDef_i ins_ltp_def
 Ins implementation state (fixed point) More...
 
struct NedCoor_f ins_ltp_accel
 
struct NedCoor_f ins_ltp_speed
 
bool_t ins_ltp_initialised
 

Detailed Description

INS implementation for ardrone2-sdk.

Definition in file ins_ardrone2.c.

Macro Definition Documentation

#define USE_INS_NAV_INIT   TRUE

Definition at line 40 of file ins_ardrone2.c.

Function Documentation

void ins_init ( void  )

INS initialization.

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

Definition at line 59 of file ins_ardrone2.c.

References LlaCoor_i::alt, FALSE, Ins::hf_realign, LtpDef_i::hmsl, ins, ins_ltp_def, ins_ltp_pos, INS_RUNNING, INT32_RAD_OF_DEG, INT32_VECT3_ZERO, LlaCoor_i::lat, LlaCoor_i::lon, ltp_def_from_lla_i(), stateSetLocalOrigin_i(), Ins::status, TRUE, and Ins::vf_realign.

+ Here is the call graph for this function:

void ins_periodic ( void  )

INS periodic call.

Needs to be implemented by each INS algorithm.

Definition at line 89 of file ins_ardrone2.c.

void ins_propagate ( void  )

Propagation.

Usually integrates the gyro rates to angles. Reads the global imu data struct. Needs to be implemented by each INS algorithm.

Definition at line 101 of file ins_ardrone2.c.

References AhrsARDrone::accel, ahrs_impl, AhrsARDrone::altitude, FLOAT_RMAT_VECT3_TRANSP_MUL, ins_ltp_accel, ins_ltp_pos, ins_ltp_speed, INT32_POS_OF_CM_DEN, INT32_POS_OF_CM_NUM, 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 ins_realign_h ( struct FloatVect2  pos,
struct FloatVect2  speed 
)

INS horizontal realign.

Parameters
posnew horizontal position to set
speednew horizontal speed to set Needs to be implemented by each INS algorithm.

Definition at line 93 of file ins_ardrone2.c.

void ins_realign_v ( float  z)

INS vertical realign.

Parameters
znew altitude to set Needs to be implemented by each INS algorithm.

Definition at line 97 of file ins_ardrone2.c.

void ins_update_baro ( void  )

Update INS state with barometer measurements.

Reads the global baro data struct. Needs to be implemented by each INS algorithm.

Definition at line 121 of file ins_ardrone2.c.

void ins_update_gps ( void  )

Update INS state with GPS measurements.

Reads the global gps data struct. Needs to be implemented by each INS algorithm.

Definition at line 126 of file ins_ardrone2.c.

References LlaCoor_i::alt, GpsState::ecef_pos, GpsState::fix, gps, GPS_FIX_3D, GpsState::hmsl, LtpDef_i::hmsl, ins_ltp_def, ins_ltp_pos, INT32_POS_OF_CM_DEN, INT32_POS_OF_CM_NUM, INT32_VECT2_SCALE_2, INT32_VECT3_SCALE_2, LtpDef_i::lla, GpsState::lla_pos, ltp_def_from_ecef_i(), ned_of_ecef_point_i(), stateSetLocalOrigin_i(), stateSetPositionNed_i(), and TRUE.

+ Here is the call graph for this function:

void ins_update_sonar ( void  )

Update INS state with sonar measurements.

Reads the global #sonar data struct. Needs to be implemented by each INS algorithm.

Definition at line 156 of file ins_ardrone2.c.

Variable Documentation

int32_t ins_baro_alt

Definition at line 47 of file ins_ardrone2.c.

struct NedCoor_f ins_ltp_accel

Definition at line 54 of file ins_ardrone2.c.

Referenced by b2_hff_propagate(), b2_hff_update_gps(), ins_propagate(), and track_event().

struct LtpDef_i ins_ltp_def

Ins implementation state (fixed point)

global INS state

Definition at line 51 of file ins_ardrone2.c.

Referenced by dl_parse_msg(), ins_init(), ins_update_gps(), nav_periodic_task(), and nav_reset_alt().

bool_t ins_ltp_initialised

Definition at line 57 of file ins_ardrone2.c.

Referenced by nav_reset_reference(), track_event(), and track_init().

struct NedCoor_f ins_ltp_speed

Definition at line 55 of file ins_ardrone2.c.

Referenced by b2_hff_propagate(), b2_hff_update_gps(), ins_propagate(), and track_event().

int32_t ins_qfe

Definition at line 46 of file ins_ardrone2.c.