Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
Driver for Piksi modules from Swift-Nav. More...
#include "modules/gps/gps_piksi.h"
#include "modules/gps/gps.h"
#include "modules/core/abi.h"
#include "mcu_periph/uart.h"
#include "math/pprz_geodetic_double.h"
#include "generated/flight_plan.h"
#include <libsbp/sbp.h>
#include <libsbp/navigation.h>
#include <libsbp/observation.h>
#include <libsbp/tracking.h>
#include <libsbp/system.h>
#include <libsbp/settings.h>
#include <libsbp/piksi.h>
#include "modules/datalink/telemetry.h"
Go to the source code of this file.
Macros | |
#define | SBP_FIX_MODE_SPP 0X00 |
#define | SBP_FIX_MODE_FLOAT 0X02 |
#define | SPB_FIX_MODE_FIXED 0X01 |
#define | POS_ECEF_TIMEOUT 1000 |
Functions | |
static void | send_piksi_heartbeat (struct transport_tx *trans, struct link_device *dev) |
static void | gps_piksi_publish (void) |
static uint8_t | get_fix_mode (uint8_t flags) |
uint32_t | gps_piksi_read (uint8_t *buff, uint32_t n, void *context) |
uint32_t | gps_piksi_write (uint8_t *buff, uint32_t n, void *context) |
static void | sbp_pos_ecef_callback (uint16_t sender_id, uint8_t len, uint8_t msg[], void *context) |
static void | sbp_vel_ecef_callback (uint16_t sender_id, uint8_t len, uint8_t msg[], void *context) |
static void | sbp_pos_llh_callback (uint16_t sender_id, uint8_t len, uint8_t msg[], void *context) |
static void | sbp_vel_ned_callback (uint16_t sender_id, uint8_t len, uint8_t msg[], void *context) |
static void | sbp_dops_callback (uint16_t sender_id, uint8_t len, uint8_t msg[], void *context) |
static void | sbp_gps_time_callback (uint16_t sender_id, uint8_t len, uint8_t msg[], void *context) |
static void | sbp_tracking_state_callback (uint16_t sender_id, uint8_t len, uint8_t msg[], void *context) |
static void | sbp_tracking_state_dep_a_callback (uint16_t sender_id, uint8_t len, uint8_t msg[], void *context) |
static void | spb_heartbeat_callback (uint16_t sender_id, uint8_t len, uint8_t msg[], void *context) |
void | gps_piksi_init (void) |
void | gps_piksi_event (void) |
void | gps_inject_data (uint8_t packet_id, uint8_t length, uint8_t *data) |
Override the default GPS packet injector to inject the data trough UART. More... | |
Variables | |
struct GpsState | gps_piksi |
struct GpsTimeSync | gps_piksi_time_sync |
static uint32_t | time_since_last_heartbeat |
static const char | SBP_ANT_SET [] = "frontend""\x00""antenna_selection""\x00""Patch" |
static const char | SBP_UART_SET1 [] = "uart_uartb""\x00""mode""\x00""SBP" |
static const char | SBP_UART_SET2 [] = "uart_uartb""\x00""sbp_message_mask""\x00""784" |
static const char | SBP_UART_SET3 [] = "uart_uartb""\x00""configure_telemetry_radio_on_boot""\x00""False" |
sbp_state_t | sbp_state |
sbp_msg_callbacks_node_t | pos_ecef_node |
sbp_msg_callbacks_node_t | vel_ecef_node |
sbp_msg_callbacks_node_t | pos_llh_node |
sbp_msg_callbacks_node_t | vel_ned_node |
sbp_msg_callbacks_node_t | dops_node |
sbp_msg_callbacks_node_t | gps_time_node |
sbp_msg_callbacks_node_t | tracking_state_node |
sbp_msg_callbacks_node_t | tracking_state_dep_a_node |
sbp_msg_callbacks_node_t | heartbeat_node |
static uint32_t | time_since_last_pos_update |
Driver for Piksi modules from Swift-Nav.
http://docs.swiftnav.com/wiki/Piksi_Integration_Tutorial https://github.com/swift-nav/sbp_tutorial
Definition in file gps_piksi.c.
#define POS_ECEF_TIMEOUT 1000 |
Definition at line 54 of file gps_piksi.c.
#define SBP_FIX_MODE_FLOAT 0X02 |
Definition at line 51 of file gps_piksi.c.
#define SBP_FIX_MODE_SPP 0X00 |
Definition at line 50 of file gps_piksi.c.
#define SPB_FIX_MODE_FIXED 0X01 |
Definition at line 52 of file gps_piksi.c.
Definition at line 283 of file gps_piksi.c.
References GpsState::fix, gps, GPS_FIX_3D, GPS_FIX_DGPS, GPS_FIX_NONE, GPS_FIX_RTK, SBP_FIX_MODE_FLOAT, SBP_FIX_MODE_SPP, and SPB_FIX_MODE_FIXED.
Referenced by sbp_pos_ecef_callback().
Override the default GPS packet injector to inject the data trough UART.
GPS packet injection (default empty)
Definition at line 408 of file gps_piksi.c.
References gps_piksi_write(), and sbp_state.
void gps_piksi_event | ( | void | ) |
Definition at line 349 of file gps_piksi.c.
References GpsState::fix, get_sys_time_msec(), GPS_FIX_NONE, gps_piksi, gps_piksi_read(), POS_ECEF_TIMEOUT, sbp_state, time_since_last_pos_update, and uart_char_available().
void gps_piksi_init | ( | void | ) |
Definition at line 308 of file gps_piksi.c.
References GpsState::comp_id, DefaultPeriodic, dops_node, gps_piksi, GPS_PIKSI_ID, gps_piksi_write(), gps_time_node, heartbeat_node, GpsState::nb_channels, pos_ecef_node, pos_llh_node, register_periodic_telemetry(), 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(), send_piksi_heartbeat(), spb_heartbeat_callback(), tracking_state_dep_a_node, tracking_state_node, vel_ecef_node, and vel_ned_node.
|
static |
Definition at line 362 of file gps_piksi.c.
References GpsState::fix, get_sys_time_usec(), GPS_FIX_3D, gps_piksi, GPS_PIKSI_ID, GpsState::last_3dfix_ticks, GpsState::last_3dfix_time, GpsState::last_msg_ticks, GpsState::last_msg_time, sys_time::nb_sec, and sys_time::nb_sec_rem.
Referenced by sbp_pos_ecef_callback(), and sbp_vel_ecef_callback().
Definition at line 380 of file gps_piksi.c.
References buff, uart_char_available(), and uart_getch().
Referenced by gps_piksi_event().
Definition at line 396 of file gps_piksi.c.
References buff, and uart_put_byte().
Referenced by gps_inject_data(), and gps_piksi_init().
|
static |
Definition at line 221 of file gps_piksi.c.
References gps_piksi, msg, and GpsState::pdop.
Referenced by gps_piksi_init().
|
static |
Definition at line 230 of file gps_piksi.c.
References gps_piksi, msg, GpsState::tow, and GpsState::week.
Referenced by gps_piksi_init().
|
static |
Definition at line 131 of file gps_piksi.c.
References GpsState::ecef_pos, GpsState::fix, get_fix_mode(), get_sys_time_msec(), GPS_FIX_3D, gps_piksi, gps_piksi_publish(), GPS_VALID_POS_ECEF_BIT, msg, GpsState::num_sv, GpsState::pacc, SBP_FIX_MODE_SPP, time_since_last_pos_update, GpsState::tow, GpsState::valid_fields, EcefCoor_i::x, EcefCoor_i::y, and EcefCoor_i::z.
Referenced by gps_piksi_init().
|
static |
Definition at line 173 of file gps_piksi.c.
References LlaCoor_i::alt, gps_piksi, GPS_VALID_HMSL_BIT, GPS_VALID_POS_LLA_BIT, GpsState::hmsl, LlaCoor_i::lat, GpsState::lla_pos, LlaCoor_i::lon, msg, and GpsState::valid_fields.
Referenced by gps_piksi_init().
|
static |
Definition at line 240 of file gps_piksi.c.
References SVinfo::cno, gps_piksi, msg, SVinfo::svid, and GpsState::svinfos.
Referenced by gps_piksi_init().
|
static |
Definition at line 256 of file gps_piksi.c.
References SVinfo::cno, gps_piksi, msg, SVinfo::svid, and GpsState::svinfos.
Referenced by gps_piksi_init().
|
static |
Definition at line 157 of file gps_piksi.c.
References GpsState::ecef_vel, gps_piksi, gps_piksi_publish(), GPS_VALID_VEL_ECEF_BIT, msg, GpsState::sacc, GpsState::valid_fields, EcefCoor_i::x, EcefCoor_i::y, and EcefCoor_i::z.
Referenced by gps_piksi_init().
|
static |
Definition at line 205 of file gps_piksi.c.
References GpsState::course, gps_piksi, GPS_VALID_COURSE_BIT, GPS_VALID_VEL_NED_BIT, GpsState::gspeed, int32_sqrt(), msg, GpsState::ned_vel, GpsState::valid_fields, NedCoor_i::x, NedCoor_i::y, and NedCoor_i::z.
Referenced by gps_piksi_init().
|
static |
Definition at line 67 of file gps_piksi.c.
References dev, and time_since_last_heartbeat.
Referenced by gps_piksi_init().
|
static |
Definition at line 272 of file gps_piksi.c.
References get_sys_time_msec(), and time_since_last_heartbeat.
Referenced by gps_piksi_init().
sbp_msg_callbacks_node_t dops_node |
Definition at line 113 of file gps_piksi.c.
Referenced by gps_piksi_init().
struct GpsState gps_piksi |
Definition at line 1 of file gps_piksi.c.
Referenced by gps_piksi_event(), gps_piksi_init(), gps_piksi_publish(), 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(), and sbp_vel_ned_callback().
struct GpsTimeSync gps_piksi_time_sync |
Definition at line 1 of file gps_piksi.c.
sbp_msg_callbacks_node_t gps_time_node |
Definition at line 114 of file gps_piksi.c.
Referenced by gps_piksi_init().
sbp_msg_callbacks_node_t heartbeat_node |
Definition at line 117 of file gps_piksi.c.
Referenced by gps_piksi_init().
sbp_msg_callbacks_node_t pos_ecef_node |
Definition at line 109 of file gps_piksi.c.
Referenced by gps_piksi_init().
sbp_msg_callbacks_node_t pos_llh_node |
Definition at line 111 of file gps_piksi.c.
Referenced by gps_piksi_init().
|
static |
Definition at line 83 of file gps_piksi.c.
Referenced by gps_piksi_init().
sbp_state_t sbp_state |
Definition at line 103 of file gps_piksi.c.
Referenced by gps_inject_data(), gps_piksi_event(), and gps_piksi_init().
|
static |
Definition at line 94 of file gps_piksi.c.
Referenced by gps_piksi_init().
|
static |
Definition at line 95 of file gps_piksi.c.
Referenced by gps_piksi_init().
|
static |
Definition at line 96 of file gps_piksi.c.
Referenced by gps_piksi_init().
|
static |
Definition at line 62 of file gps_piksi.c.
Referenced by send_piksi_heartbeat(), and spb_heartbeat_callback().
|
static |
Definition at line 124 of file gps_piksi.c.
Referenced by gps_piksi_event(), and sbp_pos_ecef_callback().
sbp_msg_callbacks_node_t tracking_state_dep_a_node |
Definition at line 116 of file gps_piksi.c.
Referenced by gps_piksi_init().
sbp_msg_callbacks_node_t tracking_state_node |
Definition at line 115 of file gps_piksi.c.
Referenced by gps_piksi_init().
sbp_msg_callbacks_node_t vel_ecef_node |
Definition at line 110 of file gps_piksi.c.
Referenced by gps_piksi_init().
sbp_msg_callbacks_node_t vel_ned_node |
Definition at line 112 of file gps_piksi.c.
Referenced by gps_piksi_init().