v1.11.0 #243

Merged
muellerr merged 159 commits from develop into main 2022-05-04 17:19:57 +02:00
4 changed files with 34 additions and 4 deletions
Showing only changes of commit 4956161701 - Show all commits

View File

@ -99,6 +99,9 @@ include (${CMAKE_SCRIPT_PATH}/HardwareOsPreConfig.cmake)
pre_source_hw_os_config()
if(TGT_BSP)
set(LIBGPS_VERSION_MAJOR 3)
# I assume a newer version than 3.17 will be installed on other Linux board than the Q7S
set(LIBGPS_VERSION_MINOR 20)
if(TGT_BSP MATCHES "arm/q7s" OR TGT_BSP MATCHES "arm/raspberrypi"
OR TGT_BSP MATCHES "arm/beagleboneblack" OR TGT_BSP MATCHES "arm/egse"
OR TGT_BSP MATCHES "arm/te0720-1cfa"
@ -134,6 +137,8 @@ if(TGT_BSP)
if(TGT_BSP MATCHES "arm/q7s")
# Used by configure file
set(XIPHOS_Q7S ON)
set(LIBGPS_VERSION_MAJOR 3)
set(LIBGPS_VERSION_MINOR 17)
endif()
if(TGT_BSP MATCHES "arm/te0720-1cfa")
@ -155,8 +160,6 @@ elseif(TGT_BSP MATCHES "arm/raspberrypi" OR TGT_BSP MATCHES "arm/egse")
configure_file(${BSP_PATH}/boardconfig/rpiConfig.h.in rpiConfig.h)
endif()
configure_file(${WATCHDOG_PATH}/watchdogConf.h.in watchdogConf.h)
# Set common config path for FSFW

View File

@ -246,7 +246,11 @@ void Q7STestTask::testGpsDaemon() {
sif::warning << "Q7STestTask: Reading GPS data failed" << std::endl;
}
sif::info << "-- Q7STestTask: GPS shared memory read test --" << std::endl;
#if LIBGPS_VERSION_MINOR <= 17
time_t timeRaw = gps->fix.time;
#else
time_t timeRaw = gps->fix.time.tv_sec;
#endif
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;
@ -254,7 +258,11 @@ void Q7STestTask::testGpsDaemon() {
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;
#if LIBGPS_VERSION_MINOR <= 17
sif::info << "Altitude(MSL): " << gps->fix.altitude << std::endl;
#else
sif::info << "Altitude(MSL): " << gps->fix.altMSL << std::endl;
#endif
sif::info << "Speed(m/s): " << gps->fix.speed << std::endl;
}

View File

@ -191,11 +191,19 @@ void GPSHyperionLinuxController::readGpsDataFromGpsd() {
gpsSet.speed.setValid(false);
}
#if LIBGPS_VERSION_MINOR <= 17
gpsSet.unixSeconds.value = gps->fix.time;
#else
gpsSet.unixSeconds.value = gps->fix.time.tv_sec;
#endif
timeval time = {};
time.tv_sec = gpsSet.unixSeconds.value;
double fractionalPart = gpsSet.unixSeconds.value - gps->fix.time;
time.tv_usec = fractionalPart * 1000 * 1000;
#if LIBGPS_VERSION_MINOR <= 17
double fractionalPart = gps->fix.time - std::floor(gps->fix.time);
time.tv_usec = fractionalPart * 1000.0 * 1000.0;
#else
time.tv_usec = gps->fix.time.tv_nsec / 1000;
#endif
//time.tv_usec = gps->fix.time.tv_nsec / 1000;
std::time_t t = std::time(nullptr);
if (time.tv_sec == t) {
@ -235,7 +243,11 @@ void GPSHyperionLinuxController::readGpsDataFromGpsd() {
gpsSet.seconds = timeOfDay.second;
if (debugHyperionGps) {
sif::info << "-- Hyperion GPS Data --" << std::endl;
#if LIBGPS_VERSION_MINOR <= 17
time_t timeRaw = gps->fix.time;
#else
time_t timeRaw = gps->fix.time.tv_sec;
#endif
std::tm *time = gmtime(&timeRaw);
std::cout << "Time: " << std::put_time(time, "%c %Z") << std::endl;
std::cout << "Visible satellites: " << gps->satellites_visible << std::endl;
@ -243,7 +255,11 @@ void GPSHyperionLinuxController::readGpsDataFromGpsd() {
std::cout << "Fix (0:Not Seen|1:No Fix|2:2D|3:3D): " << gps->fix.mode << std::endl;
std::cout << "Latitude: " << gps->fix.latitude << std::endl;
std::cout << "Longitude: " << gps->fix.longitude << std::endl;
#if LIBGPS_VERSION_MINOR <= 17
std::cout << "Altitude(MSL): " << gps->fix.altitude << std::endl;
#else
std::cout << "Altitude(MSL): " << gps->fix.altMSL << std::endl;
#endif
std::cout << "Speed(m/s): " << gps->fix.speed << std::endl;
std::time_t t = std::time(nullptr);
std::tm tm = *std::gmtime(&t);

View File

@ -192,6 +192,9 @@ debugging. */
/*******************************************************************/
#cmakedefine EIVE_BUILD_GPSD_GPS_HANDLER
#cmakedefine LIBGPS_VERSION_MAJOR @LIBGPS_VERSION_MAJOR@
#cmakedefine LIBGPS_VERSION_MINOR @LIBGPS_VERSION_MINOR@
#ifdef RASPBERRY_PI
#include "rpiConfig.h"
#elif defined(XIPHOS_Q7S)