31#include "generated/airframe.h"
84#if GPS_NMEA_SEND_USE_STATE_DATA
117 for (
int i = 0; i < 120; i++) {
gga[i] =
'\0';
rmc[i] =
'\0'; }
126 "$GPGGA,%s,%s,%c,%s,%c,1,%02u,%04u,%09.3f,M,0,M,,",
155 "$GPRMC,%s,A,%s,%c,%s,%c,%05.1f,%05.1f,%s,000.0,W",
178 sprintf(
gga,
"$GPGGA,,,,,,0,00,99.99,,,,,,*68\r\n");
182 sprintf(
rmc,
"$GPRMC,,V,,,,,,,,,,*53\r\n");
193 for (
int i = 0; i < length; i++) {
struct GpsState gps
global GPS state
Device independent GPS code (interface)
uint32_t tow
GPS time of week in ms.
int32_t hmsl
height above mean sea level (MSL) in mm
struct LlaCoor_i lla_pos
position in LLA (lat,lon: deg*1e7; alt: mm over ellipsoid)
int32_t course
GPS course over ground in rad*1e7, [0, 2*Pi]*1e7 (CW/north)
uint16_t pdop
position dilution of precision scaled by 100
uint16_t gspeed
norm of 2d ground speed in cm/s
#define GPS_FIX_3D
3D GPS fix
uint8_t num_sv
number of sat in fix
static uint8_t nmea_checksum(const char *sentence, int length)
Function to calculate checksum.
static void recover_gps_data(void)
Function to recover data available onboard from GPS.
static void gps_nmea_get_system_date_str(char *buf_date, size_t buf_date_size, char *buf_time, size_t buf_time_size)
Get Date from system.
struct Gps_Nmea_Send gps_nmea_send
static void nmea_send(const char *payload, int payload_length)
Function to send payload to UART.
void gps_nmea_send_init(void)
Initialization function.
static void nmea_convert_deg_to_DDMM(double deg, char *buf, int is_lat)
Function to convert lat long in DDLL.MMMM Format Lat and long don't have the same length.
static void build_nmea_sentence(void)
Function to build sentence for NMEA Protocol.
void gps_nmea_send_periodic(void)
Periodic function to send data.
module used to send GPS data over a Tawaki UART for extern instrument using NMEA protocol Exemple of ...
float vground
Speed over ground in m/s.
struct gps_nmea_send_msg_t msg
float hmsl
Orthometric height (MSL reference)
float course
GPS course over ground in rad*1e7, [0, 2*Pi]*1e7 (CW/north)
uint8_t num_sv
number of sat in fix
uint16_t pdop
position dilution of precision scaled by 100
int32_t lat
in degrees*1e7
int32_t lon
in degrees*1e7
static struct LlaCoor_f * stateGetPositionLla_f(void)
Get position in LLA coordinates (float).
float stateGetHmslOrigin_f(void)
Get the HMSL of the frame origin (float)
static struct EnuCoor_f * stateGetPositionEnu_f(void)
Get position in local ENU coordinates (float).
static float stateGetHorizontalSpeedNorm_f(void)
Get norm of horizontal ground speed (float).
static float stateGetHorizontalSpeedDir_f(void)
Get dir of horizontal ground speed (float).
vector in Latitude, Longitude and Altitude
#define NormCourseRad(x)
Normalize a rad angle between 0 and 2*PI.
API to get/set the generic vehicle states.
void WEAK uart_put_buffer(struct uart_periph *p, long fd, const uint8_t *data, uint16_t len)
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned long long uint64_t
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.