37 #define GPS_FIX_NONE 0x00
38 #define GPS_FIX_2D 0x02
39 #define GPS_FIX_3D 0x03
40 #define GPS_FIX_DGPS 0x04
41 #define GPS_FIX_RTK 0x05
43 #define GpsFixValid() (gps.fix >= GPS_FIX_3D)
45 #define GpsIsLost() !GpsFixValid()
48 #define GPS_VALID_POS_ECEF_BIT 0
49 #define GPS_VALID_POS_LLA_BIT 1
50 #define GPS_VALID_POS_UTM_BIT 2
51 #define GPS_VALID_VEL_ECEF_BIT 3
52 #define GPS_VALID_VEL_NED_BIT 4
53 #define GPS_VALID_HMSL_BIT 5
54 #define GPS_VALID_COURSE_BIT 6
56 #ifndef GPS_NB_CHANNELS
57 #define GPS_NB_CHANNELS 16
60 #define GPS_MODE_AUTO 0
61 #define GPS_MODE_PRIMARY 1
62 #define GPS_MODE_SECONDARY 2
64 #ifndef MULTI_GPS_MODE
65 #define MULTI_GPS_MODE GPS_MODE_AUTO
126 #ifdef GPS_SECONDARY_TYPE_H
127 #include GPS_SECONDARY_TYPE_H
138 #define GPS_TIMEOUT 2
143 static bool gps_had_valid_fix =
false;
145 gps_had_valid_fix =
true;
147 return gps_had_valid_fix;
uint8_t qi
quality bitfield (GPS receiver specific)
uint32_t t0_tow
GPS time of week in ms from last message.
uint32_t gps_tow_from_sys_ticks(uint32_t sys_ticks)
Convert time in sys_time ticks to GPS time of week.
struct SVinfo svinfos[GPS_NB_CHANNELS]
holds information from the Space Vehicles (Satellites)
int16_t azim
azimuth in deg
uint32_t pacc
position accuracy in cm
uint8_t nb_channels
Number of scanned satellites.
uint32_t t0_ticks
hw clock ticks when GPS message is received
vector in EarthCenteredEarthFixed coordinates
uint8_t valid_fields
bitfield indicating valid fields (GPS_VALID_x_BIT)
void gps_init(void)
initialize the global GPS state
struct UtmCoor_i utm_int_from_gps(struct GpsState *gps_s, uint8_t zone)
Convenience function to get utm position in int from GPS structure.
void gps_periodic_check(struct GpsState *gps_s)
Periodic GPS check.
uint16_t reset
hotstart, warmstart, coldstart
position in UTM coordinates Units: meters
uint8_t svid
Satellite ID.
vector in Latitude, Longitude and Altitude
uint16_t speed_3d
norm of 3d speed in cm/s
struct UtmCoor_i utm_pos
position in UTM (north,east: cm; alt: mm over MSL)
void gps_inject_data(uint8_t packet_id, uint8_t length, uint8_t *data)
GPS packet injection (default empty)
uint32_t last_3dfix_ticks
cpu time ticks at last valid 3D fix
int8_t elev
elevation in deg
struct GpsState gps
global GPS state
uint32_t sacc
speed accuracy in cm/s
static bool gps_has_been_good(void)
uint32_t last_msg_time
cpu time in sec at last received GPS message
uint32_t cacc
course accuracy in rad*1e7
struct GpsTimeSync gps_time_sync
uint8_t zone
UTM zone number.
Paparazzi floating point math for geodetic calculations.
int32_t hmsl
height above mean sea level (MSL) in mm
uint8_t cno
Carrier to Noise Ratio (Signal Strength) in dbHz.
Architecture independent timing functions.
data structure for GPS information
struct UtmCoor_f utm_float_from_gps(struct GpsState *gps_s, uint8_t zone)
Convenience function to get utm position in float from GPS structure.
uint32_t tow
GPS time of week in ms.
data structure for Space Vehicle Information of a single satellite
uint16_t pdop
position dilution of precision scaled by 100
struct EcefCoor_i ecef_pos
position in ECEF in cm
Paparazzi fixed point math for geodetic calculations.
uint8_t zone
UTM zone number.
uint32_t last_3dfix_time
cpu time in sec at last valid 3D fix
int32_t course
GPS course over ground in rad*1e7, [0, 2*Pi]*1e7 (CW/north)
uint8_t comp_id
id of current gps
vector in North East Down coordinates
int32_t t0_tow_frac
fractional ns remainder of tow [ms], range -500000 .. 500000
uint8_t flags
bitfield with GPS receiver specific flags
uint32_t last_msg_ticks
cpu time ticks at last received GPS message
uint8_t num_sv
number of sat in fix
uint16_t gspeed
norm of 2d ground speed in cm/s
struct EcefCoor_i ecef_vel
speed ECEF in cm/s
data structure for GPS time sync
struct LlaCoor_i lla_pos
position in LLA (lat,lon: deg*1e7; alt: mm over ellipsoid)
struct NedCoor_i ned_vel
speed NED in cm/s
position in UTM coordinates