Paparazzi UAS
v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
|
Device independent GPS code (interface) More...
Go to the source code of this file.
Data Structures | |
struct | SVinfo |
data structure for Space Vehicle Information of a single satellite More... | |
struct | GpsState |
data structure for GPS information More... | |
struct | GpsTimeSync |
data structure for GPS time sync More... | |
Macros | |
#define | GPS_FIX_NONE 0x00 |
No GPS fix. More... | |
#define | GPS_FIX_2D 0x02 |
2D GPS fix More... | |
#define | GPS_FIX_3D 0x03 |
3D GPS fix More... | |
#define | GPS_FIX_DGPS 0x04 |
DGPS fix. More... | |
#define | GPS_FIX_RTK 0x05 |
RTK GPS fix. More... | |
#define | GpsFixValid() (gps.fix >= GPS_FIX_3D) |
#define | GpsIsLost() !GpsFixValid() |
#define | GPS_NB_CHANNELS 1 |
#define | GPS_TIMEOUT 2 |
GPS timeout in seconds. More... | |
#define | gps_Reset(_val) |
GPS Reset. More... | |
Functions | |
void | gps_init (void) |
initialize the global GPS state More... | |
void | gps_impl_init (void) |
GPS model specific init implementation. More... | |
void | gps_inject_data (uint8_t packet_id, uint8_t length, uint8_t *data) |
GPS packet injection (default empty) More... | |
static bool_t | gps_has_been_good (void) |
void | gps_periodic_check (void) |
Periodic GPS check. More... | |
uint32_t | gps_tow_from_sys_ticks (uint32_t sys_ticks) |
Convert time in sys_time ticks to GPS time of week. More... | |
Variables | |
struct GpsState | gps |
global GPS state More... | |
struct GpsTimeSync | gps_time_sync |
Device independent GPS code (interface)
Definition in file gps.h.
struct SVinfo |
data structure for Space Vehicle Information of a single satellite
Data Fields | ||
---|---|---|
int16_t | azim | azimuth in deg |
uint8_t | cno | Carrier to Noise Ratio (Signal Strength) in dbHz. |
int8_t | elev | elevation in deg |
uint8_t | flags | bitfield with GPS receiver specific flags |
uint8_t | qi | quality bitfield (GPS receiver specific) |
uint8_t | svid | Satellite ID. |
struct GpsState |
Data Fields | ||
---|---|---|
uint32_t | cacc | course accuracy in rad*1e7 |
int32_t | course | GPS course over ground in rad*1e7, [0, 2*Pi]*1e7 (CW/north) |
struct EcefCoor_i | ecef_pos | position in ECEF in cm |
struct EcefCoor_i | ecef_vel | speed ECEF in cm/s |
uint8_t | fix | status of fix |
uint16_t | gspeed | norm of 2d ground speed in cm/s |
int32_t | hmsl | height above mean sea level in mm |
uint32_t | last_3dfix_ticks | cpu time ticks at last valid 3D fix |
uint32_t | last_3dfix_time | cpu time in sec at last valid 3D fix |
uint32_t | last_msg_ticks | cpu time ticks at last received GPS message |
uint32_t | last_msg_time | cpu time in sec at last received GPS message |
struct LlaCoor_i | lla_pos | position in LLA (lat,lon: deg*1e7; alt: mm over ellipsoid) |
uint8_t | nb_channels | Number of scanned satellites. |
struct NedCoor_i | ned_vel | speed NED in cm/s |
uint8_t | num_sv | number of sat in fix |
uint32_t | pacc | position accuracy in cm |
uint16_t | pdop | position dilution of precision scaled by 100 |
uint16_t | reset | hotstart, warmstart, coldstart |
uint32_t | sacc | speed accuracy in cm/s |
uint16_t | speed_3d | norm of 3d speed in cm/s |
struct SVinfo | svinfos[GPS_NB_CHANNELS] | holds information from the Space Vehicles (Satellites) |
uint32_t | tow | GPS time of week in ms. |
struct UtmCoor_i | utm_pos | position in UTM (north,east: cm; alt: mm over ellipsoid) |
uint16_t | week | GPS week. |
struct GpsTimeSync |
#define GPS_FIX_2D 0x02 |
2D GPS fix
Definition at line 42 of file gps.h.
Referenced by gps_mtk_read_message(), gps_skytraq_read_message(), parse_ins_msg(), and sirf_parse_41().
#define GPS_FIX_3D 0x03 |
3D GPS fix
Definition at line 43 of file gps.h.
Referenced by ahrs_dcm_update_gps(), ahrs_fc_update_gps(), ahrs_icq_update_gps(), error_output(), get_fix_mode(), gps_cb(), gps_feed_value(), gps_mtk_msg(), gps_mtk_read_message(), gps_nmea_msg(), gps_parse(), gps_piksi_publish(), gps_sim_hitl_event(), gps_sim_publish(), gps_sirf_msg(), gps_skytraq_msg(), gps_skytraq_read_message(), gps_ubx_msg(), gps_ubx_read_message(), handle_ins_msg(), ins_float_invariant_update_gps(), ins_int_update_gps(), ins_vectornav_propagate(), parse_gps_datalink(), parse_ins_msg(), sbp_pos_ecef_callback(), sirf_parse_2(), and sirf_parse_41().
#define GPS_FIX_DGPS 0x04 |
#define GPS_FIX_NONE 0x00 |
No GPS fix.
Definition at line 41 of file gps.h.
Referenced by get_fix_mode(), gps_feed_value(), gps_impl_init(), gps_init(), gps_mtk_read_message(), gps_periodic_check(), gps_piksi_event(), gps_skytraq_read_message(), parse_ins_msg(), and sirf_parse_41().
#define GPS_FIX_RTK 0x05 |
#define gps_Reset | ( | _val | ) |
#define GPS_TIMEOUT 2 |
#define GpsFixValid | ( | ) | (gps.fix >= GPS_FIX_3D) |
Definition at line 47 of file gps.h.
Referenced by ahrs_chimu_update_gps(), alt_filter_periodic(), geo_mag_periodic(), gps_has_been_good(), and ins_reset_local_origin().
#define GpsIsLost | ( | ) | !GpsFixValid() |
Definition at line 49 of file gps.h.
Referenced by autopilot_on_rc_frame(), and failsafe_check().
|
inlinestatic |
Definition at line 120 of file gps.h.
References FALSE, GpsFixValid, and TRUE.
void gps_impl_init | ( | void | ) |
GPS model specific init implementation.
GPS model specific init implementation.
Definition at line 62 of file gps_datalink.c.
References GpsState::cacc, dops_node, GpsMtk::error_cnt, GpsUbx::error_cnt, GpsMtk::error_last, GpsUbx::error_last, FALSE, GpsState::fix, gps, gps_available, GPS_FIX_NONE, gps_has_fix, gps_mtk, GPS_MTK_ERR_NONE, GPS_NB_CHANNELS, GpsNmea::gps_nb_ovrn, gps_network, gps_nmea, gps_piksi_write(), gps_sirf, gps_skytraq, gps_time_node, gps_ubx, GPS_UBX_ERR_NONE, GPS_UDP_HOST, GpsState::gspeed, GpsNmea::have_gsv, GpsUbx::have_velned, GpsNmea::is_configured, ltp_def_from_ecef_i(), GpsMtk::msg_available, GpsNmea::msg_available, GpsUbx::msg_available, GpsSirf::msg_available, GpsNmea::msg_len, GpsSirf::msg_len, GpsState::nb_channels, nmea_configure(), nmea_parse_prop_init(), GpsNmea::pos_available, GpsSirf::pos_available, pos_ecef_node, pos_llh_node, GpsSirf::read_state, SBP_ANT_SET, sbp_dops_callback(), sbp_gps_time_callback(), sbp_pos_ecef_callback(), sbp_pos_llh_callback(), sbp_state, sbp_tracking_state_callback(), sbp_tracking_state_dep_a_callback(), SBP_UART_SET1, SBP_UART_SET2, SBP_UART_SET3, sbp_vel_ecef_callback(), sbp_vel_ned_callback(), GpsMtk::status, GpsUbx::status, GpsSkytraq::status, tracking_state_dep_a_node, tracking_state_node, TRUE, UNINIT, vel_ecef_node, and vel_ned_node.
Referenced by gps_init().
void gps_init | ( | void | ) |
initialize the global GPS state
Definition at line 135 of file gps.c.
References GpsState::cacc, DefaultPeriodic, GpsState::fix, gpio_setup_output(), gps, GPS_FIX_NONE, gps_impl_init(), GPS_POWER_GPIO, GpsState::last_3dfix_ticks, GpsState::last_3dfix_time, GpsState::last_msg_ticks, GpsState::last_msg_time, LED_OFF, register_periodic_telemetry(), GpsState::tow, and GpsState::week.
Referenced by init_ap(), and main_init().
GPS packet injection (default empty)
GPS packet injection (default empty)
Definition at line 384 of file gps_piksi.c.
References gps_piksi_write(), and sbp_state.
Referenced by dl_parse_msg().
void gps_periodic_check | ( | void | ) |
Periodic GPS check.
Marks GPS as lost when no GPS message was received for GPS_TIMEOUT seconds
Definition at line 166 of file gps.c.
References GpsState::fix, gps, GPS_FIX_NONE, GPS_TIMEOUT, GpsState::last_msg_time, and sys_time::nb_sec.
Referenced by failsafe_check(), and sensors_task().
Convert time in sys_time ticks to GPS time of week.
The resolution is sys_time.resolution
Definition at line 173 of file gps.c.
References gps_time_sync, msec_of_sys_time_ticks(), MSEC_PER_WEEK, GpsTimeSync::t0_ticks, and GpsTimeSync::t0_tow.
Referenced by trigger_ext_periodic(), and windturbine_periodic().
struct GpsState gps |
global GPS state
Definition at line 41 of file gps.c.
Referenced by alt_filter_periodic(), ArduIMU_periodicGPS(), b2_hff_update_gps(), baro_sim_periodic(), dc_send_shot_position(), error_output(), formation_flight(), generic_com_periodic(), geo_mag_event(), get_fix_mode(), gps_feed_value(), gps_impl_init(), gps_init(), gps_mtk_msg(), gps_mtk_read_message(), gps_nmea_msg(), gps_parse(), gps_periodic_check(), gps_piksi_event(), gps_piksi_publish(), gps_sim_hitl_event(), gps_sim_publish(), gps_sirf_msg(), gps_skytraq_msg(), gps_skytraq_read_message(), gps_ubx_msg(), gps_ubx_read_message(), gsm_send_report_continue(), gx3_packet_read_message(), handle_ins_msg(), ins_reset_altitude_ref(), ins_reset_local_origin(), ins_reset_utm_zone(), ins_vectornav_propagate(), ins_vectornav_read_message(), ins_vectornav_set_pacc(), ins_vectornav_set_sacc(), mavlink_send_gps_raw_int(), mavlink_send_gps_status(), meteo_stick_periodic(), mf_daq_send_report(), mf_ptu_periodic(), nmea_parse_GGA(), nmea_parse_GSA(), nmea_parse_GSV(), nmea_parse_perdcrv(), nmea_parse_RMC(), parse_gps_datalink(), parse_ins_msg(), potential_task(), push_gps_to_vision(), sbp_dops_callback(), sbp_gps_time_callback(), sbp_pos_ecef_callback(), sbp_pos_llh_callback(), sbp_tracking_state_callback(), sbp_tracking_state_dep_a_callback(), sbp_vel_ecef_callback(), sbp_vel_ned_callback(), send_status(), sim_use_gps_pos(), sirf_parse_2(), sirf_parse_41(), snav_on_time(), tcas_periodic_task_1Hz(), and vPoint().
struct GpsTimeSync gps_time_sync |
Definition at line 43 of file gps.c.
Referenced by gps_mtk_read_message(), gps_tow_from_sys_ticks(), and gps_ubx_read_message().