sanity check on altitude, set unix seconds
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit

This commit is contained in:
Robin Müller 2021-09-07 16:42:04 +02:00
parent e837532b22
commit a4cd99ec90
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814

View File

@ -101,7 +101,13 @@ ReturnValue_t GPSHyperionHandler::scanForReply(const uint8_t *start, size_t len,
gpsSet.latitude.value = gpsData.latitude; gpsSet.latitude.value = gpsData.latitude;
// Negative longitude -> West direction // Negative longitude -> West direction
gpsSet.longitude.value = gpsData.longitude; gpsSet.longitude.value = gpsData.longitude;
if(gpsData.altitude > 600000.0 or gpsData.altitude < 400000.0) {
gpsSet.altitude.setValid(false);
}
else {
gpsSet.altitude.setValid(true);
gpsSet.altitude.value = gpsData.altitude; gpsSet.altitude.value = gpsData.altitude;
}
gpsSet.fixMode.value = gpsData.fix_mode; gpsSet.fixMode.value = gpsData.fix_mode;
gpsSet.satInUse.value = gpsData.sats_in_use; gpsSet.satInUse.value = gpsData.sats_in_use;
Clock::TimeOfDay_t timeStruct = {}; Clock::TimeOfDay_t timeStruct = {};
@ -120,6 +126,7 @@ ReturnValue_t GPSHyperionHandler::scanForReply(const uint8_t *start, size_t len,
gpsSet.hours = gpsData.hours; gpsSet.hours = gpsData.hours;
gpsSet.minutes = gpsData.minutes; gpsSet.minutes = gpsData.minutes;
gpsSet.seconds = gpsData.seconds; gpsSet.seconds = gpsData.seconds;
gpsSet.unixSeconds = timeval.tv_sec;
if(debugHyperionGps) { if(debugHyperionGps) {
sif::info << "GPS Data" << std::endl; sif::info << "GPS Data" << std::endl;
printf("Valid status: %d\n", gpsData.is_valid); printf("Valid status: %d\n", gpsData.is_valid);