Paparazzi UAS  v5.15_devel-81-gd13dafb
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
ahrs_infrared.c File Reference

Attitude estimation using infrared sensors detecting the horizon. More...

+ Include dependency graph for ahrs_infrared.c:

Go to the source code of this file.

Macros

#define INFRARED_FILTER_ID   2
 
#define AHRS_INFRARED_GYRO_ID   ABI_BROADCAST
 ABI binding for gyro data. More...
 
#define AHRS_INFRARED_GPS_ID   GPS_MULTI_ID
 

Functions

void ahrs_infrared_update_gps (struct GpsState *gps_s)
 
static void gyro_cb (uint8_t sender_id, uint32_t stamp, struct Int32Rates *gyro)
 
static void gps_cb (uint8_t sender_id, uint32_t stamp, struct GpsState *gps_s)
 
static void send_infrared (struct transport_tx *trans, struct link_device *dev)
 
static void send_status (struct transport_tx *trans, struct link_device *dev)
 
void ahrs_infrared_init (void)
 
void ahrs_infrared_periodic (void)
 

Variables

static float heading
 
static abi_event gyro_ev
 
static abi_event gps_ev
 

Detailed Description

Attitude estimation using infrared sensors detecting the horizon.

For fixedwings only:

  • GPS course is used as heading.
  • ADC channels can be used for gyros.

Definition in file ahrs_infrared.c.

Macro Definition Documentation

#define AHRS_INFRARED_GPS_ID   GPS_MULTI_ID

Definition at line 56 of file ahrs_infrared.c.

Referenced by ahrs_infrared_init().

#define AHRS_INFRARED_GYRO_ID   ABI_BROADCAST

ABI binding for gyro data.

Used for gyro ABI messages.

Definition at line 51 of file ahrs_infrared.c.

Referenced by ahrs_infrared_init().

#define INFRARED_FILTER_ID   2

Definition at line 42 of file ahrs_infrared.c.

Referenced by send_status().

Function Documentation

void ahrs_infrared_init ( void  )

Definition at line 96 of file ahrs_infrared.c.

References AHRS_INFRARED_GPS_ID, AHRS_INFRARED_GYRO_ID, DefaultPeriodic, gps_cb(), gyro_cb(), heading, register_periodic_telemetry(), send_infrared(), and send_status().

+ Here is the call graph for this function:

void ahrs_infrared_update_gps ( struct GpsState gps_s)

Definition at line 110 of file ahrs_infrared.c.

References GpsState::course, GpsState::gspeed, heading, stateGetHorizontalWindspeed_f(), FloatVect2::x, and FloatVect2::y.

Referenced by gps_cb().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 68 of file ahrs_infrared.c.

References ahrs_infrared_update_gps().

Referenced by ahrs_infrared_init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void gyro_cb ( uint8_t  sender_id,
uint32_t  stamp,
struct Int32Rates gyro 
)
static

Definition at line 61 of file ahrs_infrared.c.

References stateSetBodyRates_i().

Referenced by ahrs_infrared_init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void send_infrared ( struct transport_tx *  trans,
struct link_device *  dev 
)
static

Definition at line 79 of file ahrs_infrared.c.

References infrared, Infrared_raw::ir1, Infrared_raw::ir2, Infrared::pitch, Infrared::roll, Infrared::top, and Infrared::value.

Referenced by ahrs_infrared_init().

+ Here is the caller graph for this function:

static void send_status ( struct transport_tx *  trans,
struct link_device *  dev 
)
static

Definition at line 85 of file ahrs_infrared.c.

References infrared, INFRARED_FILTER_ID, Infrared::pitch, Infrared::roll, and Infrared::top.

Referenced by ahrs_infrared_init().

+ Here is the caller graph for this function:

Variable Documentation

abi_event gps_ev
static

Definition at line 58 of file ahrs_infrared.c.

abi_event gyro_ev
static

Definition at line 53 of file ahrs_infrared.c.