29 #define SBP_DEBUGGING 1 30 #define SBP_HW_LOGGING 1 32 #define SBP_TIMEOUT_HEATBEAT 4000 33 #define SBP_TIMEOUT_PVT 500 36 # define Debug(fmt, args ...) \ 38 hal.console->printf("%s:%d: " fmt "\n", \ 39 __FUNCTION__, __LINE__, \ 41 hal.scheduler->delay(1); \ 44 # define Debug(fmt, args ...) 52 Debug(
"SBP Driver Initialized");
87 Debug(
"PIKSI: Not enough TXSPACE");
159 Debug(
"CRC Error Occurred!");
195 if (pos_llh->
flags == 0) {
197 }
else if (pos_llh->
flags == 1 || pos_llh->
flags == 2) {
242 Debug(
"No Heartbeats from Piksi! Driver Ready to Die!");
276 if (pos_llh->
flags == 0) {
278 }
else if (pos_llh->
flags == 2) {
280 }
else if (pos_llh->
flags == 1) {
317 switch (state.
state) {
365 *((uint8_t*)&(state.
crc) + state.
n_read) = data;
424 pages += (msg_len - 48) / 104 + 1;
436 memcpy(pkt.
data, msg_buff,
MIN(msg_len, 48));
439 for (uint8_t i = 0; i < pages - 1; i++) {
445 index : uint8_t(i + 2),
449 memcpy(pkt2.
data, &msg_buff[48 + i * 104],
MIN(msg_len - (48 + i * 104), 104));
454 #endif // SBP_HW_LOGGING
uint32_t time_week_ms
GPS time (milliseconds from start of GPS week)
static const uint16_t SBP_VEL_NED_MSGTYPE
AP_GPS_SBP(AP_GPS &_gps, AP_GPS::GPS_State &_state, AP_HAL::UARTDriver *_port)
uint32_t last_gps_time_ms
the system time we got the last GPS timestamp, milliseconds
float safe_sqrt(const T v)
#define Debug(fmt, args ...)
uint8_t heartbeat_buff[4]
GPS_Status status
driver fix status
bool have_vertical_velocity
does GPS give vertical velocity? Set to true only once available.
Vector3f velocity
3D velocity in m/s, in NED format
struct AP_GPS_SBP::sbp_parser_state_t parser_state
void WriteBlock(const void *pBuffer, uint16_t size)
virtual uint32_t txspace()=0
uint32_t last_full_update_cpu_ms
struct sbp_pos_llh_t last_pos_llh_rtk
static const uint8_t SBP_PREAMBLE
enum SBP_detect_state::@36 state
void logging_log_full_update()
bool _attempt_state_update()
static const uint16_t SBP_IAR_STATE_MSGTYPE
int32_t lat
param 3 - Latitude * 10**7
void _sbp_process_message()
Receiving valid messages and 3D RTK Fixed.
AP_GPS & gps
access to frontend (for parameters)
struct sbp_vel_ned_t last_vel_ned
float wrap_360(const T angle, float unit_mod)
struct sbp_pos_llh_t last_pos_llh_spp
static const uint16_t SBP_HEARTBEAT_MSGTYPE
int32_t alt
param 2 - Altitude in centimeters (meters * 100) see LOCATION_ALT_MAX_M
static const uint16_t SBP_TRACKING_STATE_MSGTYPE
Receiving valid messages and 3D RTK Float.
static const uint16_t SBP_GPS_TIME_MSGTYPE
virtual size_t write(uint8_t)=0
uint32_t crc_error_counter
int32_t rtk_iar_num_hypotheses
Current number of integer ambiguity hypotheses.
static DataFlash_Class * instance(void)
static const uint16_t SBP_POS_LLH_MSGTYPE
uint16_t time_week
GPS week number.
AP_GPS::GPS_State & state
public state for this instance
uint32_t last_iar_num_hypotheses
bool should_df_log() const
virtual uint32_t available()=0
Location location
last fix location
#define SBP_TIMEOUT_HEATBEAT
int32_t lng
param 4 - Longitude * 10**7
void logging_log_raw_sbp(uint16_t msg_type, uint16_t sender_id, uint8_t msg_len, uint8_t *msg_buff)
Receiving valid GPS messages but no lock.
void inject_data(const uint8_t *data, uint16_t len) override
enum AP_GPS_SBP::sbp_parser_state_t::@33 state
static bool _detect(struct SBP_detect_state &state, uint8_t data)
struct sbp_dops_t last_dops
AP_HAL::UARTDriver * port
UART we are attached to.
struct sbp_gps_time_t last_gps_time
float ground_speed
ground speed in m/sec
Receiving valid messages and 3D lock.
static const uint16_t SBP_DOPS_MSGTYPE
uint16_t hdop
horizontal dilution of precision in cm
#define LOG_PACKET_HEADER_INIT(id)
uint16_t crc16_ccitt(const uint8_t *buf, uint32_t len, uint16_t crc)
uint32_t last_injected_data_ms
uint8_t num_sats
Number of visible satellites.
uint32_t last_heatbeat_received_ms
uint32_t last_full_update_tow
float ground_course
ground course in degrees