hyperion handler working now
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good

This commit is contained in:
Robin Müller 2022-01-26 16:35:42 +01:00
parent 604424c7ed
commit 9998b54f89
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
2 changed files with 16 additions and 12 deletions

View File

@ -208,7 +208,9 @@ void initmission::initTasks() {
#endif /* OBSW_ADD_STAR_TRACKER == 1 */
#endif
//acsCtrl->startTask();
#if OBSW_ADD_ACS_HANDLERS == 1
acsCtrl->startTask();
#endif
sif::info << "Tasks started.." << std::endl;
}

View File

@ -98,33 +98,35 @@ void GPSHyperionHandler::readGpsDataFromGpsd() {
// The data from the device will generally be read all at once. Therefore, we
// can set all field here
gpsmm gpsmm(GPSD_SHARED_MEMORY, 0);
if(not gpsmm.is_open()) {
// Opening failed
#if FSFW_VERBOSE_LEVEL >= 1
sif::warning << "GPSHyperionHandler::readGpsDataFromGpsd: Opening GPSMM failed" << std::endl;
#endif
}
gps_data_t *gps;
gps = gpsmm.read();
if (gps == nullptr) {
sif::warning << "Q7STestTask: Reading GPS data failed" << std::endl;
sif::warning << "GPSHyperionHandler::readGpsDataFromGpsd: Reading GPS data failed" << std::endl;
}
PoolReadGuard pg(&gpsSet);
if (pg.getReadResult() != HasReturnvaluesIF::RETURN_OK) {
#if FSFW_VERBOSE_LEVEL >= 1
sif::warning << "GPSHyperionHandler::scanForReply: Reading dataset failed" << std::endl;
sif::warning << "GPSHyperionHandler::readGpsDataFromGpsd: Reading dataset failed" << std::endl;
#endif
}
// Print messages
if ((gps->set & MODE_SET) != MODE_SET) {
// Could not even set mode
gpsSet.setValidity(false, true);
return;
}
if (gps->satellites_used > 0) {
// 0: Not seen, 1: No fix, 2: 2D-Fix, 3: 3D-Fix
gpsSet.fixMode.value = gps->fix.mode;
if(gps->fix.mode == 0 or gps->fix.mode == 1) {
gpsSet.setValidity(false, true);
} else if (gps->satellites_used > 0) {
gpsSet.setValidity(true, true);
}
gpsSet.satInUse.value = gps->satellites_used;
gpsSet.satInView.value = gps->satellites_visible;
// 0: Not seen, 1: No fix, 2: 2D-Fix, 3: 3D-Fix
gpsSet.fixMode = gps->fix.mode;
if (std::isfinite(gps->fix.latitude)) {
// Negative latitude -> South direction
gpsSet.latitude.value = gps->fix.latitude;