Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/master/libraries/AP_DAL/AP_DAL_GPS.cpp
Views: 1798
#include "AP_DAL_GPS.h"12#include <AP_Logger/AP_Logger.h>3#include "AP_DAL.h"45AP_DAL_GPS::AP_DAL_GPS()6{7for (uint8_t i=0; i<ARRAY_SIZE(_RGPI); i++) {8_RGPI[i].instance = i;9_RGPJ[i].instance = i;10}11}1213void AP_DAL_GPS::start_frame()14{15const auto &gps = AP::gps();1617const log_RGPH old_RGPH = _RGPH;18_RGPH.primary_sensor = gps.primary_sensor();19_RGPH.num_sensors = gps.num_sensors();2021WRITE_REPLAY_BLOCK_IFCHANGED(RGPH, _RGPH, old_RGPH);2223for (uint8_t i=0; i<ARRAY_SIZE(_RGPI); i++) {24log_RGPI &RGPI = _RGPI[i];25log_RGPJ &RGPJ = _RGPJ[i];26const log_RGPI old_RGPI = RGPI;27const log_RGPJ old_RGPJ = RGPJ;2829RGPI.status = (GPS_Status)gps.status(i);30RGPI.antenna_offset = gps.get_antenna_offset(i);3132const Location &loc = gps.location(i);33RGPJ.last_message_time_ms = gps.last_message_time_ms(i);34RGPJ.lat = loc.lat;35RGPJ.lng = loc.lng;36RGPJ.alt = loc.alt;37RGPI.have_vertical_velocity = gps.have_vertical_velocity(i);3839RGPI.horizontal_accuracy_returncode = gps.horizontal_accuracy(i, RGPJ.hacc);40RGPI.vertical_accuracy_returncode = gps.vertical_accuracy(i, RGPJ.vacc);41RGPJ.hdop = gps.get_hdop(i);42RGPI.num_sats = gps.num_sats(i);43RGPI.get_lag_returncode = gps.get_lag(i, RGPI.lag_sec);4445RGPJ.velocity = gps.velocity(i);46RGPI.speed_accuracy_returncode = gps.speed_accuracy(i, RGPJ.sacc);47RGPI.gps_yaw_deg_returncode = gps.gps_yaw_deg(i, RGPJ.yaw_deg, RGPJ.yaw_accuracy_deg, RGPJ.yaw_deg_time_ms);4849WRITE_REPLAY_BLOCK_IFCHANGED(RGPI, RGPI, old_RGPI);50WRITE_REPLAY_BLOCK_IFCHANGED(RGPJ, RGPJ, old_RGPJ);5152tmp_location[i].lat = RGPJ.lat;53tmp_location[i].lng = RGPJ.lng;54tmp_location[i].alt = RGPJ.alt;55}56}575859