Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
ahrs_infrared.c File Reference
+ 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

◆ AHRS_INFRARED_GPS_ID

#define AHRS_INFRARED_GPS_ID   GPS_MULTI_ID

Definition at line 56 of file ahrs_infrared.c.

◆ AHRS_INFRARED_GYRO_ID

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

◆ INFRARED_FILTER_ID

#define INFRARED_FILTER_ID   2

Definition at line 42 of file ahrs_infrared.c.

Function Documentation

◆ ahrs_infrared_init()

void ahrs_infrared_init ( void  )

◆ ahrs_infrared_periodic()

◆ ahrs_infrared_update_gps()

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:

◆ gps_cb()

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:

◆ gyro_cb()

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:

◆ send_infrared()

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

Definition at line 79 of file ahrs_infrared.c.

References dev, 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:

◆ send_status()

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

Definition at line 85 of file ahrs_infrared.c.

References dev, 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

◆ gps_ev

abi_event gps_ev
static

Definition at line 58 of file ahrs_infrared.c.

Referenced by ahrs_infrared_init().

◆ gyro_ev

abi_event gyro_ev
static

Definition at line 53 of file ahrs_infrared.c.

Referenced by ahrs_infrared_init().

◆ heading

float heading
static