mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-05 15:00:33 +00:00
Create a base class for Gnss almanacs, unify parameter names
This commit is contained in:
parent
a479d4c1eb
commit
c2223e3dad
@ -17,18 +17,18 @@
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element type="xs:byte" name="PRN"/>
|
||||
<xs:element type="xs:int" name="toa"/>
|
||||
<xs:element type="xs:byte" name="WNa"/>
|
||||
<xs:element type="xs:byte" name="IODa"/>
|
||||
<xs:element type="xs:float" name="delta_i"/>
|
||||
<xs:element type="xs:byte" name="toa"/>
|
||||
<xs:element type="xs:byte" name="WNa"/>
|
||||
<xs:element type="xs:float" name="M_0"/>
|
||||
<xs:element type="xs:float" name="ecc"/>
|
||||
<xs:element type="xs:float" name="delta_sqrtA"/>
|
||||
<xs:element type="xs:float" name="sqrtA"/>
|
||||
<xs:element type="xs:float" name="OMEGA_0"/>
|
||||
<xs:element type="xs:float" name="omega"/>
|
||||
<xs:element type="xs:float" name="OMEGAdot"/>
|
||||
<xs:element type="xs:float" name="af0"/>
|
||||
<xs:element type="xs:float" name="af1"/>
|
||||
<xs:element type="xs:byte" name="IODa"/>
|
||||
<xs:element type="xs:byte" name="E5b_HS"/>
|
||||
<xs:element type="xs:byte" name="E1B_HS"/>
|
||||
<xs:element type="xs:byte" name="E5a_HS"/>
|
||||
|
@ -26,10 +26,10 @@
|
||||
<xs:element type="xs:float" name="OMEGA_0"/>
|
||||
<xs:element type="xs:float" name="omega"/>
|
||||
<xs:element type="xs:float" name="OMEGAdot"/>
|
||||
<xs:element type="xs:byte" name="SV_health"/>
|
||||
<xs:element type="xs:byte" name="AS_status"/>
|
||||
<xs:element type="xs:float" name="af0"/>
|
||||
<xs:element type="xs:float" name="af1"/>
|
||||
<xs:element type="xs:byte" name="SV_health"/>
|
||||
<xs:element type="xs:byte" name="AS_status"/>
|
||||
</xs:sequence>
|
||||
<xs:attribute type="xs:byte" name="class_id" use="optional"/>
|
||||
<xs:attribute type="xs:byte" name="tracking_level" use="optional"/>
|
||||
|
@ -454,8 +454,7 @@ alm_t alm_to_rtklib(const Galileo_Almanac& gal_alm)
|
||||
toa.time = gal_alm.toa;
|
||||
toa.sec = 0.0;
|
||||
rtklib_alm.toa = toa;
|
||||
rtklib_alm.A = 5440.588203494 + gal_alm.delta_sqrtA;
|
||||
rtklib_alm.A = rtklib_alm.A * rtklib_alm.A;
|
||||
rtklib_alm.A = gal_alm.sqrtA * gal_alm.sqrtA;
|
||||
rtklib_alm.e = gal_alm.ecc;
|
||||
rtklib_alm.i0 = (gal_alm.delta_i + 56.0 / 180.0) * GNSS_PI;
|
||||
rtklib_alm.OMG0 = gal_alm.OMEGA_0 * GNSS_PI;
|
||||
|
@ -201,9 +201,9 @@ void Gnss_Sdr_Supl_Client::read_supl_data()
|
||||
{
|
||||
/* TS 44.031: GPSTOW, range 0-604799.92, resolution 0.08 sec, 23-bit presentation */
|
||||
gps_time.tow = static_cast<double>(assist.time.gps_tow) * 0.08;
|
||||
gps_time.d_Week = static_cast<double>(assist.time.gps_week);
|
||||
gps_time.d_tv_sec = static_cast<double>(assist.time.stamp.tv_sec);
|
||||
gps_time.d_tv_usec = static_cast<double>(assist.time.stamp.tv_usec);
|
||||
gps_time.week = static_cast<double>(assist.time.gps_week);
|
||||
gps_time.seconds = static_cast<double>(assist.time.stamp.tv_sec);
|
||||
gps_time.microseconds = static_cast<double>(assist.time.stamp.tv_usec);
|
||||
gps_time.valid = true;
|
||||
}
|
||||
|
||||
@ -871,7 +871,7 @@ bool Gnss_Sdr_Supl_Client::read_gal_almanac_from_gsa(const std::string& file_nam
|
||||
gal_alm.delta_i = std::stod(almanac.child("almanac").child_value("deltai"));
|
||||
gal_alm.M_0 = std::stod(almanac.child("almanac").child_value("m0"));
|
||||
gal_alm.ecc = std::stod(almanac.child("almanac").child_value("ecc"));
|
||||
gal_alm.delta_sqrtA = std::stod(almanac.child("almanac").child_value("aSqRoot"));
|
||||
gal_alm.sqrtA = std::stod(almanac.child("almanac").child_value("aSqRoot"));
|
||||
gal_alm.OMEGA_0 = std::stod(almanac.child("almanac").child_value("omega0"));
|
||||
gal_alm.omega = std::stod(almanac.child("almanac").child_value("w"));
|
||||
gal_alm.OMEGAdot = std::stod(almanac.child("almanac").child_value("omegaDot"));
|
||||
|
@ -209,7 +209,7 @@ void ControlThread::init()
|
||||
// Make an educated guess
|
||||
time_t rawtime;
|
||||
time(&rawtime);
|
||||
agnss_ref_time_.d_tv_sec = rawtime;
|
||||
agnss_ref_time_.seconds = rawtime;
|
||||
agnss_ref_time_.valid = true;
|
||||
}
|
||||
else
|
||||
@ -220,8 +220,8 @@ void ControlThread::init()
|
||||
};
|
||||
if (strptime(ref_time_str.c_str(), "%d/%m/%Y %H:%M:%S", &tm) != nullptr)
|
||||
{
|
||||
agnss_ref_time_.d_tv_sec = timegm(&tm);
|
||||
if (agnss_ref_time_.d_tv_sec > 0)
|
||||
agnss_ref_time_.seconds = timegm(&tm);
|
||||
if (agnss_ref_time_.seconds > 0)
|
||||
{
|
||||
agnss_ref_time_.valid = true;
|
||||
}
|
||||
@ -883,7 +883,7 @@ void ControlThread::assist_GNSS()
|
||||
time_t ref_rx_utc_time = 0;
|
||||
if (agnss_ref_time_.valid == true)
|
||||
{
|
||||
ref_rx_utc_time = static_cast<time_t>(agnss_ref_time_.d_tv_sec);
|
||||
ref_rx_utc_time = static_cast<time_t>(agnss_ref_time_.seconds);
|
||||
}
|
||||
|
||||
const std::vector<std::pair<int, Gnss_Satellite>> visible_sats = get_visible_sats(ref_rx_utc_time, ref_LLH);
|
||||
|
@ -27,6 +27,7 @@ set(SYSTEM_PARAMETERS_SOURCES
|
||||
)
|
||||
|
||||
set(SYSTEM_PARAMETERS_HEADERS
|
||||
gnss_almanac.h
|
||||
gnss_ephemeris.h
|
||||
gnss_satellite.h
|
||||
gnss_signal.h
|
||||
|
@ -39,9 +39,9 @@ public:
|
||||
Agnss_Ref_Time() = default;
|
||||
|
||||
double tow{};
|
||||
double d_Week{};
|
||||
double d_tv_sec{};
|
||||
double d_tv_usec{};
|
||||
double week{};
|
||||
double seconds{};
|
||||
double microseconds{};
|
||||
bool valid{};
|
||||
|
||||
template <class Archive>
|
||||
@ -56,9 +56,9 @@ public:
|
||||
{
|
||||
};
|
||||
archive& BOOST_SERIALIZATION_NVP(tow);
|
||||
archive& BOOST_SERIALIZATION_NVP(d_Week);
|
||||
archive& BOOST_SERIALIZATION_NVP(d_tv_sec);
|
||||
archive& BOOST_SERIALIZATION_NVP(d_tv_usec);
|
||||
archive& BOOST_SERIALIZATION_NVP(week);
|
||||
archive& BOOST_SERIALIZATION_NVP(seconds);
|
||||
archive& BOOST_SERIALIZATION_NVP(microseconds);
|
||||
archive& BOOST_SERIALIZATION_NVP(valid);
|
||||
}
|
||||
};
|
||||
|
@ -18,6 +18,7 @@
|
||||
#ifndef GNSS_SDR_BEIDOU_DNAV_ALMANAC_H
|
||||
#define GNSS_SDR_BEIDOU_DNAV_ALMANAC_H
|
||||
|
||||
#include "gnss_almanac.h"
|
||||
#include <boost/serialization/nvp.hpp>
|
||||
|
||||
/** \addtogroup Core
|
||||
@ -29,7 +30,7 @@
|
||||
/*!
|
||||
* \brief This class is a storage for the BeiDou D1 almanac
|
||||
*/
|
||||
class Beidou_Dnav_Almanac
|
||||
class Beidou_Dnav_Almanac : public Gnss_Almanac
|
||||
{
|
||||
public:
|
||||
/*!
|
||||
@ -37,18 +38,7 @@ public:
|
||||
*/
|
||||
Beidou_Dnav_Almanac() = default;
|
||||
|
||||
unsigned int PRN{}; //!< SV PRN NUMBER
|
||||
double delta_i{};
|
||||
double toa{}; //!< Almanac data reference time of week [s]
|
||||
double M_0{}; //!< Mean Anomaly at Reference Time [semi-circles]
|
||||
double ecc{}; //!< Eccentricity [dimensionless]
|
||||
double sqrtA{}; //!< Square Root of the Semi-Major Axis [sqrt(m)]
|
||||
double OMEGA_0{}; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles]
|
||||
double omega{}; //!< Argument of Perigee [semi-cicles]
|
||||
double OMEGAdot{}; //!< Rate of Right Ascension [semi-circles/s]
|
||||
int SV_health{}; //!< SV Health
|
||||
double af0{}; //!< Coefficient 0 of code phase offset model [s]
|
||||
double af1{}; //!< Coefficient 1 of code phase offset model [s/s]
|
||||
int SV_health{}; //!< SV Health
|
||||
|
||||
template <class Archive>
|
||||
|
||||
@ -60,17 +50,16 @@ public:
|
||||
ar& BOOST_SERIALIZATION_NVP(PRN);
|
||||
ar& BOOST_SERIALIZATION_NVP(delta_i);
|
||||
ar& BOOST_SERIALIZATION_NVP(toa);
|
||||
// ar& BOOST_SERIALIZATION_NVP(WNa);
|
||||
ar& BOOST_SERIALIZATION_NVP(WNa);
|
||||
ar& BOOST_SERIALIZATION_NVP(M_0);
|
||||
ar& BOOST_SERIALIZATION_NVP(ecc);
|
||||
ar& BOOST_SERIALIZATION_NVP(sqrtA);
|
||||
ar& BOOST_SERIALIZATION_NVP(OMEGA_0);
|
||||
ar& BOOST_SERIALIZATION_NVP(omega);
|
||||
ar& BOOST_SERIALIZATION_NVP(OMEGAdot);
|
||||
ar& BOOST_SERIALIZATION_NVP(SV_health);
|
||||
// ar& BOOST_SERIALIZATION_NVP(AS_status);
|
||||
ar& BOOST_SERIALIZATION_NVP(af0);
|
||||
ar& BOOST_SERIALIZATION_NVP(af1);
|
||||
ar& BOOST_SERIALIZATION_NVP(SV_health);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -18,8 +18,8 @@
|
||||
#ifndef GNSS_SDR_GALILEO_ALMANAC_H
|
||||
#define GNSS_SDR_GALILEO_ALMANAC_H
|
||||
|
||||
#include "gnss_almanac.h"
|
||||
#include <boost/serialization/nvp.hpp>
|
||||
#include <cstdint>
|
||||
|
||||
/** \addtogroup Core
|
||||
* \{ */
|
||||
@ -30,7 +30,7 @@
|
||||
/*!
|
||||
* \brief This class is a storage for the Galileo SV ALMANAC data
|
||||
*/
|
||||
class Galileo_Almanac
|
||||
class Galileo_Almanac : public Gnss_Almanac
|
||||
{
|
||||
public:
|
||||
/*!
|
||||
@ -38,19 +38,7 @@ public:
|
||||
*/
|
||||
Galileo_Almanac() = default;
|
||||
|
||||
uint32_t PRN{}; //!< SV PRN NUMBER
|
||||
int32_t toa{};
|
||||
int32_t WNa{};
|
||||
int32_t IODa{};
|
||||
double delta_i{}; //!< Inclination at reference time relative to i0 = 56º [semi-circles]
|
||||
double M_0{}; //!< Mean Anomaly at Reference Time [semi-circles]
|
||||
double ecc{}; //!< Eccentricity [dimensionless]
|
||||
double delta_sqrtA{}; //!< Square Root of the Semi-Major Axis [sqrt(m)]
|
||||
double OMEGA_0{}; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles]
|
||||
double omega{}; //!< Argument of Perigee [semi-cicles]
|
||||
double OMEGAdot{}; //!< Rate of Right Ascension [semi-circles/s]
|
||||
double af0{}; //!< Coefficient 0 of code phase offset model [s]
|
||||
double af1{}; //!< Coefficient 1 of code phase offset model [s/s]
|
||||
int32_t E5b_HS{};
|
||||
int32_t E1B_HS{};
|
||||
int32_t E5a_HS{};
|
||||
@ -63,18 +51,18 @@ public:
|
||||
{
|
||||
};
|
||||
ar& BOOST_SERIALIZATION_NVP(PRN);
|
||||
ar& BOOST_SERIALIZATION_NVP(delta_i);
|
||||
ar& BOOST_SERIALIZATION_NVP(toa);
|
||||
ar& BOOST_SERIALIZATION_NVP(WNa);
|
||||
ar& BOOST_SERIALIZATION_NVP(IODa);
|
||||
ar& BOOST_SERIALIZATION_NVP(delta_i);
|
||||
ar& BOOST_SERIALIZATION_NVP(M_0);
|
||||
ar& BOOST_SERIALIZATION_NVP(ecc);
|
||||
ar& BOOST_SERIALIZATION_NVP(delta_sqrtA);
|
||||
ar& BOOST_SERIALIZATION_NVP(sqrtA);
|
||||
ar& BOOST_SERIALIZATION_NVP(OMEGA_0);
|
||||
ar& BOOST_SERIALIZATION_NVP(omega);
|
||||
ar& BOOST_SERIALIZATION_NVP(OMEGAdot);
|
||||
ar& BOOST_SERIALIZATION_NVP(af0);
|
||||
ar& BOOST_SERIALIZATION_NVP(af1);
|
||||
ar& BOOST_SERIALIZATION_NVP(IODa);
|
||||
ar& BOOST_SERIALIZATION_NVP(E5b_HS);
|
||||
ar& BOOST_SERIALIZATION_NVP(E1B_HS);
|
||||
ar& BOOST_SERIALIZATION_NVP(E5a_HS);
|
||||
|
@ -19,6 +19,7 @@
|
||||
Galileo_Almanac Galileo_Almanac_Helper::get_almanac(int i) const
|
||||
{
|
||||
Galileo_Almanac galileo_almanac;
|
||||
const double sqrtAnominal = 5440.588203494; // square root of Galileo nominal orbit semi-major axis
|
||||
switch (i)
|
||||
{
|
||||
case 1:
|
||||
@ -29,7 +30,7 @@ Galileo_Almanac Galileo_Almanac_Helper::get_almanac(int i) const
|
||||
galileo_almanac.delta_i = this->delta_i_7;
|
||||
galileo_almanac.M_0 = this->M0_7;
|
||||
galileo_almanac.ecc = this->e_7;
|
||||
galileo_almanac.delta_sqrtA = this->DELTA_A_7;
|
||||
galileo_almanac.sqrtA = sqrtAnominal + this->DELTA_A_7;
|
||||
galileo_almanac.OMEGA_0 = this->Omega0_7;
|
||||
galileo_almanac.omega = this->omega_7;
|
||||
galileo_almanac.OMEGAdot = this->Omega_dot_7;
|
||||
@ -48,7 +49,7 @@ Galileo_Almanac Galileo_Almanac_Helper::get_almanac(int i) const
|
||||
galileo_almanac.delta_i = this->delta_i_8;
|
||||
galileo_almanac.M_0 = this->M0_9;
|
||||
galileo_almanac.ecc = this->e_8;
|
||||
galileo_almanac.delta_sqrtA = this->DELTA_A_8;
|
||||
galileo_almanac.sqrtA = sqrtAnominal + this->DELTA_A_8;
|
||||
galileo_almanac.OMEGA_0 = this->Omega0_8;
|
||||
galileo_almanac.omega = this->omega_8;
|
||||
galileo_almanac.OMEGAdot = this->Omega_dot_8;
|
||||
@ -66,7 +67,7 @@ Galileo_Almanac Galileo_Almanac_Helper::get_almanac(int i) const
|
||||
galileo_almanac.delta_i = this->delta_i_9;
|
||||
galileo_almanac.M_0 = this->M0_10;
|
||||
galileo_almanac.ecc = this->e_9;
|
||||
galileo_almanac.delta_sqrtA = this->DELTA_A_9;
|
||||
galileo_almanac.sqrtA = sqrtAnominal + this->DELTA_A_9;
|
||||
galileo_almanac.OMEGA_0 = this->Omega0_10;
|
||||
galileo_almanac.omega = this->omega_9;
|
||||
galileo_almanac.OMEGAdot = this->Omega_dot_10;
|
||||
|
57
src/core/system_parameters/gnss_almanac.h
Normal file
57
src/core/system_parameters/gnss_almanac.h
Normal file
@ -0,0 +1,57 @@
|
||||
/*!
|
||||
* \file gnss_almanac.h
|
||||
* \brief Base class for GNSS almanac storage
|
||||
* \author Carles Fernandez, 2021. cfernandez(at)cttc.es
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2021 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
#ifndef GNSS_SDR_GNSS_ALMANAC_H
|
||||
#define GNSS_SDR_GNSS_ALMANAC_H
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
/** \addtogroup Core
|
||||
* \{ */
|
||||
/** \addtogroup System_Parameters
|
||||
* \{ */
|
||||
|
||||
|
||||
/*!
|
||||
* \brief Base class for GNSS almanac storage
|
||||
*/
|
||||
class Gnss_Almanac
|
||||
{
|
||||
public:
|
||||
/*!
|
||||
* Default constructor
|
||||
*/
|
||||
Gnss_Almanac() = default;
|
||||
|
||||
uint32_t PRN{}; //!< SV PRN NUMBER
|
||||
double delta_i{}; //!< Inclination Angle at Reference Time (relative to i_0 = 0.30 semi-circles)
|
||||
int32_t toa{}; //!< Almanac data reference time of week [s]
|
||||
int32_t WNa{}; //!< Almanac week number
|
||||
double M_0{}; //!< Mean Anomaly at Reference Time [semi-circles]
|
||||
double ecc{}; //!< Eccentricity [dimensionless]
|
||||
double sqrtA{}; //!< Square Root of the Semi-Major Axis [sqrt(m)]
|
||||
double OMEGA_0{}; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles]
|
||||
double omega{}; //!< Argument of Perigee [semi-cicles]
|
||||
double OMEGAdot{}; //!< Rate of Right Ascension [semi-circles/s]
|
||||
double af0{}; //!< Coefficient 0 of code phase offset model [s]
|
||||
double af1{}; //!< Coefficient 1 of code phase offset model [s/s]
|
||||
};
|
||||
|
||||
|
||||
/** \} */
|
||||
/** \} */
|
||||
#endif // GNSS_SDR_GNSS_ALMANAC_H
|
@ -18,8 +18,8 @@
|
||||
#ifndef GNSS_SDR_GPS_ALMANAC_H
|
||||
#define GNSS_SDR_GPS_ALMANAC_H
|
||||
|
||||
#include "gnss_almanac.h"
|
||||
#include <boost/serialization/nvp.hpp>
|
||||
#include <cstdint>
|
||||
|
||||
/** \addtogroup Core
|
||||
* \{ */
|
||||
@ -32,7 +32,7 @@
|
||||
*
|
||||
* See https://www.gps.gov/technical/icwg/IS-GPS-200L.pdf Appendix II
|
||||
*/
|
||||
class Gps_Almanac
|
||||
class Gps_Almanac : public Gnss_Almanac
|
||||
{
|
||||
public:
|
||||
/*!
|
||||
@ -40,20 +40,8 @@ public:
|
||||
*/
|
||||
Gps_Almanac() = default;
|
||||
|
||||
uint32_t PRN{}; //!< SV PRN NUMBER
|
||||
double delta_i{}; //!< Inclination Angle at Reference Time (relative to i_0 = 0.30 semi-circles)
|
||||
int32_t toa{}; //!< Almanac data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200L) [s]
|
||||
int32_t WNa{}; //!< Almanac week number
|
||||
double M_0{}; //!< Mean Anomaly at Reference Time [semi-circles]
|
||||
double ecc{}; //!< Eccentricity [dimensionless]
|
||||
double sqrtA{}; //!< Square Root of the Semi-Major Axis [sqrt(m)]
|
||||
double OMEGA_0{}; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles]
|
||||
double omega{}; //!< Argument of Perigee [semi-cicles]
|
||||
double OMEGAdot{}; //!< Rate of Right Ascension [semi-circles/s]
|
||||
int32_t SV_health{}; //!< SV Health
|
||||
int32_t AS_status{}; //!< Anti-Spoofing Flags and SV Configuration
|
||||
double af0{}; //!< Coefficient 0 of code phase offset model [s]
|
||||
double af1{}; //!< Coefficient 1 of code phase offset model [s/s]
|
||||
|
||||
template <class Archive>
|
||||
|
||||
@ -72,10 +60,10 @@ public:
|
||||
ar& BOOST_SERIALIZATION_NVP(OMEGA_0);
|
||||
ar& BOOST_SERIALIZATION_NVP(omega);
|
||||
ar& BOOST_SERIALIZATION_NVP(OMEGAdot);
|
||||
ar& BOOST_SERIALIZATION_NVP(SV_health);
|
||||
ar& BOOST_SERIALIZATION_NVP(AS_status);
|
||||
ar& BOOST_SERIALIZATION_NVP(af0);
|
||||
ar& BOOST_SERIALIZATION_NVP(af1);
|
||||
ar& BOOST_SERIALIZATION_NVP(SV_health);
|
||||
ar& BOOST_SERIALIZATION_NVP(AS_status);
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user