hyperion handler working now
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
This commit is contained in:
parent
604424c7ed
commit
9998b54f89
@ -208,7 +208,9 @@ void initmission::initTasks() {
|
|||||||
#endif /* OBSW_ADD_STAR_TRACKER == 1 */
|
#endif /* OBSW_ADD_STAR_TRACKER == 1 */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//acsCtrl->startTask();
|
#if OBSW_ADD_ACS_HANDLERS == 1
|
||||||
|
acsCtrl->startTask();
|
||||||
|
#endif
|
||||||
|
|
||||||
sif::info << "Tasks started.." << std::endl;
|
sif::info << "Tasks started.." << std::endl;
|
||||||
}
|
}
|
||||||
|
@ -98,33 +98,35 @@ void GPSHyperionHandler::readGpsDataFromGpsd() {
|
|||||||
// The data from the device will generally be read all at once. Therefore, we
|
// The data from the device will generally be read all at once. Therefore, we
|
||||||
// can set all field here
|
// can set all field here
|
||||||
gpsmm gpsmm(GPSD_SHARED_MEMORY, 0);
|
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_data_t *gps;
|
||||||
gps = gpsmm.read();
|
gps = gpsmm.read();
|
||||||
if (gps == nullptr) {
|
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);
|
PoolReadGuard pg(&gpsSet);
|
||||||
if (pg.getReadResult() != HasReturnvaluesIF::RETURN_OK) {
|
if (pg.getReadResult() != HasReturnvaluesIF::RETURN_OK) {
|
||||||
#if FSFW_VERBOSE_LEVEL >= 1
|
#if FSFW_VERBOSE_LEVEL >= 1
|
||||||
sif::warning << "GPSHyperionHandler::scanForReply: Reading dataset failed" << std::endl;
|
sif::warning << "GPSHyperionHandler::readGpsDataFromGpsd: Reading dataset failed" << std::endl;
|
||||||
#endif
|
#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.setValidity(true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
gpsSet.satInUse.value = gps->satellites_used;
|
gpsSet.satInUse.value = gps->satellites_used;
|
||||||
gpsSet.satInView.value = gps->satellites_visible;
|
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)) {
|
if (std::isfinite(gps->fix.latitude)) {
|
||||||
// Negative latitude -> South direction
|
// Negative latitude -> South direction
|
||||||
gpsSet.latitude.value = gps->fix.latitude;
|
gpsSet.latitude.value = gps->fix.latitude;
|
||||||
|
Loading…
Reference in New Issue
Block a user