#include "Tracker.h"
void Tracker::update_ahrs()
{
ahrs.update();
}
void Tracker::update_compass(void)
{
compass.read();
}
void Tracker::update_GPS(void)
{
gps.update();
static uint32_t last_gps_msg_ms;
static uint8_t ground_start_count = 5;
if (gps.last_message_time_ms() != last_gps_msg_ms &&
gps.status() >= AP_GPS::GPS_OK_FIX_3D) {
last_gps_msg_ms = gps.last_message_time_ms();
if (ground_start_count > 1) {
ground_start_count--;
} else if (ground_start_count == 1) {
if (current_loc.lat == 0 && current_loc.lng == 0) {
ground_start_count = 5;
} else {
current_loc = gps.location();
IGNORE_RETURN(set_home(current_loc, false));
ground_start_count = 0;
}
}
}
}
void Tracker::handle_battery_failsafe(const char* type_str, const int8_t action)
{
}