gps test worked
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
This commit is contained in:
parent
2323fd0506
commit
e73dc2f191
@ -66,6 +66,7 @@ set(LIB_ARCSEC wire)
|
|||||||
set(THIRD_PARTY_FOLDER thirdparty)
|
set(THIRD_PARTY_FOLDER thirdparty)
|
||||||
set(LIB_CXX_FS -lstdc++fs)
|
set(LIB_CXX_FS -lstdc++fs)
|
||||||
set(LIB_CATCH2 Catch2)
|
set(LIB_CATCH2 Catch2)
|
||||||
|
set(LIB_GPS gps)
|
||||||
set(LIB_JSON_NAME nlohmann_json::nlohmann_json)
|
set(LIB_JSON_NAME nlohmann_json::nlohmann_json)
|
||||||
|
|
||||||
# Set path names
|
# Set path names
|
||||||
@ -221,6 +222,7 @@ if((NOT BUILD_Q7S_SIMPLE_MODE) AND (NOT EIVE_BUILD_WATCHDOG))
|
|||||||
if(TGT_BSP MATCHES "arm/q7s")
|
if(TGT_BSP MATCHES "arm/q7s")
|
||||||
target_link_libraries(${TARGET_NAME} PRIVATE
|
target_link_libraries(${TARGET_NAME} PRIVATE
|
||||||
${LIB_ARCSEC}
|
${LIB_ARCSEC}
|
||||||
|
${LIB_GPS}
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
@ -12,8 +12,12 @@
|
|||||||
#include "test/DummyParameter.h"
|
#include "test/DummyParameter.h"
|
||||||
|
|
||||||
#include <nlohmann/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
|
#include <gps.h>
|
||||||
|
#include <libgpsmm.h>
|
||||||
|
|
||||||
|
#include <ctime>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <iomanip>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
|
||||||
@ -31,6 +35,11 @@ ReturnValue_t Q7STestTask::performOneShotAction() {
|
|||||||
return TestTask::performOneShotAction();
|
return TestTask::performOneShotAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ReturnValue_t Q7STestTask::performPeriodicAction() {
|
||||||
|
testGpsDaemon();
|
||||||
|
return TestTask::performPeriodicAction();
|
||||||
|
}
|
||||||
|
|
||||||
void Q7STestTask::testSdCard() {
|
void Q7STestTask::testSdCard() {
|
||||||
using namespace std;
|
using namespace std;
|
||||||
Stopwatch stopwatch;
|
Stopwatch stopwatch;
|
||||||
@ -224,6 +233,26 @@ void Q7STestTask::testProtHandler() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Q7STestTask::testGpsDaemon() {
|
||||||
|
gpsmm gpsmm(GPSD_SHARED_MEMORY, 0);
|
||||||
|
gps_data_t* gps;
|
||||||
|
gps = gpsmm.read();
|
||||||
|
if(gps == nullptr) {
|
||||||
|
sif::warning << "Q7STestTask: Reading GPS data failed" << std::endl;
|
||||||
|
}
|
||||||
|
sif::info << "-- Q7STestTask: GPS shared memory read test --" << std::endl;
|
||||||
|
time_t timeRaw = gps->fix.time.tv_sec;
|
||||||
|
std::tm* time = gmtime(&timeRaw);
|
||||||
|
sif::info << "Time: " << std::put_time(time, "%c %Z") << std::endl;
|
||||||
|
sif::info << "Visible satellites: " << gps->satellites_visible << std::endl;
|
||||||
|
sif::info << "Satellites used: " << gps->satellites_used << std::endl;
|
||||||
|
sif::info << "Fix (0:Not Seen|1:No Fix|2:2D|3:3D): " << gps->fix.mode << std::endl;
|
||||||
|
sif::info << "Latitude: " << gps->fix.latitude << std::endl;
|
||||||
|
sif::info << "Longitude: " << gps->fix.longitude << std::endl;
|
||||||
|
sif::info << "Altitude(MSL): " << gps->fix.altMSL << std::endl;
|
||||||
|
sif::info << "Speed(m/s): " << gps->fix.speed << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
void Q7STestTask::testFileSystemHandlerDirect(FsOpCodes opCode) {
|
void Q7STestTask::testFileSystemHandlerDirect(FsOpCodes opCode) {
|
||||||
auto fsHandler = ObjectManager::instance()->
|
auto fsHandler = ObjectManager::instance()->
|
||||||
get<FileSystemHandler>(objects::FILE_SYSTEM_HANDLER);
|
get<FileSystemHandler>(objects::FILE_SYSTEM_HANDLER);
|
||||||
|
@ -11,6 +11,9 @@ public:
|
|||||||
private:
|
private:
|
||||||
CoreController* coreController = nullptr;
|
CoreController* coreController = nullptr;
|
||||||
ReturnValue_t performOneShotAction() override;
|
ReturnValue_t performOneShotAction() override;
|
||||||
|
ReturnValue_t performPeriodicAction() override;
|
||||||
|
|
||||||
|
void testGpsDaemon();
|
||||||
|
|
||||||
void testSdCard();
|
void testSdCard();
|
||||||
void fileTests();
|
void fileTests();
|
||||||
|
2
fsfw
2
fsfw
@ -1 +1 @@
|
|||||||
Subproject commit 5214f8a449d195ecfa69f978cc0fe001ef76130a
|
Subproject commit c1e0bcee6db652d6c474c87a4099e61ecf86b694
|
Loading…
Reference in New Issue
Block a user