Paparazzi UAS
v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
|
Driver for Piksi modules from Swift-Nav. More...
#include "subsystems/gps/gps_piksi.h"
#include "subsystems/gps.h"
#include "subsystems/abi.h"
#include "mcu_periph/uart.h"
#include "math/pprz_geodetic_double.h"
#include <libsbp/sbp.h>
#include <libsbp/navigation.h>
#include <libsbp/observation.h>
#include <libsbp/tracking.h>
#include <libsbp/settings.h>
#include <libsbp/piksi.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 | 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) |
void | gps_impl_init (void) |
GPS initialization. More... | |
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 | |
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 |
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 55 of file gps_piksi.c.
Referenced by gps_piksi_event().
#define SBP_FIX_MODE_FLOAT 0X02 |
Definition at line 52 of file gps_piksi.c.
Referenced by get_fix_mode().
#define SBP_FIX_MODE_SPP 0X00 |
Definition at line 51 of file gps_piksi.c.
Referenced by get_fix_mode(), and sbp_pos_ecef_callback().
#define SPB_FIX_MODE_FIXED 0X01 |
Definition at line 53 of file gps_piksi.c.
Referenced by get_fix_mode().
Definition at line 267 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().
void gps_impl_init | ( | void | ) |
GPS initialization.
GPS model specific init implementation.
Definition at line 292 of file gps_piksi.c.
References dops_node, gps, GPS_NB_CHANNELS, gps_piksi_write(), gps_time_node, GpsState::nb_channels, pos_ecef_node, pos_llh_node, 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(), tracking_state_dep_a_node, tracking_state_node, vel_ecef_node, and vel_ned_node.
Override the default GPS packet injector to inject the data trough UART.
GPS packet injection (default empty)
Definition at line 384 of file gps_piksi.c.
Referenced by dl_parse_msg().
void gps_piksi_event | ( | void | ) |
Definition at line 325 of file gps_piksi.c.
References GpsState::fix, get_sys_time_msec(), gps, GPS_FIX_NONE, gps_piksi_read(), POS_ECEF_TIMEOUT, sbp_state, and uart_char_available().
|
static |
Definition at line 338 of file gps_piksi.c.
References GpsState::fix, get_sys_time_usec(), gps, GPS_FIX_3D, 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 356 of file gps_piksi.c.
References uart_char_available(), and uart_getch().
Referenced by gps_piksi_event().
Definition at line 372 of file gps_piksi.c.
References uart_put_byte().
Referenced by gps_impl_init(), and gps_inject_data().
|
static |
Definition at line 213 of file gps_piksi.c.
References gps, and GpsState::pdop.
Referenced by gps_impl_init().
|
static |
Definition at line 222 of file gps_piksi.c.
References gps, GpsState::tow, and GpsState::week.
Referenced by gps_impl_init().
|
static |
Definition at line 112 of file gps_piksi.c.
References GpsState::ecef_pos, GpsState::fix, get_fix_mode(), get_sys_time_msec(), gps, GPS_FIX_3D, gps_piksi_publish(), GpsState::num_sv, GpsState::pacc, SBP_FIX_MODE_SPP, GpsState::tow, EcefCoor_i::x, EcefCoor_i::y, and EcefCoor_i::z.
Referenced by gps_impl_init().
|
static |
Definition at line 152 of file gps_piksi.c.
References LlaCoor_i::alt, UtmCoor_f::alt, UtmCoor_i::alt, UtmCoor_f::east, UtmCoor_i::east, gps, GpsState::hmsl, LlaCoor_i::lat, LLA_FLOAT_OF_BFP, GpsState::lla_pos, LlaCoor_i::lon, nav_utm_zone0, UtmCoor_f::north, UtmCoor_i::north, utm_of_lla_f(), GpsState::utm_pos, UtmCoor_f::zone, and UtmCoor_i::zone.
Referenced by gps_impl_init().
|
static |
Definition at line 232 of file gps_piksi.c.
References SVinfo::cno, gps, SVinfo::svid, and GpsState::svinfos.
Referenced by gps_impl_init().
|
static |
Definition at line 248 of file gps_piksi.c.
References SVinfo::cno, gps, SVinfo::svid, and GpsState::svinfos.
Referenced by gps_impl_init().
|
static |
Definition at line 137 of file gps_piksi.c.
References GpsState::ecef_vel, gps, gps_piksi_publish(), GpsState::sacc, EcefCoor_i::x, EcefCoor_i::y, and EcefCoor_i::z.
Referenced by gps_impl_init().
|
static |
Definition at line 198 of file gps_piksi.c.
References GpsState::course, gps, GpsState::gspeed, int32_sqrt(), GpsState::ned_vel, NedCoor_i::x, NedCoor_i::y, and NedCoor_i::z.
Referenced by gps_impl_init().
sbp_msg_callbacks_node_t dops_node |
Definition at line 95 of file gps_piksi.c.
Referenced by gps_impl_init().
sbp_msg_callbacks_node_t gps_time_node |
Definition at line 96 of file gps_piksi.c.
Referenced by gps_impl_init().
sbp_msg_callbacks_node_t pos_ecef_node |
Definition at line 91 of file gps_piksi.c.
Referenced by gps_impl_init().
sbp_msg_callbacks_node_t pos_llh_node |
Definition at line 93 of file gps_piksi.c.
Referenced by gps_impl_init().
|
static |
Definition at line 65 of file gps_piksi.c.
Referenced by gps_impl_init().
sbp_state_t sbp_state |
Definition at line 85 of file gps_piksi.c.
Referenced by gps_impl_init(), gps_inject_data(), and gps_piksi_event().
|
static |
Definition at line 76 of file gps_piksi.c.
Referenced by gps_impl_init().
|
static |
Definition at line 77 of file gps_piksi.c.
Referenced by gps_impl_init().
|
static |
Definition at line 78 of file gps_piksi.c.
Referenced by gps_impl_init().
|
static |
Definition at line 105 of file gps_piksi.c.
sbp_msg_callbacks_node_t tracking_state_dep_a_node |
Definition at line 98 of file gps_piksi.c.
Referenced by gps_impl_init().
sbp_msg_callbacks_node_t tracking_state_node |
Definition at line 97 of file gps_piksi.c.
Referenced by gps_impl_init().
sbp_msg_callbacks_node_t vel_ecef_node |
Definition at line 92 of file gps_piksi.c.
Referenced by gps_impl_init().
sbp_msg_callbacks_node_t vel_ned_node |
Definition at line 94 of file gps_piksi.c.
Referenced by gps_impl_init().