26#include "pprzlink/pprzlink_device.h"
39#define SKYTRAQ_FIX_NONE 0x00
40#define SKYTRAQ_FIX_2D 0x01
41#define SKYTRAQ_FIX_3D 0x02
42#define SKYTRAQ_FIX_3D_DGPS 0x03
45#define SKYTRAQ_SYNC1 0xA0
46#define SKYTRAQ_SYNC2 0xA1
48#define SKYTRAQ_SYNC3 0x0D
49#define SKYTRAQ_SYNC4 0x0A
59 return (a << 8) | (a >> 8);
62#define SKYTRAQ_NAVIGATION_DATA_FixMode(_payload) (uint8_t) (*((uint8_t*)_payload+2-2))
63#define SKYTRAQ_NAVIGATION_DATA_NumSV(_payload) (uint8_t) (*((uint8_t*)_payload+3-2))
65#define SKYTRAQ_NAVIGATION_DATA_WEEK(_payload) bswap16(*(uint16_t*)&_payload[4-2])
66#define SKYTRAQ_NAVIGATION_DATA_TOW(_payload) __builtin_bswap32(*(uint32_t*)&_payload[6-2])
68#define SKYTRAQ_NAVIGATION_DATA_LAT(_payload) (int32_t)__builtin_bswap32(*( int32_t*)&_payload[10-2])
69#define SKYTRAQ_NAVIGATION_DATA_LON(_payload) (int32_t)__builtin_bswap32(*( int32_t*)&_payload[14-2])
71#define SKYTRAQ_NAVIGATION_DATA_AEL(_payload) __builtin_bswap32(*(uint32_t*)&_payload[18-2])
72#define SKYTRAQ_NAVIGATION_DATA_ASL(_payload) __builtin_bswap32(*(uint32_t*)&_payload[22-2])
74#define SKYTRAQ_NAVIGATION_DATA_GDOP(_payload) bswap16(*(uint16_t*)&_payload[26-2])
75#define SKYTRAQ_NAVIGATION_DATA_PDOP(_payload) bswap16(*(uint16_t*)&_payload[28-2])
76#define SKYTRAQ_NAVIGATION_DATA_HDOP(_payload) bswap16(*(uint16_t*)&_payload[30-2])
77#define SKYTRAQ_NAVIGATION_DATA_VDOP(_payload) bswap16(*(uint16_t*)&_payload[32-2])
78#define SKYTRAQ_NAVIGATION_DATA_TDOP(_payload) bswap16(*(uint16_t*)&_payload[34-2])
80#define SKYTRAQ_NAVIGATION_DATA_ECEFX(_payload) (int32_t)__builtin_bswap32(*(uint32_t*)&_payload[36-2])
81#define SKYTRAQ_NAVIGATION_DATA_ECEFY(_payload) (int32_t)__builtin_bswap32(*(uint32_t*)&_payload[40-2])
82#define SKYTRAQ_NAVIGATION_DATA_ECEFZ(_payload) (int32_t)__builtin_bswap32(*(uint32_t*)&_payload[44-2])
83#define SKYTRAQ_NAVIGATION_DATA_ECEFVX(_payload) (int32_t)__builtin_bswap32(*(uint32_t*)&_payload[48-2])
84#define SKYTRAQ_NAVIGATION_DATA_ECEFVY(_payload) (int32_t)__builtin_bswap32(*(uint32_t*)&_payload[52-2])
85#define SKYTRAQ_NAVIGATION_DATA_ECEFVZ(_payload) (int32_t)__builtin_bswap32(*(uint32_t*)&_payload[56-2])
89#define MAX_DISTANCE 1000000
117 struct link_device *
dev = &((SKYTRAQ_GPS_LINK).device);
119 while (
dev->char_available(
dev->periph)) {
275 int32_t xdiff = abs(ecef_ref->
x - ecef_pos->
x);
279 int32_t ydiff = abs(ecef_ref->
y - ecef_pos->
y);
283 int32_t zdiff = abs(ecef_ref->
z - ecef_pos->
z);
Main include for ABI (AirBorneInterface).
uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
static struct uart_periph * dev
Device independent GPS code (interface).
#define GPS_VALID_VEL_ECEF_BIT
#define GPS_VALID_VEL_NED_BIT
#define GPS_VALID_POS_LLA_BIT
#define GPS_FIX_NONE
No GPS fix.
#define GPS_VALID_POS_ECEF_BIT
#define GPS_VALID_HMSL_BIT
#define GPS_FIX_2D
2D GPS fix
#define GPS_FIX_3D
3D GPS fix
#define GPS_VALID_COURSE_BIT
#define SKYTRAQ_NAVIGATION_DATA_ECEFX(_payload)
#define SKYTRAQ_NAVIGATION_DATA_TOW(_payload)
#define SKYTRAQ_NAVIGATION_DATA_ECEFVZ(_payload)
#define SKYTRAQ_FIX_3D_DGPS
#define SKYTRAQ_NAVIGATION_DATA_AEL(_payload)
static uint16_t bswap16(uint16_t a)
#define SKYTRAQ_NAVIGATION_DATA_ECEFY(_payload)
#define SKYTRAQ_NAVIGATION_DATA_ECEFVX(_payload)
#define SKYTRAQ_NAVIGATION_DATA_PDOP(_payload)
#define SKYTRAQ_NAVIGATION_DATA_LAT(_payload)
void gps_skytraq_init(void)
void gps_skytraq_event(void)
void gps_skytraq_read_message(void)
#define SKYTRAQ_NAVIGATION_DATA_NumSV(_payload)
#define SKYTRAQ_NAVIGATION_DATA_FixMode(_payload)
#define SKYTRAQ_NAVIGATION_DATA_ECEFZ(_payload)
void gps_skytraq_msg(void)
void gps_skytraq_parse(uint8_t c)
struct GpsSkytraq gps_skytraq
static int distance_too_great(struct EcefCoor_i *ecef_ref, struct EcefCoor_i *ecef_pos)
#define SKYTRAQ_NAVIGATION_DATA_ASL(_payload)
#define SKYTRAQ_NAVIGATION_DATA_LON(_payload)
#define SKYTRAQ_NAVIGATION_DATA_ECEFVY(_payload)
#define SKYTRAQ_ID_NAVIGATION_DATA
#define GPS_SKYTRAQ_MAX_PAYLOAD
@ GPS_SKYTRAQ_ERR_UNEXPECTED
@ GPS_SKYTRAQ_ERR_MSG_TOO_LONG
@ GPS_SKYTRAQ_ERR_CHECKSUM
@ GPS_SKYTRAQ_ERR_OUT_OF_SYNC
void ltp_def_from_ecef_i(struct LtpDef_i *def, struct EcefCoor_i *ecef)
void ned_of_ecef_vect_i(struct NedCoor_i *ned, struct LtpDef_i *def, struct EcefCoor_i *ecef)
Rotate a vector from ECEF to NED.
vector in EarthCenteredEarthFixed coordinates
arch independent LED (Light Emitting Diodes) API
#define UNINIT
Receiving pprz messages.
volatile uint32_t nb_sec
full seconds since startup
volatile uint32_t nb_sec_rem
remainder of seconds since startup in CPU_TICKS
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
int int32_t
Typedef defining 32 bit int type.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.