bugfixes and improvements
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
- Tests finished
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
#include "OBSWConfig.h"
|
||||
#include "fsfw/datapool/PoolReadGuard.h"
|
||||
#include "fsfw/timemanager/Clock.h"
|
||||
|
||||
#include "linux/utility/utility.h"
|
||||
#include "mission/utility/compileTime.h"
|
||||
|
||||
#if FSFW_DEV_HYPERION_GPS_CREATE_NMEA_CSV == 1
|
||||
@ -127,9 +127,14 @@ void GPSHyperionLinuxController::readGpsDataFromGpsd() {
|
||||
return;
|
||||
}
|
||||
|
||||
bool validFix = false;
|
||||
static_cast<void>(validFix);
|
||||
// 0: Not seen, 1: No fix, 2: 2D-Fix, 3: 3D-Fix
|
||||
int newFixMode = gps->fix.mode;
|
||||
if(gpsSet.fixMode.value != newFixMode) {
|
||||
if (newFixMode == 2 or newFixMode == 3) {
|
||||
validFix = true;
|
||||
}
|
||||
if (gpsSet.fixMode.value != newFixMode) {
|
||||
triggerEvent(GpsHyperion::GPS_FIX_CHANGE, gpsSet.fixMode.value, newFixMode);
|
||||
}
|
||||
gpsSet.fixMode.value = newFixMode;
|
||||
@ -185,11 +190,19 @@ void GPSHyperionLinuxController::readGpsDataFromGpsd() {
|
||||
} else {
|
||||
timeIsConstantCounter = 0;
|
||||
}
|
||||
if (timeInit) {
|
||||
if (not utility::timeSanityCheck()) {
|
||||
sif::info << "Setting init clock in gps ctrl" << std::endl;
|
||||
// For some reason, the clock needs to be somewhat correct for NTP to work. Really dumb..
|
||||
Clock::setClock(&time);
|
||||
}
|
||||
timeInit = false;
|
||||
}
|
||||
// If the received time does not change anymore for whatever reason, do not set it here
|
||||
// to avoid stale times. Also, don't do it too often often to avoid jumping times
|
||||
if (timeIsConstantCounter < 20 and timeUpdateCd.hasTimedOut()) {
|
||||
// Update the system time here for now. NTP seems to be unable to do so for whatever reason.
|
||||
// Further tests have shown that the time seems to be set by NTPD after sme time..
|
||||
// Further tests have shown that the time seems to be set by NTPD after some time..
|
||||
// Clock::setClock(&time);
|
||||
timeUpdateCd.resetTimer();
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
#ifndef MISSION_DEVICES_GPSHYPERIONHANDLER_H_
|
||||
#define MISSION_DEVICES_GPSHYPERIONHANDLER_H_
|
||||
|
||||
#include "fsfw/FSFW.h"
|
||||
#include "commonSubsystemIds.h"
|
||||
#include "fsfw/FSFW.h"
|
||||
#include "fsfw/controller/ExtendedControllerBase.h"
|
||||
#include "fsfw/devicehandlers/DeviceHandlerBase.h"
|
||||
#include "mission/devices/devicedefinitions/GPSDefinitions.h"
|
||||
@ -24,7 +24,6 @@ class GPSHyperionLinuxController : public ExtendedControllerBase {
|
||||
public:
|
||||
static constexpr uint32_t MAX_SECONDS_TO_REACH_FIX = 60 * 60 * 5;
|
||||
|
||||
|
||||
GPSHyperionLinuxController(object_id_t objectId, object_id_t parentId,
|
||||
bool debugHyperionGps = false);
|
||||
virtual ~GPSHyperionLinuxController();
|
||||
@ -52,6 +51,7 @@ class GPSHyperionLinuxController : public ExtendedControllerBase {
|
||||
GpsPrimaryDataset gpsSet;
|
||||
Countdown maxTimeToReachFix = Countdown(MAX_SECONDS_TO_REACH_FIX * 1000);
|
||||
bool modeCommanded = true;
|
||||
bool timeInit = true;
|
||||
gpsmm myGpsmm;
|
||||
bool debugHyperionGps = false;
|
||||
uint32_t timeIsConstantCounter = 0;
|
||||
|
Reference in New Issue
Block a user