Paparazzi UAS  v6.0_unstable-92-g17422e4-dirty
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
gps_datalink.c File Reference

GPS system based on datalink. More...

#include "generated/flight_plan.h"
#include "subsystems/gps.h"
#include "subsystems/abi.h"
#include "subsystems/imu.h"
#include "subsystems/datalink/datalink.h"
#include "subsystems/datalink/downlink.h"
+ Include dependency graph for gps_datalink.c:

Go to the source code of this file.

Macros

#define GPS_DATALINK_USE_MAG   1
 Set to 1 to receive also magnetometer ABI messages. More...
 

Functions

void gps_datalink_init (void)
 GPS initialization. More...
 
static void send_magnetometer (int32_t course, uint32_t now_ts)
 
static void parse_gps_datalink_small (int16_t heading, uint32_t pos_xyz, uint32_t speed_xyz, uint32_t tow)
 
static void parse_gps_datalink (uint8_t numsv, int32_t ecef_x, int32_t ecef_y, int32_t ecef_z, int32_t lat, int32_t lon, int32_t alt, int32_t hmsl, int32_t ecef_xd, int32_t ecef_yd, int32_t ecef_zd, uint32_t tow, int32_t course)
 Parse the REMOTE_GPS datalink packet. More...
 
static void parse_gps_datalink_local (float enu_x, float enu_y, float enu_z, float enu_xd, float enu_yd, float enu_zd, uint32_t tow, float course)
 Parse the REMOTE_GPS_LOCAL datalink packet. More...
 
void gps_datalink_parse_REMOTE_GPS (uint8_t *buf)
 
void gps_datalink_parse_REMOTE_GPS_SMALL (uint8_t *buf)
 
void gps_datalink_parse_REMOTE_GPS_LOCAL (uint8_t *buf)
 

Variables

struct LtpDef_i ltp_def
 
struct GpsState gps_datalink
 

Detailed Description

GPS system based on datalink.

This GPS parses the datalink REMOTE_GPS packet and sets the GPS structure to the values received.

Definition in file gps_datalink.c.

Macro Definition Documentation

#define GPS_DATALINK_USE_MAG   1

Set to 1 to receive also magnetometer ABI messages.

Definition at line 41 of file gps_datalink.c.

Function Documentation

void gps_datalink_init ( void  )

GPS initialization.

Definition at line 50 of file gps_datalink.c.

References LlaCoor_i::alt, GpsState::cacc, GpsState::comp_id, GpsState::fix, GPS_DATALINK_ID, GPS_FIX_NONE, LlaCoor_i::lat, LlaCoor_i::lon, ltp_def_from_lla_i(), GpsState::pacc, GpsState::pdop, and GpsState::sacc.

+ Here is the call graph for this function:

void gps_datalink_parse_REMOTE_GPS ( uint8_t buf)

Definition at line 272 of file gps_datalink.c.

References parse_gps_datalink().

+ Here is the call graph for this function:

void gps_datalink_parse_REMOTE_GPS_LOCAL ( uint8_t buf)

Definition at line 301 of file gps_datalink.c.

References parse_gps_datalink_local().

+ Here is the call graph for this function:

void gps_datalink_parse_REMOTE_GPS_SMALL ( uint8_t buf)

Definition at line 291 of file gps_datalink.c.

References parse_gps_datalink_small().

+ Here is the call graph for this function:

static void send_magnetometer ( int32_t  course,
uint32_t  now_ts 
)
static

Definition at line 70 of file gps_datalink.c.

References heading, imu, imu_scale_mag(), MAG_DATALINK_SENDER_ID, Imu::mag_unscaled, MAGS_BFP_OF_REAL, VECT3_COPY, FloatVect3::x, FloatVect3::y, and FloatVect3::z.

Referenced by parse_gps_datalink(), and parse_gps_datalink_local().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

struct GpsState gps_datalink
struct LtpDef_i ltp_def