mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2024-12-04 23:40:04 +00:00
Give more natural, consistent names to ephemeris / iono / utc parameters exposed outside the receiver via XML files
Create a base class for GPS, Galileo and BeiDou ephemeris, allowing to remove some duplicated code Use BOOST_SERIALIZATION_NVP macro, less error prone than boost::serialization::make_nvp Update .xsd files
This commit is contained in:
parent
c0796f416d
commit
7971565a0d
@ -42,6 +42,9 @@ SPDX-FileCopyrightText: 2011-2021 Carles Fernandez-Prades <carles.fernandez@cttc
|
||||
- Do not apply clang-tidy fixes to protobuf-generated headers.
|
||||
- Refactored private implementation of flow graph connection and disconnection
|
||||
for improved source code readability.
|
||||
- Added a base class for GNSS ephemeris, saving some duplicated code and
|
||||
providing a common nomenclature for ephemeris' parameters. New generated XML
|
||||
files make use of the new parameters' name.
|
||||
|
||||
### Improvements in Usability:
|
||||
|
||||
|
@ -6,7 +6,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
||||
)
|
||||
|
||||
[comment]: # (
|
||||
SPDX-FileCopyrightText: 2011-2020 Carles Fernandez-Prades <carles.fernandez@cttc.es>
|
||||
SPDX-FileCopyrightText: 2011-2021 Carles Fernandez-Prades <carles.fernandez@cttc.es>
|
||||
)
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
@ -33,6 +33,8 @@ elements in an XML document.
|
||||
|
||||
- [cnav_ephemeris_map.xsd](./cnav_ephemeris_map.xsd) - GPS CNAV message
|
||||
ephemeris parameters.
|
||||
- [cnav_utc_model.xsd](./cnav_utc_model.xsd) - GPS CNAV message UTC model
|
||||
parameters.
|
||||
|
||||
## Galileo
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<!-- SPDX-License-Identifier: BSD-3-Clause -->
|
||||
<!-- SPDX-FileCopyrightText: 2018-2020 Carles Fernandez-Prades <carles.fernandez@cttc.es> -->
|
||||
<!-- SPDX-FileCopyrightText: 2018-2021 Carles Fernandez-Prades <carles.fernandez@cttc.es> -->
|
||||
<xs:element name="boost_serialization">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
@ -16,35 +16,43 @@
|
||||
<xs:element name="second">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element type="xs:byte" name="i_satellite_PRN"/>
|
||||
<xs:element type="xs:int" name="d_TOW"/>
|
||||
<xs:element type="xs:float" name="d_Crs"/>
|
||||
<xs:element type="xs:float" name="d_M_0"/>
|
||||
<xs:element type="xs:float" name="d_Cuc"/>
|
||||
<xs:element type="xs:float" name="d_e_eccentricity"/>
|
||||
<xs:element type="xs:float" name="d_Cus"/>
|
||||
<xs:element type="xs:int" name="d_Toe1"/>
|
||||
<xs:element type="xs:int" name="d_Toe2"/>
|
||||
<xs:element type="xs:byte" name="d_Toc"/>
|
||||
<xs:element type="xs:float" name="d_Cic"/>
|
||||
<xs:element type="xs:float" name="d_OMEGA0"/>
|
||||
<xs:element type="xs:float" name="d_Cis"/>
|
||||
<xs:element type="xs:float" name="d_i_0"/>
|
||||
<xs:element type="xs:float" name="d_Crc"/>
|
||||
<xs:element type="xs:float" name="d_OMEGA"/>
|
||||
<xs:element type="xs:float" name="d_IDOT"/>
|
||||
<xs:element type="xs:short" name="i_GPS_week"/>
|
||||
<xs:element type="xs:float" name="d_TGD"/>
|
||||
<xs:element type="xs:float" name="d_ISCL1"/>
|
||||
<xs:element type="xs:float" name="d_ISCL2"/>
|
||||
<xs:element type="xs:float" name="d_ISCL5I"/>
|
||||
<xs:element type="xs:float" name="d_ISCL5Q"/>
|
||||
<xs:element type="xs:float" name="d_DELTA_A"/>
|
||||
<xs:element type="xs:float" name="d_A_DOT"/>
|
||||
<xs:element type="xs:float" name="d_DELTA_OMEGA_DOT"/>
|
||||
<xs:element type="xs:float" name="d_A_f0"/>
|
||||
<xs:element type="xs:float" name="d_A_f1"/>
|
||||
<xs:element type="xs:float" name="d_A_f2"/>
|
||||
<xs:element type="xs:byte" name="PRN"/>
|
||||
<xs:element type="xs:float" name="M_0"/>
|
||||
<xs:element type="xs:float" name="delta_n"/>
|
||||
<xs:element type="xs:float" name="ecc"/>
|
||||
<xs:element type="xs:float" name="sqrtA"/>
|
||||
<xs:element type="xs:float" name="OMEGA_0"/>
|
||||
<xs:element type="xs:float" name="i_0"/>
|
||||
<xs:element type="xs:float" name="omega"/>
|
||||
<xs:element type="xs:float" name="OMEGAdot"/>
|
||||
<xs:element type="xs:float" name="idot"/>
|
||||
<xs:element type="xs:float" name="Cuc"/>
|
||||
<xs:element type="xs:float" name="Cus"/>
|
||||
<xs:element type="xs:float" name="Crc"/>
|
||||
<xs:element type="xs:float" name="Crs"/>
|
||||
<xs:element type="xs:float" name="Cic"/>
|
||||
<xs:element type="xs:float" name="Cis"/>
|
||||
<xs:element type="xs:int" name="toe"/>
|
||||
<xs:element type="xs:int" name="toc"/>
|
||||
<xs:element type="xs:float" name="af0"/>
|
||||
<xs:element type="xs:float" name="af1"/>
|
||||
<xs:element type="xs:float" name="af2"/>
|
||||
<xs:element type="xs:short" name="WN"/>
|
||||
<xs:element type="xs:int" name="tow"/>
|
||||
<xs:element type="xs:float" name="satClkDrift"/>
|
||||
<xs:element type="xs:float" name="dtr"/>
|
||||
<xs:element type="xs:byte" name="IODE_SF2"/>
|
||||
<xs:element type="xs:byte" name="IODE_SF3"/>
|
||||
<xs:element type="xs:byte" name="code_on_L2"/>
|
||||
<xs:element type="xs:byte" name="L2_P_data_flag"/>
|
||||
<xs:element type="xs:byte" name="SV_accuracy"/>
|
||||
<xs:element type="xs:byte" name="SV_health"/>
|
||||
<xs:element type="xs:float" name="TGD"/>
|
||||
<xs:element type="xs:byte" name="IODC"/>
|
||||
<xs:element type="xs:short" name="AODO"/>
|
||||
<xs:element type="xs:byte" name="b_fit_interval_flag"/>
|
||||
<xs:element type="xs:float" name="d_spare1"/>
|
||||
<xs:element type="xs:float" name="d_spare2"/>
|
||||
<xs:element type="xs:byte" name="b_integrity_status_flag"/>
|
||||
<xs:element type="xs:byte" name="b_alert_flag"/>
|
||||
<xs:element type="xs:byte" name="b_antispoofing_flag"/>
|
||||
|
30
docs/xml-schemas/cnav_utc_model.xsd
Normal file
30
docs/xml-schemas/cnav_utc_model.xsd
Normal file
@ -0,0 +1,30 @@
|
||||
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<!-- SPDX-License-Identifier: BSD-3-Clause -->
|
||||
<!-- SPDX-FileCopyrightText: 2018-2021 Carles Fernandez-Prades <carles.fernandez@cttc.es> -->
|
||||
<xs:element name="boost_serialization">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="GNSS-SDR_cnav_utc_model">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element type="xs:float" name="A1"/>
|
||||
<xs:element type="xs:float" name="A0"/>
|
||||
<xs:element type="xs:int" name="tot"/>
|
||||
<xs:element type="xs:short" name="WN_T"/>
|
||||
<xs:element type="xs:byte" name="DeltaT_LS"/>
|
||||
<xs:element type="xs:short" name="WN_LSF"/>
|
||||
<xs:element type="xs:byte" name="DN"/>
|
||||
<xs:element type="xs:byte" name="DeltaT_LSF"/>
|
||||
<xs:element type="xs:byte" name="valid"/>
|
||||
</xs:sequence>
|
||||
<xs:attribute type="xs:byte" name="class_id"/>
|
||||
<xs:attribute type="xs:byte" name="tracking_level"/>
|
||||
<xs:attribute type="xs:byte" name="version"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
<xs:attribute type="xs:string" name="signature"/>
|
||||
<xs:attribute type="xs:byte" name="version"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:schema>
|
@ -1,6 +1,6 @@
|
||||
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
IODE_SF<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<!-- SPDX-License-Identifier: BSD-3-Clause -->
|
||||
<!-- SPDX-FileCopyrightText: 2018-2020 Carles Fernandez-Prades <carles.fernandez@cttc.es> -->
|
||||
<!-- SPDX-FileCopyrightText: 2018-2021 Carles Fernandez-Prades <carles.fernandez@cttc.es> -->
|
||||
<xs:element name="boost_serialization">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
@ -16,41 +16,41 @@
|
||||
<xs:element name="second">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element type="xs:byte" name="i_satellite_PRN"/>
|
||||
<xs:element type="xs:int" name="d_TOW"/>
|
||||
<xs:element type="xs:byte" name="d_IODE_SF2"/>
|
||||
<xs:element type="xs:byte" name="d_IODE_SF3"/>
|
||||
<xs:element type="xs:float" name="d_Crs"/>
|
||||
<xs:element type="xs:float" name="d_Delta_n"/>
|
||||
<xs:element type="xs:float" name="d_M_0"/>
|
||||
<xs:element type="xs:float" name="d_Cuc"/>
|
||||
<xs:element type="xs:float" name="d_e_eccentricity"/>
|
||||
<xs:element type="xs:float" name="d_Cus"/>
|
||||
<xs:element type="xs:float" name="d_sqrt_A"/>
|
||||
<xs:element type="xs:int" name="d_Toe"/>
|
||||
<xs:element type="xs:int" name="d_Toc"/>
|
||||
<xs:element type="xs:float" name="d_Cic"/>
|
||||
<xs:element type="xs:float" name="d_OMEGA0"/>
|
||||
<xs:element type="xs:float" name="d_Cis"/>
|
||||
<xs:element type="xs:float" name="d_i_0"/>
|
||||
<xs:element type="xs:float" name="d_Crc"/>
|
||||
<xs:element type="xs:float" name="d_OMEGA"/>
|
||||
<xs:element type="xs:float" name="d_OMEGA_DOT"/>
|
||||
<xs:element type="xs:float" name="d_IDOT"/>
|
||||
<xs:element type="xs:byte" name="i_code_on_L2"/>
|
||||
<xs:element type="xs:short" name="i_GPS_week"/>
|
||||
<xs:element type="xs:byte" name="b_L2_P_data_flag"/>
|
||||
<xs:element type="xs:byte" name="i_SV_accuracy"/>
|
||||
<xs:element type="xs:byte" name="i_SV_health"/>
|
||||
<xs:element type="xs:byte" name="PRN"/>
|
||||
<xs:element type="xs:int" name="tow"/>
|
||||
<xs:element type="xs:byte" name="IODE_SF2"/>
|
||||
<xs:element type="xs:byte" name="IODE_SF3"/>
|
||||
<xs:element type="xs:float" name="Crs"/>
|
||||
<xs:element type="xs:float" name="delta_n"/>
|
||||
<xs:element type="xs:float" name="M_0"/>
|
||||
<xs:element type="xs:float" name="Cuc"/>
|
||||
<xs:element type="xs:float" name="ecc"/>
|
||||
<xs:element type="xs:float" name="Cus"/>
|
||||
<xs:element type="xs:float" name="sqrtA"/>
|
||||
<xs:element type="xs:int" name="toe"/>
|
||||
<xs:element type="xs:int" name="toc"/>
|
||||
<xs:element type="xs:float" name="Cic"/>
|
||||
<xs:element type="xs:float" name="OMEGA_0"/>
|
||||
<xs:element type="xs:float" name="Cis"/>
|
||||
<xs:element type="xs:float" name="i_0"/>
|
||||
<xs:element type="xs:float" name="Crc"/>
|
||||
<xs:element type="xs:float" name="omega"/>
|
||||
<xs:element type="xs:float" name="OMEGAdot"/>
|
||||
<xs:element type="xs:float" name="idot"/>
|
||||
<xs:element type="xs:byte" name="code_on_L2"/>
|
||||
<xs:element type="xs:short" name="WN"/>
|
||||
<xs:element type="xs:byte" name="L2_P_data_flag"/>
|
||||
<xs:element type="xs:byte" name="SV_accuracy"/>
|
||||
<xs:element type="xs:byte" name="SV_health"/>
|
||||
<xs:element type="xs:float" name="d_TGD"/>
|
||||
<xs:element type="xs:byte" name="d_IODC"/>
|
||||
<xs:element type="xs:short" name="i_AODO"/>
|
||||
<xs:element type="xs:byte" name="IODC"/>
|
||||
<xs:element type="xs:short" name="AODO"/>
|
||||
<xs:element type="xs:byte" name="b_fit_interval_flag"/>
|
||||
<xs:element type="xs:float" name="d_spare1"/>
|
||||
<xs:element type="xs:float" name="d_spare2"/>
|
||||
<xs:element type="xs:float" name="d_A_f0"/>
|
||||
<xs:element type="xs:float" name="d_A_f1"/>
|
||||
<xs:element type="xs:float" name="d_A_f2"/>
|
||||
<xs:element type="xs:float" name="af0"/>
|
||||
<xs:element type="xs:float" name="af1"/>
|
||||
<xs:element type="xs:float" name="af2"/>
|
||||
<xs:element type="xs:byte" name="b_integrity_status_flag"/>
|
||||
<xs:element type="xs:byte" name="b_alert_flag"/>
|
||||
<xs:element type="xs:byte" name="b_antispoofing_flag"/>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<!-- SPDX-License-Identifier: BSD-3-Clause -->
|
||||
<!-- SPDX-FileCopyrightText: 2018-2020 Carles Fernandez-Prades <carles.fernandez@cttc.es> -->
|
||||
<!-- SPDX-FileCopyrightText: 2018-2021 Carles Fernandez-Prades <carles.fernandez@cttc.es> -->
|
||||
<xs:element name="boost_serialization">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
@ -16,19 +16,19 @@
|
||||
<xs:element name="second">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element type="xs:byte" name="i_satellite_PRN"/>
|
||||
<xs:element type="xs:int" name="i_Toa"/>
|
||||
<xs:element type="xs:byte" name="i_WNa"/>
|
||||
<xs:element type="xs:byte" name="i_IODa"/>
|
||||
<xs:element type="xs:float" name="d_Delta_i"/>
|
||||
<xs:element type="xs:float" name="d_M_0"/>
|
||||
<xs:element type="xs:float" name="d_e_eccentricity"/>
|
||||
<xs:element type="xs:float" name="d_Delta_sqrt_A"/>
|
||||
<xs:element type="xs:float" name="d_OMEGA0"/>
|
||||
<xs:element type="xs:float" name="d_OMEGA"/>
|
||||
<xs:element type="xs:float" name="d_OMEGA_DOT"/>
|
||||
<xs:element type="xs:float" name="d_A_f0"/>
|
||||
<xs:element type="xs:float" name="d_A_f1"/>
|
||||
<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: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="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="E5b_HS"/>
|
||||
<xs:element type="xs:byte" name="E1B_HS"/>
|
||||
<xs:element type="xs:byte" name="E5a_HS"/>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<!-- SPDX-License-Identifier: BSD-3-Clause -->
|
||||
<!-- SPDX-FileCopyrightText: 2018-2020 Carles Fernandez-Prades <carles.fernandez@cttc.es> -->
|
||||
<!-- SPDX-FileCopyrightText: 2018-2021 Carles Fernandez-Prades <carles.fernandez@cttc.es> -->
|
||||
<xs:element name="boost_serialization">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
@ -16,43 +16,42 @@
|
||||
<xs:element name="second">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element type="xs:byte" name="i_satellite_PRN"/>
|
||||
<xs:element type="xs:float" name="M0_1"/>
|
||||
<xs:element type="xs:float" name="delta_n_3"/>
|
||||
<xs:element type="xs:float" name="e_1"/>
|
||||
<xs:element type="xs:float" name="A_1"/>
|
||||
<xs:element type="xs:float" name="OMEGA_0_2"/>
|
||||
<xs:element type="xs:float" name="i_0_2"/>
|
||||
<xs:element type="xs:float" name="omega_2"/>
|
||||
<xs:element type="xs:float" name="OMEGA_dot_3"/>
|
||||
<xs:element type="xs:float" name="iDot_2"/>
|
||||
<xs:element type="xs:float" name="C_uc_3"/>
|
||||
<xs:element type="xs:float" name="C_us_3"/>
|
||||
<xs:element type="xs:float" name="C_rc_3"/>
|
||||
<xs:element type="xs:float" name="C_rs_3"/>
|
||||
<xs:element type="xs:float" name="C_ic_4"/>
|
||||
<xs:element type="xs:float" name="C_is_4"/>
|
||||
<xs:element type="xs:int" name="t0e_1"/>
|
||||
<xs:element type="xs:int" name="t0c_4"/>
|
||||
<xs:element type="xs:float" name="af0_4"/>
|
||||
<xs:element type="xs:float" name="af1_4"/>
|
||||
<xs:element type="xs:float" name="af2_4"/>
|
||||
<xs:element type="xs:short" name="WN_5"/>
|
||||
<xs:element type="xs:int" name="TOW_5"/>
|
||||
<xs:element type="xs:float" name="Galileo_satClkDrift"/>
|
||||
<xs:element type="xs:float" name="Galileo_dtr"/>
|
||||
|
||||
<xs:element type="xs:byte" name="PRN"/>
|
||||
<xs:element type="xs:float" name="M_0"/>
|
||||
<xs:element type="xs:float" name="delta_n"/>
|
||||
<xs:element type="xs:float" name="ecc"/>
|
||||
<xs:element type="xs:float" name="sqrtA"/>
|
||||
<xs:element type="xs:float" name="OMEGA_0"/>
|
||||
<xs:element type="xs:float" name="i_0"/>
|
||||
<xs:element type="xs:float" name="omega"/>
|
||||
<xs:element type="xs:float" name="OMEGAdot"/>
|
||||
<xs:element type="xs:float" name="idot"/>
|
||||
<xs:element type="xs:float" name="Cuc"/>
|
||||
<xs:element type="xs:float" name="Cus"/>
|
||||
<xs:element type="xs:float" name="Crc"/>
|
||||
<xs:element type="xs:float" name="Crs"/>
|
||||
<xs:element type="xs:float" name="Cic"/>
|
||||
<xs:element type="xs:float" name="Cis"/>
|
||||
<xs:element type="xs:int" name="toe"/>
|
||||
<xs:element type="xs:int" name="toc"/>
|
||||
<xs:element type="xs:float" name="af0"/>
|
||||
<xs:element type="xs:float" name="af1"/>
|
||||
<xs:element type="xs:float" name="af2"/>
|
||||
<xs:element type="xs:short" name="WN"/>
|
||||
<xs:element type="xs:int" name="tow"/>
|
||||
<xs:element type="xs:float" name="satClkDrift"/>
|
||||
<xs:element type="xs:float" name="dtr"/>
|
||||
<xs:element type="xs:byte" name="IOD_ephemeris"/>
|
||||
<xs:element type="xs:byte" name="IOD_nav_1"/>
|
||||
<xs:element type="xs:byte" name="SISA_3"/>
|
||||
<xs:element type="xs:byte" name="IOD_nav"/>
|
||||
<xs:element type="xs:byte" name="SISA"/>
|
||||
<xs:element type="xs:byte" name="E5a_HS"/>
|
||||
<xs:element type="xs:byte" name="E5b_HS_5"/>
|
||||
<xs:element type="xs:byte" name="E1B_HS_5"/>
|
||||
<xs:element type="xs:byte" name="E5b_HS"/>
|
||||
<xs:element type="xs:byte" name="E1B_HS"/>
|
||||
<xs:element type="xs:byte" name="E5a_DVS"/>
|
||||
<xs:element type="xs:byte" name="E5b_DVS_5"/>
|
||||
<xs:element type="xs:byte" name="E1B_DVS_5"/>
|
||||
<xs:element type="xs:float" name="BGD_E1E5a_5"/>
|
||||
<xs:element type="xs:float" name="BGD_E1E5b_5"/>
|
||||
<xs:element type="xs:byte" name="E5b_DVS"/>
|
||||
<xs:element type="xs:byte" name="E1B_DVS"/>
|
||||
<xs:element type="xs:float" name="BGD_E1E5a"/>
|
||||
<xs:element type="xs:float" name="BGD_E1E5b"/>
|
||||
<xs:element type="xs:byte" name="flag_all_ephemeris"/>
|
||||
</xs:sequence>
|
||||
<xs:attribute type="xs:byte" name="class_id" use="optional"/>
|
||||
|
@ -1,22 +1,22 @@
|
||||
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<!-- SPDX-License-Identifier: BSD-3-Clause -->
|
||||
<!-- SPDX-FileCopyrightText: 2018-2020 Carles Fernandez-Prades <carles.fernandez@cttc.es> -->
|
||||
<!-- SPDX-FileCopyrightText: 2018-2021 Carles Fernandez-Prades <carles.fernandez@cttc.es> -->
|
||||
<xs:element name="boost_serialization">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="GNSS-SDR_gal_iono_model">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element type="xs:float" name="ai0_5"/>
|
||||
<xs:element type="xs:float" name="ai1_5"/>
|
||||
<xs:element type="xs:float" name="ai2_5"/>
|
||||
<xs:element type="xs:int" name="TOW_5"/>
|
||||
<xs:element type="xs:short" name="WN_5"/>
|
||||
<xs:element type="xs:byte" name="Region1_flag_5"/>
|
||||
<xs:element type="xs:byte" name="Region2_flag_5"/>
|
||||
<xs:element type="xs:byte" name="Region3_flag_5"/>
|
||||
<xs:element type="xs:byte" name="Region4_flag_5"/>
|
||||
<xs:element type="xs:byte" name="Region5_flag_5"/>
|
||||
<xs:element type="xs:float" name="ai0"/>
|
||||
<xs:element type="xs:float" name="ai1"/>
|
||||
<xs:element type="xs:float" name="ai2"/>
|
||||
<xs:element type="xs:int" name="tow"/>
|
||||
<xs:element type="xs:short" name="WN"/>
|
||||
<xs:element type="xs:byte" name="Region1_flag"/>
|
||||
<xs:element type="xs:byte" name="Region2_flag"/>
|
||||
<xs:element type="xs:byte" name="Region3_flag"/>
|
||||
<xs:element type="xs:byte" name="Region4_flag"/>
|
||||
<xs:element type="xs:byte" name="Region5_flag"/>
|
||||
</xs:sequence>
|
||||
<xs:attribute type="xs:byte" name="class_id"/>
|
||||
<xs:attribute type="xs:byte" name="tracking_level"/>
|
||||
|
@ -1,20 +1,20 @@
|
||||
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<!-- SPDX-License-Identifier: BSD-3-Clause -->
|
||||
<!-- SPDX-FileCopyrightText: 2018-2020 Carles Fernandez-Prades <carles.fernandez@cttc.es> -->
|
||||
<!-- SPDX-FileCopyrightText: 2018-2021 Carles Fernandez-Prades <carles.fernandez@cttc.es> -->
|
||||
<xs:element name="boost_serialization">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="GNSS-SDR_gal_utc_model">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element type="xs:float" name="A0_6"/>
|
||||
<xs:element type="xs:float" name="A1_6"/>
|
||||
<xs:element type="xs:byte" name="Delta_tLS_6"/>
|
||||
<xs:element type="xs:int" name="t0t_6"/>
|
||||
<xs:element type="xs:short" name="WNot_6"/>
|
||||
<xs:element type="xs:short" name="WN_LSF_6"/>
|
||||
<xs:element type="xs:byte" name="DN_6"/>
|
||||
<xs:element type="xs:byte" name="Delta_tLSF_6"/>
|
||||
<xs:element type="xs:float" name="A0"/>
|
||||
<xs:element type="xs:float" name="A1"/>
|
||||
<xs:element type="xs:byte" name="Delta_tLS"/>
|
||||
<xs:element type="xs:int" name="tot"/>
|
||||
<xs:element type="xs:short" name="WNot"/>
|
||||
<xs:element type="xs:short" name="WN_LSF"/>
|
||||
<xs:element type="xs:byte" name="DN"/>
|
||||
<xs:element type="xs:byte" name="Delta_tLSF"/>
|
||||
<xs:element type="xs:byte" name="flag_utc_model"/>
|
||||
</xs:sequence>
|
||||
<xs:attribute type="xs:byte" name="class_id"/>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<!-- SPDX-License-Identifier: BSD-3-Clause -->
|
||||
<!-- SPDX-FileCopyrightText: 2018-2020 Carles Fernandez-Prades <carles.fernandez@cttc.es> -->
|
||||
<!-- SPDX-FileCopyrightText: 2018-2021 Carles Fernandez-Prades <carles.fernandez@cttc.es> -->
|
||||
<xs:element name="boost_serialization">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
@ -16,20 +16,20 @@
|
||||
<xs:element name="second">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element type="xs:byte" name="i_satellite_PRN"/>
|
||||
<xs:element type="xs:float" name="d_Delta_i"/>
|
||||
<xs:element type="xs:byte" name="i_Toa"/>
|
||||
<xs:element type="xs:byte" name="i_WNa"/>
|
||||
<xs:element type="xs:float" name="d_M_0"/>
|
||||
<xs:element type="xs:float" name="d_e_eccentricity"/>
|
||||
<xs:element type="xs:float" name="d_sqrt_A"/>
|
||||
<xs:element type="xs:float" name="d_OMEGA0"/>
|
||||
<xs:element type="xs:float" name="d_OMEGA"/>
|
||||
<xs:element type="xs:float" name="d_OMEGA_DOT"/>
|
||||
<xs:element type="xs:byte" name="i_SV_health"/>
|
||||
<xs:element type="xs:byte" name="i_AS_status"/>
|
||||
<xs:element type="xs:float" name="d_A_f0"/>
|
||||
<xs:element type="xs:float" name="d_A_f1"/>
|
||||
<xs:element type="xs:byte" name="PRN"/>
|
||||
<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="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: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:sequence>
|
||||
<xs:attribute type="xs:byte" name="class_id" use="optional"/>
|
||||
<xs:attribute type="xs:byte" name="tracking_level" use="optional"/>
|
||||
|
@ -1,20 +1,20 @@
|
||||
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<!-- SPDX-License-Identifier: BSD-3-Clause -->
|
||||
<!-- SPDX-FileCopyrightText: 2018-2020 Carles Fernandez-Prades <carles.fernandez@cttc.es> -->
|
||||
<!-- SPDX-FileCopyrightText: 2018-2021 Carles Fernandez-Prades <carles.fernandez@cttc.es> -->
|
||||
<xs:element name="boost_serialization">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="GNSS-SDR_iono_model">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element type="xs:float" name="d_alpha0"/>
|
||||
<xs:element type="xs:float" name="d_alpha1"/>
|
||||
<xs:element type="xs:float" name="d_alpha2"/>
|
||||
<xs:element type="xs:float" name="d_alpha3"/>
|
||||
<xs:element type="xs:float" name="d_beta0"/>
|
||||
<xs:element type="xs:float" name="d_beta1"/>
|
||||
<xs:element type="xs:float" name="d_beta2"/>
|
||||
<xs:element type="xs:float" name="d_beta3"/>
|
||||
<xs:element type="xs:float" name="alpha0"/>
|
||||
<xs:element type="xs:float" name="alpha1"/>
|
||||
<xs:element type="xs:float" name="alpha2"/>
|
||||
<xs:element type="xs:float" name="alpha3"/>
|
||||
<xs:element type="xs:float" name="beta0"/>
|
||||
<xs:element type="xs:float" name="beta1"/>
|
||||
<xs:element type="xs:float" name="beta2"/>
|
||||
<xs:element type="xs:float" name="beta3"/>
|
||||
</xs:sequence>
|
||||
<xs:attribute type="xs:byte" name="class_id"/>
|
||||
<xs:attribute type="xs:byte" name="tracking_level"/>
|
||||
|
@ -1,20 +1,20 @@
|
||||
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<!-- SPDX-License-Identifier: BSD-3-Clause -->
|
||||
<!-- SPDX-FileCopyrightText: 2018-2020 Carles Fernandez-Prades <carles.fernandez@cttc.es> -->
|
||||
<!-- SPDX-FileCopyrightText: 2018-2021 Carles Fernandez-Prades <carles.fernandez@cttc.es> -->
|
||||
<xs:element name="boost_serialization">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="GNSS-SDR_utc_model">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element type="xs:float" name="d_A1"/>
|
||||
<xs:element type="xs:float" name="d_A0"/>
|
||||
<xs:element type="xs:int" name="d_t_OT"/>
|
||||
<xs:element type="xs:short" name="i_WN_T"/>
|
||||
<xs:element type="xs:byte" name="d_DeltaT_LS"/>
|
||||
<xs:element type="xs:short" name="i_WN_LSF"/>
|
||||
<xs:element type="xs:byte" name="i_DN"/>
|
||||
<xs:element type="xs:byte" name="d_DeltaT_LSF"/>
|
||||
<xs:element type="xs:float" name="A1"/>
|
||||
<xs:element type="xs:float" name="A0"/>
|
||||
<xs:element type="xs:int" name="tot"/>
|
||||
<xs:element type="xs:short" name="WN_T"/>
|
||||
<xs:element type="xs:byte" name="DeltaT_LS"/>
|
||||
<xs:element type="xs:short" name="WN_LSF"/>
|
||||
<xs:element type="xs:byte" name="DN"/>
|
||||
<xs:element type="xs:byte" name="DeltaT_LSF"/>
|
||||
<xs:element type="xs:byte" name="valid"/>
|
||||
</xs:sequence>
|
||||
<xs:attribute type="xs:byte" name="class_id"/>
|
||||
|
@ -667,7 +667,7 @@ rtklib_pvt_gs::~rtklib_pvt_gs()
|
||||
|
||||
// Save Galileo UTC model parameters
|
||||
file_name = d_xml_base_path + "gal_utc_model.xml";
|
||||
if (d_internal_pvt_solver->galileo_utc_model.Delta_tLS_6 != 0.0)
|
||||
if (d_internal_pvt_solver->galileo_utc_model.Delta_tLS != 0.0)
|
||||
{
|
||||
std::ofstream ofs;
|
||||
try
|
||||
@ -757,7 +757,7 @@ rtklib_pvt_gs::~rtklib_pvt_gs()
|
||||
|
||||
// Save Galileo iono parameters
|
||||
file_name = d_xml_base_path + "gal_iono.xml";
|
||||
if (d_internal_pvt_solver->galileo_iono.ai0_5 != 0.0)
|
||||
if (d_internal_pvt_solver->galileo_iono.ai0 != 0.0)
|
||||
{
|
||||
std::ofstream ofs;
|
||||
try
|
||||
@ -1074,10 +1074,10 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg)
|
||||
// ### GPS EPHEMERIS ###
|
||||
const auto gps_eph = boost::any_cast<std::shared_ptr<Gps_Ephemeris>>(pmt::any_ref(msg));
|
||||
DLOG(INFO) << "Ephemeris record has arrived from SAT ID "
|
||||
<< gps_eph->i_satellite_PRN << " (Block "
|
||||
<< gps_eph->satelliteBlock[gps_eph->i_satellite_PRN] << ")"
|
||||
<< "inserted with Toe=" << gps_eph->d_Toe << " and GPS Week="
|
||||
<< gps_eph->i_GPS_week;
|
||||
<< gps_eph->PRN << " (Block "
|
||||
<< gps_eph->satelliteBlock[gps_eph->PRN] << ")"
|
||||
<< "inserted with Toe=" << gps_eph->toe << " and GPS Week="
|
||||
<< gps_eph->WN;
|
||||
|
||||
// todo: Send only new sets of ephemeris (new TOE), not sent to the client
|
||||
// send the new eph to the eph monitor (if enabled)
|
||||
@ -1089,13 +1089,13 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg)
|
||||
if (d_rinex_output_enabled && d_rp->is_rinex_header_written()) // The header is already written, we can now log the navigation message data
|
||||
{
|
||||
bool new_annotation = false;
|
||||
if (d_internal_pvt_solver->gps_ephemeris_map.find(gps_eph->i_satellite_PRN) == d_internal_pvt_solver->gps_ephemeris_map.cend())
|
||||
if (d_internal_pvt_solver->gps_ephemeris_map.find(gps_eph->PRN) == d_internal_pvt_solver->gps_ephemeris_map.cend())
|
||||
{
|
||||
new_annotation = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (d_internal_pvt_solver->gps_ephemeris_map[gps_eph->i_satellite_PRN].d_Toe != gps_eph->d_Toe)
|
||||
if (d_internal_pvt_solver->gps_ephemeris_map[gps_eph->PRN].toe != gps_eph->toe)
|
||||
{
|
||||
new_annotation = true;
|
||||
}
|
||||
@ -1104,14 +1104,14 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg)
|
||||
{
|
||||
// New record!
|
||||
std::map<int32_t, Gps_Ephemeris> new_eph;
|
||||
new_eph[gps_eph->i_satellite_PRN] = *gps_eph;
|
||||
new_eph[gps_eph->PRN] = *gps_eph;
|
||||
d_rp->log_rinex_nav_gps_nav(d_type_of_rx, new_eph);
|
||||
}
|
||||
}
|
||||
d_internal_pvt_solver->gps_ephemeris_map[gps_eph->i_satellite_PRN] = *gps_eph;
|
||||
d_internal_pvt_solver->gps_ephemeris_map[gps_eph->PRN] = *gps_eph;
|
||||
if (d_enable_rx_clock_correction == true)
|
||||
{
|
||||
d_user_pvt_solver->gps_ephemeris_map[gps_eph->i_satellite_PRN] = *gps_eph;
|
||||
d_user_pvt_solver->gps_ephemeris_map[gps_eph->PRN] = *gps_eph;
|
||||
}
|
||||
}
|
||||
else if (msg_type_hash_code == d_gps_iono_sptr_type_hash_code)
|
||||
@ -1144,13 +1144,13 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg)
|
||||
if (d_rinex_output_enabled && d_rp->is_rinex_header_written()) // The header is already written, we can now log the navigation message data
|
||||
{
|
||||
bool new_annotation = false;
|
||||
if (d_internal_pvt_solver->gps_cnav_ephemeris_map.find(gps_cnav_ephemeris->i_satellite_PRN) == d_internal_pvt_solver->gps_cnav_ephemeris_map.cend())
|
||||
if (d_internal_pvt_solver->gps_cnav_ephemeris_map.find(gps_cnav_ephemeris->PRN) == d_internal_pvt_solver->gps_cnav_ephemeris_map.cend())
|
||||
{
|
||||
new_annotation = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (d_internal_pvt_solver->gps_cnav_ephemeris_map[gps_cnav_ephemeris->i_satellite_PRN].d_Toe1 != gps_cnav_ephemeris->d_Toe1)
|
||||
if (d_internal_pvt_solver->gps_cnav_ephemeris_map[gps_cnav_ephemeris->PRN].toe1 != gps_cnav_ephemeris->toe1)
|
||||
{
|
||||
new_annotation = true;
|
||||
}
|
||||
@ -1159,14 +1159,14 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg)
|
||||
{
|
||||
// New record!
|
||||
std::map<int32_t, Gps_CNAV_Ephemeris> new_cnav_eph;
|
||||
new_cnav_eph[gps_cnav_ephemeris->i_satellite_PRN] = *gps_cnav_ephemeris;
|
||||
new_cnav_eph[gps_cnav_ephemeris->PRN] = *gps_cnav_ephemeris;
|
||||
d_rp->log_rinex_nav_gps_cnav(d_type_of_rx, new_cnav_eph);
|
||||
}
|
||||
}
|
||||
d_internal_pvt_solver->gps_cnav_ephemeris_map[gps_cnav_ephemeris->i_satellite_PRN] = *gps_cnav_ephemeris;
|
||||
d_internal_pvt_solver->gps_cnav_ephemeris_map[gps_cnav_ephemeris->PRN] = *gps_cnav_ephemeris;
|
||||
if (d_enable_rx_clock_correction == true)
|
||||
{
|
||||
d_user_pvt_solver->gps_cnav_ephemeris_map[gps_cnav_ephemeris->i_satellite_PRN] = *gps_cnav_ephemeris;
|
||||
d_user_pvt_solver->gps_cnav_ephemeris_map[gps_cnav_ephemeris->PRN] = *gps_cnav_ephemeris;
|
||||
}
|
||||
DLOG(INFO) << "New GPS CNAV ephemeris record has arrived ";
|
||||
}
|
||||
@ -1196,10 +1196,10 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg)
|
||||
{
|
||||
// ### GPS ALMANAC ###
|
||||
const auto gps_almanac = boost::any_cast<std::shared_ptr<Gps_Almanac>>(pmt::any_ref(msg));
|
||||
d_internal_pvt_solver->gps_almanac_map[gps_almanac->i_satellite_PRN] = *gps_almanac;
|
||||
d_internal_pvt_solver->gps_almanac_map[gps_almanac->PRN] = *gps_almanac;
|
||||
if (d_enable_rx_clock_correction == true)
|
||||
{
|
||||
d_user_pvt_solver->gps_almanac_map[gps_almanac->i_satellite_PRN] = *gps_almanac;
|
||||
d_user_pvt_solver->gps_almanac_map[gps_almanac->PRN] = *gps_almanac;
|
||||
}
|
||||
DLOG(INFO) << "New GPS almanac record has arrived ";
|
||||
}
|
||||
@ -1210,8 +1210,8 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg)
|
||||
// ### Galileo EPHEMERIS ###
|
||||
const auto galileo_eph = boost::any_cast<std::shared_ptr<Galileo_Ephemeris>>(pmt::any_ref(msg));
|
||||
// insert new ephemeris record
|
||||
DLOG(INFO) << "Galileo New Ephemeris record inserted in global map with TOW =" << galileo_eph->TOW_5
|
||||
<< ", GALILEO Week Number =" << galileo_eph->WN_5
|
||||
DLOG(INFO) << "Galileo New Ephemeris record inserted in global map with TOW =" << galileo_eph->tow
|
||||
<< ", GALILEO Week Number =" << galileo_eph->WN
|
||||
<< " and Ephemeris IOD = " << galileo_eph->IOD_ephemeris;
|
||||
// todo: Send only new sets of ephemeris (new TOE), not sent to the client
|
||||
// send the new eph to the eph monitor (if enabled)
|
||||
@ -1223,13 +1223,13 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg)
|
||||
if (d_rinex_output_enabled && d_rp->is_rinex_header_written()) // The header is already written, we can now log the navigation message data
|
||||
{
|
||||
bool new_annotation = false;
|
||||
if (d_internal_pvt_solver->galileo_ephemeris_map.find(galileo_eph->i_satellite_PRN) == d_internal_pvt_solver->galileo_ephemeris_map.cend())
|
||||
if (d_internal_pvt_solver->galileo_ephemeris_map.find(galileo_eph->PRN) == d_internal_pvt_solver->galileo_ephemeris_map.cend())
|
||||
{
|
||||
new_annotation = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (d_internal_pvt_solver->galileo_ephemeris_map[galileo_eph->i_satellite_PRN].t0e_1 != galileo_eph->t0e_1)
|
||||
if (d_internal_pvt_solver->galileo_ephemeris_map[galileo_eph->PRN].toe != galileo_eph->toe)
|
||||
{
|
||||
new_annotation = true;
|
||||
}
|
||||
@ -1238,14 +1238,14 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg)
|
||||
{
|
||||
// New record!
|
||||
std::map<int32_t, Galileo_Ephemeris> new_gal_eph;
|
||||
new_gal_eph[galileo_eph->i_satellite_PRN] = *galileo_eph;
|
||||
new_gal_eph[galileo_eph->PRN] = *galileo_eph;
|
||||
d_rp->log_rinex_nav_gal_nav(d_type_of_rx, new_gal_eph);
|
||||
}
|
||||
}
|
||||
d_internal_pvt_solver->galileo_ephemeris_map[galileo_eph->i_satellite_PRN] = *galileo_eph;
|
||||
d_internal_pvt_solver->galileo_ephemeris_map[galileo_eph->PRN] = *galileo_eph;
|
||||
if (d_enable_rx_clock_correction == true)
|
||||
{
|
||||
d_user_pvt_solver->galileo_ephemeris_map[galileo_eph->i_satellite_PRN] = *galileo_eph;
|
||||
d_user_pvt_solver->galileo_ephemeris_map[galileo_eph->PRN] = *galileo_eph;
|
||||
}
|
||||
}
|
||||
else if (msg_type_hash_code == d_galileo_iono_sptr_type_hash_code)
|
||||
@ -1278,28 +1278,28 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg)
|
||||
const Galileo_Almanac sv2 = galileo_almanac_helper->get_almanac(2);
|
||||
const Galileo_Almanac sv3 = galileo_almanac_helper->get_almanac(3);
|
||||
|
||||
if (sv1.i_satellite_PRN != 0)
|
||||
if (sv1.PRN != 0)
|
||||
{
|
||||
d_internal_pvt_solver->galileo_almanac_map[sv1.i_satellite_PRN] = sv1;
|
||||
d_internal_pvt_solver->galileo_almanac_map[sv1.PRN] = sv1;
|
||||
if (d_enable_rx_clock_correction == true)
|
||||
{
|
||||
d_user_pvt_solver->galileo_almanac_map[sv1.i_satellite_PRN] = sv1;
|
||||
d_user_pvt_solver->galileo_almanac_map[sv1.PRN] = sv1;
|
||||
}
|
||||
}
|
||||
if (sv2.i_satellite_PRN != 0)
|
||||
if (sv2.PRN != 0)
|
||||
{
|
||||
d_internal_pvt_solver->galileo_almanac_map[sv2.i_satellite_PRN] = sv2;
|
||||
d_internal_pvt_solver->galileo_almanac_map[sv2.PRN] = sv2;
|
||||
if (d_enable_rx_clock_correction == true)
|
||||
{
|
||||
d_user_pvt_solver->galileo_almanac_map[sv2.i_satellite_PRN] = sv2;
|
||||
d_user_pvt_solver->galileo_almanac_map[sv2.PRN] = sv2;
|
||||
}
|
||||
}
|
||||
if (sv3.i_satellite_PRN != 0)
|
||||
if (sv3.PRN != 0)
|
||||
{
|
||||
d_internal_pvt_solver->galileo_almanac_map[sv3.i_satellite_PRN] = sv3;
|
||||
d_internal_pvt_solver->galileo_almanac_map[sv3.PRN] = sv3;
|
||||
if (d_enable_rx_clock_correction == true)
|
||||
{
|
||||
d_user_pvt_solver->galileo_almanac_map[sv3.i_satellite_PRN] = sv3;
|
||||
d_user_pvt_solver->galileo_almanac_map[sv3.PRN] = sv3;
|
||||
}
|
||||
}
|
||||
DLOG(INFO) << "New Galileo Almanac data have arrived ";
|
||||
@ -1309,10 +1309,10 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg)
|
||||
// ### Galileo Almanac ###
|
||||
const auto galileo_alm = boost::any_cast<std::shared_ptr<Galileo_Almanac>>(pmt::any_ref(msg));
|
||||
// update/insert new almanac record to the global almanac map
|
||||
d_internal_pvt_solver->galileo_almanac_map[galileo_alm->i_satellite_PRN] = *galileo_alm;
|
||||
d_internal_pvt_solver->galileo_almanac_map[galileo_alm->PRN] = *galileo_alm;
|
||||
if (d_enable_rx_clock_correction == true)
|
||||
{
|
||||
d_user_pvt_solver->galileo_almanac_map[galileo_alm->i_satellite_PRN] = *galileo_alm;
|
||||
d_user_pvt_solver->galileo_almanac_map[galileo_alm->PRN] = *galileo_alm;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1331,13 +1331,13 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg)
|
||||
if (d_rinex_output_enabled && d_rp->is_rinex_header_written()) // The header is already written, we can now log the navigation message data
|
||||
{
|
||||
bool new_annotation = false;
|
||||
if (d_internal_pvt_solver->glonass_gnav_ephemeris_map.find(glonass_gnav_eph->i_satellite_PRN) == d_internal_pvt_solver->glonass_gnav_ephemeris_map.cend())
|
||||
if (d_internal_pvt_solver->glonass_gnav_ephemeris_map.find(glonass_gnav_eph->PRN) == d_internal_pvt_solver->glonass_gnav_ephemeris_map.cend())
|
||||
{
|
||||
new_annotation = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (d_internal_pvt_solver->glonass_gnav_ephemeris_map[glonass_gnav_eph->i_satellite_PRN].d_t_b != glonass_gnav_eph->d_t_b)
|
||||
if (d_internal_pvt_solver->glonass_gnav_ephemeris_map[glonass_gnav_eph->PRN].d_t_b != glonass_gnav_eph->d_t_b)
|
||||
{
|
||||
new_annotation = true;
|
||||
}
|
||||
@ -1346,14 +1346,14 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg)
|
||||
{
|
||||
// New record!
|
||||
std::map<int32_t, Glonass_Gnav_Ephemeris> new_glo_eph;
|
||||
new_glo_eph[glonass_gnav_eph->i_satellite_PRN] = *glonass_gnav_eph;
|
||||
new_glo_eph[glonass_gnav_eph->PRN] = *glonass_gnav_eph;
|
||||
d_rp->log_rinex_nav_glo_gnav(d_type_of_rx, new_glo_eph);
|
||||
}
|
||||
}
|
||||
d_internal_pvt_solver->glonass_gnav_ephemeris_map[glonass_gnav_eph->i_satellite_PRN] = *glonass_gnav_eph;
|
||||
d_internal_pvt_solver->glonass_gnav_ephemeris_map[glonass_gnav_eph->PRN] = *glonass_gnav_eph;
|
||||
if (d_enable_rx_clock_correction == true)
|
||||
{
|
||||
d_user_pvt_solver->glonass_gnav_ephemeris_map[glonass_gnav_eph->i_satellite_PRN] = *glonass_gnav_eph;
|
||||
d_user_pvt_solver->glonass_gnav_ephemeris_map[glonass_gnav_eph->PRN] = *glonass_gnav_eph;
|
||||
}
|
||||
}
|
||||
else if (msg_type_hash_code == d_glonass_gnav_utc_model_sptr_type_hash_code)
|
||||
@ -1386,21 +1386,21 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg)
|
||||
// ### Beidou EPHEMERIS ###
|
||||
const auto bds_dnav_eph = boost::any_cast<std::shared_ptr<Beidou_Dnav_Ephemeris>>(pmt::any_ref(msg));
|
||||
DLOG(INFO) << "Ephemeris record has arrived from SAT ID "
|
||||
<< bds_dnav_eph->i_satellite_PRN << " (Block "
|
||||
<< bds_dnav_eph->satelliteBlock[bds_dnav_eph->i_satellite_PRN] << ")"
|
||||
<< "inserted with Toe=" << bds_dnav_eph->d_Toe << " and BDS Week="
|
||||
<< bds_dnav_eph->i_BEIDOU_week;
|
||||
<< bds_dnav_eph->PRN << " (Block "
|
||||
<< bds_dnav_eph->satelliteBlock[bds_dnav_eph->PRN] << ")"
|
||||
<< "inserted with Toe=" << bds_dnav_eph->toe << " and BDS Week="
|
||||
<< bds_dnav_eph->WN;
|
||||
// update/insert new ephemeris record to the global ephemeris map
|
||||
if (d_rinex_output_enabled && d_rp->is_rinex_header_written()) // The header is already written, we can now log the navigation message data
|
||||
{
|
||||
bool new_annotation = false;
|
||||
if (d_internal_pvt_solver->beidou_dnav_ephemeris_map.find(bds_dnav_eph->i_satellite_PRN) == d_internal_pvt_solver->beidou_dnav_ephemeris_map.cend())
|
||||
if (d_internal_pvt_solver->beidou_dnav_ephemeris_map.find(bds_dnav_eph->PRN) == d_internal_pvt_solver->beidou_dnav_ephemeris_map.cend())
|
||||
{
|
||||
new_annotation = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (d_internal_pvt_solver->beidou_dnav_ephemeris_map[bds_dnav_eph->i_satellite_PRN].d_Toc != bds_dnav_eph->d_Toc)
|
||||
if (d_internal_pvt_solver->beidou_dnav_ephemeris_map[bds_dnav_eph->PRN].toc != bds_dnav_eph->toc)
|
||||
{
|
||||
new_annotation = true;
|
||||
}
|
||||
@ -1409,14 +1409,14 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg)
|
||||
{
|
||||
// New record!
|
||||
std::map<int32_t, Beidou_Dnav_Ephemeris> new_bds_eph;
|
||||
new_bds_eph[bds_dnav_eph->i_satellite_PRN] = *bds_dnav_eph;
|
||||
new_bds_eph[bds_dnav_eph->PRN] = *bds_dnav_eph;
|
||||
d_rp->log_rinex_nav_bds_dnav(d_type_of_rx, new_bds_eph);
|
||||
}
|
||||
}
|
||||
d_internal_pvt_solver->beidou_dnav_ephemeris_map[bds_dnav_eph->i_satellite_PRN] = *bds_dnav_eph;
|
||||
d_internal_pvt_solver->beidou_dnav_ephemeris_map[bds_dnav_eph->PRN] = *bds_dnav_eph;
|
||||
if (d_enable_rx_clock_correction == true)
|
||||
{
|
||||
d_user_pvt_solver->beidou_dnav_ephemeris_map[bds_dnav_eph->i_satellite_PRN] = *bds_dnav_eph;
|
||||
d_user_pvt_solver->beidou_dnav_ephemeris_map[bds_dnav_eph->PRN] = *bds_dnav_eph;
|
||||
}
|
||||
}
|
||||
else if (msg_type_hash_code == d_beidou_dnav_iono_sptr_type_hash_code)
|
||||
@ -1445,10 +1445,10 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg)
|
||||
{
|
||||
// ### BeiDou ALMANAC ###
|
||||
const auto bds_dnav_almanac = boost::any_cast<std::shared_ptr<Beidou_Dnav_Almanac>>(pmt::any_ref(msg));
|
||||
d_internal_pvt_solver->beidou_dnav_almanac_map[bds_dnav_almanac->i_satellite_PRN] = *bds_dnav_almanac;
|
||||
d_internal_pvt_solver->beidou_dnav_almanac_map[bds_dnav_almanac->PRN] = *bds_dnav_almanac;
|
||||
if (d_enable_rx_clock_correction == true)
|
||||
{
|
||||
d_user_pvt_solver->beidou_dnav_almanac_map[bds_dnav_almanac->i_satellite_PRN] = *bds_dnav_almanac;
|
||||
d_user_pvt_solver->beidou_dnav_almanac_map[bds_dnav_almanac->PRN] = *bds_dnav_almanac;
|
||||
}
|
||||
DLOG(INFO) << "New BeiDou DNAV almanac record has arrived ";
|
||||
}
|
||||
@ -1834,7 +1834,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item
|
||||
|
||||
if (tmp_eph_iter_gps != d_internal_pvt_solver->gps_ephemeris_map.cend())
|
||||
{
|
||||
const uint32_t prn_aux = tmp_eph_iter_gps->second.i_satellite_PRN;
|
||||
const uint32_t prn_aux = tmp_eph_iter_gps->second.PRN;
|
||||
if ((prn_aux == in[i][epoch].PRN) and (std::string(in[i][epoch].Signal) == "1C"))
|
||||
{
|
||||
store_valid_observable = true;
|
||||
@ -1842,7 +1842,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item
|
||||
}
|
||||
if (tmp_eph_iter_gal != d_internal_pvt_solver->galileo_ephemeris_map.cend())
|
||||
{
|
||||
const uint32_t prn_aux = tmp_eph_iter_gal->second.i_satellite_PRN;
|
||||
const uint32_t prn_aux = tmp_eph_iter_gal->second.PRN;
|
||||
if ((prn_aux == in[i][epoch].PRN) and ((std::string(in[i][epoch].Signal) == "1B") or (std::string(in[i][epoch].Signal) == "5X") or (std::string(in[i][epoch].Signal) == "7X")))
|
||||
{
|
||||
store_valid_observable = true;
|
||||
@ -1850,7 +1850,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item
|
||||
}
|
||||
if (tmp_eph_iter_cnav != d_internal_pvt_solver->gps_cnav_ephemeris_map.cend())
|
||||
{
|
||||
const uint32_t prn_aux = tmp_eph_iter_cnav->second.i_satellite_PRN;
|
||||
const uint32_t prn_aux = tmp_eph_iter_cnav->second.PRN;
|
||||
if ((prn_aux == in[i][epoch].PRN) and ((std::string(in[i][epoch].Signal) == "2S") or (std::string(in[i][epoch].Signal) == "L5")))
|
||||
{
|
||||
store_valid_observable = true;
|
||||
@ -1858,7 +1858,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item
|
||||
}
|
||||
if (tmp_eph_iter_glo_gnav != d_internal_pvt_solver->glonass_gnav_ephemeris_map.cend())
|
||||
{
|
||||
const uint32_t prn_aux = tmp_eph_iter_glo_gnav->second.i_satellite_PRN;
|
||||
const uint32_t prn_aux = tmp_eph_iter_glo_gnav->second.PRN;
|
||||
if ((prn_aux == in[i][epoch].PRN) and ((std::string(in[i][epoch].Signal) == "1G") or (std::string(in[i][epoch].Signal) == "2G")))
|
||||
{
|
||||
store_valid_observable = true;
|
||||
@ -1866,7 +1866,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item
|
||||
}
|
||||
if (tmp_eph_iter_bds_dnav != d_internal_pvt_solver->beidou_dnav_ephemeris_map.cend())
|
||||
{
|
||||
const uint32_t prn_aux = tmp_eph_iter_bds_dnav->second.i_satellite_PRN;
|
||||
const uint32_t prn_aux = tmp_eph_iter_bds_dnav->second.PRN;
|
||||
if ((prn_aux == in[i][epoch].PRN) and ((std::string(in[i][epoch].Signal) == "B1") or (std::string(in[i][epoch].Signal) == "B3")))
|
||||
{
|
||||
store_valid_observable = true;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1625,92 +1625,92 @@ int32_t Rtcm::read_MT1019(const std::string& message, Gps_Ephemeris& gps_eph) co
|
||||
}
|
||||
|
||||
// Fill Gps Ephemeris with message data content
|
||||
gps_eph.i_satellite_PRN = static_cast<uint32_t>(Rtcm::bin_to_uint(message_bin.substr(index, 6)));
|
||||
gps_eph.PRN = static_cast<uint32_t>(Rtcm::bin_to_uint(message_bin.substr(index, 6)));
|
||||
index += 6;
|
||||
|
||||
gps_eph.i_GPS_week = static_cast<int32_t>(Rtcm::bin_to_uint(message_bin.substr(index, 10)));
|
||||
gps_eph.WN = static_cast<int32_t>(Rtcm::bin_to_uint(message_bin.substr(index, 10)));
|
||||
index += 10;
|
||||
|
||||
gps_eph.i_SV_accuracy = static_cast<int32_t>(Rtcm::bin_to_uint(message_bin.substr(index, 4)));
|
||||
gps_eph.SV_accuracy = static_cast<int32_t>(Rtcm::bin_to_uint(message_bin.substr(index, 4)));
|
||||
index += 4;
|
||||
|
||||
gps_eph.i_code_on_L2 = static_cast<int32_t>(Rtcm::bin_to_uint(message_bin.substr(index, 2)));
|
||||
gps_eph.code_on_L2 = static_cast<int32_t>(Rtcm::bin_to_uint(message_bin.substr(index, 2)));
|
||||
index += 2;
|
||||
|
||||
gps_eph.d_IDOT = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 14))) * I_DOT_LSB;
|
||||
gps_eph.idot = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 14))) * I_DOT_LSB;
|
||||
index += 14;
|
||||
|
||||
gps_eph.d_IODE_SF2 = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 8)));
|
||||
gps_eph.d_IODE_SF3 = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 8)));
|
||||
gps_eph.IODE_SF2 = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 8)));
|
||||
gps_eph.IODE_SF3 = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 8)));
|
||||
index += 8;
|
||||
|
||||
gps_eph.d_Toc = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 16))) * T_OC_LSB;
|
||||
gps_eph.toc = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 16))) * T_OC_LSB;
|
||||
index += 16;
|
||||
|
||||
gps_eph.d_A_f2 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 8))) * A_F2_LSB;
|
||||
gps_eph.af2 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 8))) * A_F2_LSB;
|
||||
index += 8;
|
||||
|
||||
gps_eph.d_A_f1 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 16))) * A_F1_LSB;
|
||||
gps_eph.af1 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 16))) * A_F1_LSB;
|
||||
index += 16;
|
||||
|
||||
gps_eph.d_A_f0 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 22))) * A_F0_LSB;
|
||||
gps_eph.af0 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 22))) * A_F0_LSB;
|
||||
index += 22;
|
||||
|
||||
gps_eph.d_IODC = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 10)));
|
||||
gps_eph.IODC = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 10)));
|
||||
index += 10;
|
||||
|
||||
gps_eph.d_Crs = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_RS_LSB;
|
||||
gps_eph.Crs = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_RS_LSB;
|
||||
index += 16;
|
||||
|
||||
gps_eph.d_Delta_n = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 16))) * DELTA_N_LSB;
|
||||
gps_eph.delta_n = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 16))) * DELTA_N_LSB;
|
||||
index += 16;
|
||||
|
||||
gps_eph.d_M_0 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 32))) * M_0_LSB;
|
||||
gps_eph.M_0 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 32))) * M_0_LSB;
|
||||
index += 32;
|
||||
|
||||
gps_eph.d_Cuc = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_UC_LSB;
|
||||
gps_eph.Cuc = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_UC_LSB;
|
||||
index += 16;
|
||||
|
||||
gps_eph.d_e_eccentricity = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 32))) * ECCENTRICITY_LSB;
|
||||
gps_eph.ecc = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 32))) * ECCENTRICITY_LSB;
|
||||
index += 32;
|
||||
|
||||
gps_eph.d_Cus = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_US_LSB;
|
||||
gps_eph.Cus = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_US_LSB;
|
||||
index += 16;
|
||||
|
||||
gps_eph.d_sqrt_A = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 32))) * SQRT_A_LSB;
|
||||
gps_eph.sqrtA = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 32))) * SQRT_A_LSB;
|
||||
index += 32;
|
||||
|
||||
gps_eph.d_Toe = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 16))) * T_OE_LSB;
|
||||
gps_eph.toe = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 16))) * T_OE_LSB;
|
||||
index += 16;
|
||||
|
||||
gps_eph.d_Cic = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_IC_LSB;
|
||||
gps_eph.Cic = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_IC_LSB;
|
||||
index += 16;
|
||||
|
||||
gps_eph.d_OMEGA0 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 32))) * OMEGA_0_LSB;
|
||||
gps_eph.OMEGA_0 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 32))) * OMEGA_0_LSB;
|
||||
index += 32;
|
||||
|
||||
gps_eph.d_Cis = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_IS_LSB;
|
||||
gps_eph.Cis = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_IS_LSB;
|
||||
index += 16;
|
||||
|
||||
gps_eph.d_i_0 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 32))) * I_0_LSB;
|
||||
gps_eph.i_0 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 32))) * I_0_LSB;
|
||||
index += 32;
|
||||
|
||||
gps_eph.d_Crc = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_RC_LSB;
|
||||
gps_eph.Crc = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_RC_LSB;
|
||||
index += 16;
|
||||
|
||||
gps_eph.d_OMEGA = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 32))) * OMEGA_LSB;
|
||||
gps_eph.omega = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 32))) * OMEGA_LSB;
|
||||
index += 32;
|
||||
|
||||
gps_eph.d_OMEGA_DOT = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 24))) * OMEGA_DOT_LSB;
|
||||
gps_eph.OMEGAdot = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 24))) * OMEGA_DOT_LSB;
|
||||
index += 24;
|
||||
|
||||
gps_eph.d_TGD = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 8))) * T_GD_LSB;
|
||||
gps_eph.TGD = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 8))) * T_GD_LSB;
|
||||
index += 8;
|
||||
|
||||
gps_eph.i_SV_health = static_cast<int32_t>(Rtcm::bin_to_uint(message_bin.substr(index, 6)));
|
||||
gps_eph.SV_health = static_cast<int32_t>(Rtcm::bin_to_uint(message_bin.substr(index, 6)));
|
||||
index += 6;
|
||||
|
||||
gps_eph.b_L2_P_data_flag = static_cast<bool>(Rtcm::bin_to_uint(message_bin.substr(index, 1)));
|
||||
gps_eph.L2_P_data_flag = static_cast<bool>(Rtcm::bin_to_uint(message_bin.substr(index, 1)));
|
||||
index += 1;
|
||||
|
||||
gps_eph.b_fit_interval_flag = static_cast<bool>(Rtcm::bin_to_uint(message_bin.substr(index, 1)));
|
||||
@ -2162,79 +2162,79 @@ int32_t Rtcm::read_MT1045(const std::string& message, Galileo_Ephemeris& gal_eph
|
||||
}
|
||||
|
||||
// Fill Galileo Ephemeris with message data content
|
||||
gal_eph.i_satellite_PRN = static_cast<uint32_t>(Rtcm::bin_to_uint(message_bin.substr(index, 6)));
|
||||
gal_eph.PRN = static_cast<uint32_t>(Rtcm::bin_to_uint(message_bin.substr(index, 6)));
|
||||
index += 6;
|
||||
|
||||
gal_eph.WN_5 = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 12)));
|
||||
gal_eph.WN = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 12)));
|
||||
index += 12;
|
||||
|
||||
gal_eph.IOD_nav_1 = static_cast<int32_t>(Rtcm::bin_to_uint(message_bin.substr(index, 10)));
|
||||
gal_eph.IOD_nav = static_cast<int32_t>(Rtcm::bin_to_uint(message_bin.substr(index, 10)));
|
||||
index += 10;
|
||||
|
||||
gal_eph.SISA_3 = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 8)));
|
||||
gal_eph.SISA = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 8)));
|
||||
index += 8;
|
||||
|
||||
gal_eph.iDot_2 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 14))) * I_DOT_2_LSB;
|
||||
gal_eph.idot = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 14))) * I_DOT_2_LSB;
|
||||
index += 14;
|
||||
|
||||
gal_eph.t0c_4 = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 14))) * T0C_4_LSB;
|
||||
gal_eph.toc = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 14))) * T0C_4_LSB;
|
||||
index += 14;
|
||||
|
||||
gal_eph.af2_4 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 6))) * AF2_4_LSB;
|
||||
gal_eph.af2 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 6))) * AF2_4_LSB;
|
||||
index += 6;
|
||||
|
||||
gal_eph.af1_4 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 21))) * AF1_4_LSB;
|
||||
gal_eph.af1 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 21))) * AF1_4_LSB;
|
||||
index += 21;
|
||||
|
||||
gal_eph.af0_4 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 31))) * AF0_4_LSB;
|
||||
gal_eph.af0 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 31))) * AF0_4_LSB;
|
||||
index += 31;
|
||||
|
||||
gal_eph.C_rs_3 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_RS_3_LSB;
|
||||
gal_eph.Crs = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_RS_3_LSB;
|
||||
index += 16;
|
||||
|
||||
gal_eph.delta_n_3 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 16))) * DELTA_N_3_LSB;
|
||||
gal_eph.delta_n = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 16))) * DELTA_N_3_LSB;
|
||||
index += 16;
|
||||
|
||||
gal_eph.M0_1 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 32))) * M0_1_LSB;
|
||||
gal_eph.M_0 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 32))) * M0_1_LSB;
|
||||
index += 32;
|
||||
|
||||
gal_eph.C_uc_3 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_UC_3_LSB;
|
||||
gal_eph.Cuc = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_UC_3_LSB;
|
||||
index += 16;
|
||||
|
||||
gal_eph.e_1 = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 32))) * E_1_LSB;
|
||||
gal_eph.ecc = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 32))) * E_1_LSB;
|
||||
index += 32;
|
||||
|
||||
gal_eph.C_us_3 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_US_3_LSB;
|
||||
gal_eph.Cus = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_US_3_LSB;
|
||||
index += 16;
|
||||
|
||||
gal_eph.A_1 = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 32))) * A_1_LSB_GAL;
|
||||
gal_eph.sqrtA = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 32))) * A_1_LSB_GAL;
|
||||
index += 32;
|
||||
|
||||
gal_eph.t0e_1 = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 14))) * T0E_1_LSB;
|
||||
gal_eph.toe = static_cast<double>(Rtcm::bin_to_uint(message_bin.substr(index, 14))) * T0E_1_LSB;
|
||||
index += 14;
|
||||
|
||||
gal_eph.C_ic_4 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_IC_4_LSB;
|
||||
gal_eph.Cic = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_IC_4_LSB;
|
||||
index += 16;
|
||||
|
||||
gal_eph.OMEGA_0_2 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 32))) * OMEGA_0_2_LSB;
|
||||
gal_eph.OMEGA_0 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 32))) * OMEGA_0_2_LSB;
|
||||
index += 32;
|
||||
|
||||
gal_eph.C_is_4 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_IS_4_LSB;
|
||||
gal_eph.Cis = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_IS_4_LSB;
|
||||
index += 16;
|
||||
|
||||
gal_eph.i_0_2 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 32))) * I_0_2_LSB;
|
||||
gal_eph.i_0 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 32))) * I_0_2_LSB;
|
||||
index += 32;
|
||||
|
||||
gal_eph.C_rc_3 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_RC_3_LSB;
|
||||
gal_eph.Crc = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_RC_3_LSB;
|
||||
index += 16;
|
||||
|
||||
gal_eph.omega_2 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 32))) * OMEGA_2_LSB;
|
||||
gal_eph.omega = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 32))) * OMEGA_2_LSB;
|
||||
index += 32;
|
||||
|
||||
gal_eph.OMEGA_dot_3 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 24))) * OMEGA_DOT_3_LSB;
|
||||
gal_eph.OMEGAdot = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 24))) * OMEGA_DOT_3_LSB;
|
||||
index += 24;
|
||||
|
||||
gal_eph.BGD_E1E5a_5 = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 10)));
|
||||
gal_eph.BGD_E1E5a = static_cast<double>(Rtcm::bin_to_int(message_bin.substr(index, 10)));
|
||||
index += 10;
|
||||
|
||||
gal_eph.E5a_HS = static_cast<uint32_t>(Rtcm::bin_to_uint(message_bin.substr(index, 2)));
|
||||
@ -2266,23 +2266,23 @@ std::string Rtcm::print_MSM_1(const Gps_Ephemeris& gps_eph,
|
||||
bool more_messages)
|
||||
{
|
||||
uint32_t msg_number = 0;
|
||||
if (gps_eph.i_satellite_PRN != 0)
|
||||
if (gps_eph.PRN != 0)
|
||||
{
|
||||
msg_number = 1071;
|
||||
}
|
||||
if (gps_cnav_eph.i_satellite_PRN != 0)
|
||||
if (gps_cnav_eph.PRN != 0)
|
||||
{
|
||||
msg_number = 1071;
|
||||
}
|
||||
if (glo_gnav_eph.i_satellite_PRN != 0)
|
||||
if (glo_gnav_eph.PRN != 0)
|
||||
{
|
||||
msg_number = 1081;
|
||||
}
|
||||
if (gal_eph.i_satellite_PRN != 0)
|
||||
if (gal_eph.PRN != 0)
|
||||
{
|
||||
msg_number = 1091;
|
||||
}
|
||||
if (((gps_eph.i_satellite_PRN != 0) || (gps_cnav_eph.i_satellite_PRN != 0)) && (gal_eph.i_satellite_PRN != 0) && (glo_gnav_eph.i_satellite_PRN != 0))
|
||||
if (((gps_eph.PRN != 0) || (gps_cnav_eph.PRN != 0)) && (gal_eph.PRN != 0) && (glo_gnav_eph.PRN != 0))
|
||||
{
|
||||
LOG(WARNING) << "MSM messages for observables from different systems are not defined"; // print two messages?
|
||||
}
|
||||
@ -2463,23 +2463,23 @@ std::string Rtcm::print_MSM_2(const Gps_Ephemeris& gps_eph,
|
||||
bool more_messages)
|
||||
{
|
||||
uint32_t msg_number = 0;
|
||||
if (gps_eph.i_satellite_PRN != 0)
|
||||
if (gps_eph.PRN != 0)
|
||||
{
|
||||
msg_number = 1072;
|
||||
}
|
||||
if (gps_cnav_eph.i_satellite_PRN != 0)
|
||||
if (gps_cnav_eph.PRN != 0)
|
||||
{
|
||||
msg_number = 1072;
|
||||
}
|
||||
if (glo_gnav_eph.i_satellite_PRN != 0)
|
||||
if (glo_gnav_eph.PRN != 0)
|
||||
{
|
||||
msg_number = 1082;
|
||||
}
|
||||
if (gal_eph.i_satellite_PRN != 0)
|
||||
if (gal_eph.PRN != 0)
|
||||
{
|
||||
msg_number = 1092;
|
||||
}
|
||||
if (((gps_eph.i_satellite_PRN != 0) || (gps_cnav_eph.i_satellite_PRN != 0)) && (gal_eph.i_satellite_PRN != 0) && (glo_gnav_eph.i_satellite_PRN != 0))
|
||||
if (((gps_eph.PRN != 0) || (gps_cnav_eph.PRN != 0)) && (gal_eph.PRN != 0) && (glo_gnav_eph.PRN != 0))
|
||||
{
|
||||
LOG(WARNING) << "MSM messages for observables from different systems are not defined"; // print two messages?
|
||||
}
|
||||
@ -2577,23 +2577,23 @@ std::string Rtcm::print_MSM_3(const Gps_Ephemeris& gps_eph,
|
||||
bool more_messages)
|
||||
{
|
||||
uint32_t msg_number = 0;
|
||||
if (gps_eph.i_satellite_PRN != 0)
|
||||
if (gps_eph.PRN != 0)
|
||||
{
|
||||
msg_number = 1073;
|
||||
}
|
||||
if (gps_cnav_eph.i_satellite_PRN != 0)
|
||||
if (gps_cnav_eph.PRN != 0)
|
||||
{
|
||||
msg_number = 1073;
|
||||
}
|
||||
if (glo_gnav_eph.i_satellite_PRN != 0)
|
||||
if (glo_gnav_eph.PRN != 0)
|
||||
{
|
||||
msg_number = 1083;
|
||||
}
|
||||
if (gal_eph.i_satellite_PRN != 0)
|
||||
if (gal_eph.PRN != 0)
|
||||
{
|
||||
msg_number = 1093;
|
||||
}
|
||||
if (((gps_eph.i_satellite_PRN != 0) || (gps_cnav_eph.i_satellite_PRN != 0)) && (gal_eph.i_satellite_PRN != 0) && (glo_gnav_eph.i_satellite_PRN != 0))
|
||||
if (((gps_eph.PRN != 0) || (gps_cnav_eph.PRN != 0)) && (gal_eph.PRN != 0) && (glo_gnav_eph.PRN != 0))
|
||||
{
|
||||
LOG(WARNING) << "MSM messages for observables from different systems are not defined"; // print two messages?
|
||||
}
|
||||
@ -2694,23 +2694,23 @@ std::string Rtcm::print_MSM_4(const Gps_Ephemeris& gps_eph,
|
||||
bool more_messages)
|
||||
{
|
||||
uint32_t msg_number = 0;
|
||||
if (gps_eph.i_satellite_PRN != 0)
|
||||
if (gps_eph.PRN != 0)
|
||||
{
|
||||
msg_number = 1074;
|
||||
}
|
||||
if (gps_cnav_eph.i_satellite_PRN != 0)
|
||||
if (gps_cnav_eph.PRN != 0)
|
||||
{
|
||||
msg_number = 1074;
|
||||
}
|
||||
if (glo_gnav_eph.i_satellite_PRN != 0)
|
||||
if (glo_gnav_eph.PRN != 0)
|
||||
{
|
||||
msg_number = 1084;
|
||||
}
|
||||
if (gal_eph.i_satellite_PRN != 0)
|
||||
if (gal_eph.PRN != 0)
|
||||
{
|
||||
msg_number = 1094;
|
||||
}
|
||||
if (((gps_eph.i_satellite_PRN != 0) || (gps_cnav_eph.i_satellite_PRN != 0)) && (gal_eph.i_satellite_PRN != 0) && (glo_gnav_eph.i_satellite_PRN != 0))
|
||||
if (((gps_eph.PRN != 0) || (gps_cnav_eph.PRN != 0)) && (gal_eph.PRN != 0) && (glo_gnav_eph.PRN != 0))
|
||||
{
|
||||
LOG(WARNING) << "MSM messages for observables from different systems are not defined"; // print two messages?
|
||||
}
|
||||
@ -2857,23 +2857,23 @@ std::string Rtcm::print_MSM_5(const Gps_Ephemeris& gps_eph,
|
||||
bool more_messages)
|
||||
{
|
||||
uint32_t msg_number = 0;
|
||||
if (gps_eph.i_satellite_PRN != 0)
|
||||
if (gps_eph.PRN != 0)
|
||||
{
|
||||
msg_number = 1075;
|
||||
}
|
||||
if (gps_cnav_eph.i_satellite_PRN != 0)
|
||||
if (gps_cnav_eph.PRN != 0)
|
||||
{
|
||||
msg_number = 1075;
|
||||
}
|
||||
if (glo_gnav_eph.i_satellite_PRN != 0)
|
||||
if (glo_gnav_eph.PRN != 0)
|
||||
{
|
||||
msg_number = 1085;
|
||||
}
|
||||
if (gal_eph.i_satellite_PRN != 0)
|
||||
if (gal_eph.PRN != 0)
|
||||
{
|
||||
msg_number = 1095;
|
||||
}
|
||||
if (((gps_eph.i_satellite_PRN != 0) || (gps_cnav_eph.i_satellite_PRN != 0)) && (gal_eph.i_satellite_PRN != 0) && (glo_gnav_eph.i_satellite_PRN != 0))
|
||||
if (((gps_eph.PRN != 0) || (gps_cnav_eph.PRN != 0)) && (gal_eph.PRN != 0) && (glo_gnav_eph.PRN != 0))
|
||||
{
|
||||
LOG(WARNING) << "MSM messages for observables from different systems are not defined"; // print two messages?
|
||||
}
|
||||
@ -3029,23 +3029,23 @@ std::string Rtcm::print_MSM_6(const Gps_Ephemeris& gps_eph,
|
||||
bool more_messages)
|
||||
{
|
||||
uint32_t msg_number = 0;
|
||||
if (gps_eph.i_satellite_PRN != 0)
|
||||
if (gps_eph.PRN != 0)
|
||||
{
|
||||
msg_number = 1076;
|
||||
}
|
||||
if (gps_cnav_eph.i_satellite_PRN != 0)
|
||||
if (gps_cnav_eph.PRN != 0)
|
||||
{
|
||||
msg_number = 1076;
|
||||
}
|
||||
if (glo_gnav_eph.i_satellite_PRN != 0)
|
||||
if (glo_gnav_eph.PRN != 0)
|
||||
{
|
||||
msg_number = 1086;
|
||||
}
|
||||
if (gal_eph.i_satellite_PRN != 0)
|
||||
if (gal_eph.PRN != 0)
|
||||
{
|
||||
msg_number = 1096;
|
||||
}
|
||||
if (((gps_eph.i_satellite_PRN != 0) || (gps_cnav_eph.i_satellite_PRN != 0)) && (gal_eph.i_satellite_PRN != 0) && (glo_gnav_eph.i_satellite_PRN != 0))
|
||||
if (((gps_eph.PRN != 0) || (gps_cnav_eph.PRN != 0)) && (gal_eph.PRN != 0) && (glo_gnav_eph.PRN != 0))
|
||||
{
|
||||
LOG(WARNING) << "MSM messages for observables from different systems are not defined"; // print two messages?
|
||||
}
|
||||
@ -3149,23 +3149,23 @@ std::string Rtcm::print_MSM_7(const Gps_Ephemeris& gps_eph,
|
||||
bool more_messages)
|
||||
{
|
||||
uint32_t msg_number = 0;
|
||||
if (gps_eph.i_satellite_PRN != 0)
|
||||
if (gps_eph.PRN != 0)
|
||||
{
|
||||
msg_number = 1077;
|
||||
}
|
||||
if (gps_cnav_eph.i_satellite_PRN != 0)
|
||||
if (gps_cnav_eph.PRN != 0)
|
||||
{
|
||||
msg_number = 1077;
|
||||
}
|
||||
if (glo_gnav_eph.i_satellite_PRN != 0)
|
||||
if (glo_gnav_eph.PRN != 0)
|
||||
{
|
||||
msg_number = 1087;
|
||||
}
|
||||
if (gal_eph.i_satellite_PRN != 0)
|
||||
if (gal_eph.PRN != 0)
|
||||
{
|
||||
msg_number = 1097;
|
||||
}
|
||||
if (((gps_eph.i_satellite_PRN != 0) || (gps_cnav_eph.i_satellite_PRN != 0)) && (glo_gnav_eph.i_satellite_PRN != 0) && (gal_eph.i_satellite_PRN != 0))
|
||||
if (((gps_eph.PRN != 0) || (gps_cnav_eph.PRN != 0)) && (glo_gnav_eph.PRN != 0) && (gal_eph.PRN != 0))
|
||||
{
|
||||
LOG(WARNING) << "MSM messages for observables from different systems are not defined"; // print two messages?
|
||||
}
|
||||
@ -3391,9 +3391,9 @@ std::map<std::string, int> Rtcm::galileo_signal_map = [] {
|
||||
boost::posix_time::ptime Rtcm::compute_GPS_time(const Gps_Ephemeris& eph, double obs_time) const
|
||||
{
|
||||
const double gps_t = obs_time;
|
||||
const boost::posix_time::time_duration t_duration = boost::posix_time::milliseconds(static_cast<long>((gps_t + 604800 * static_cast<double>(eph.i_GPS_week)) * 1000)); // NOLINT(google-runtime-int)
|
||||
const boost::posix_time::time_duration t_duration = boost::posix_time::milliseconds(static_cast<long>((gps_t + 604800 * static_cast<double>(eph.WN)) * 1000)); // NOLINT(google-runtime-int)
|
||||
|
||||
if (eph.i_GPS_week < 512)
|
||||
if (eph.WN < 512)
|
||||
{
|
||||
boost::posix_time::ptime p_time(boost::gregorian::date(2019, 4, 7), t_duration);
|
||||
return p_time;
|
||||
@ -3407,7 +3407,7 @@ boost::posix_time::ptime Rtcm::compute_GPS_time(const Gps_Ephemeris& eph, double
|
||||
boost::posix_time::ptime Rtcm::compute_GPS_time(const Gps_CNAV_Ephemeris& eph, double obs_time) const
|
||||
{
|
||||
const double gps_t = obs_time;
|
||||
const boost::posix_time::time_duration t_duration = boost::posix_time::milliseconds(static_cast<long>((gps_t + 604800 * static_cast<double>(eph.i_GPS_week)) * 1000)); // NOLINT(google-runtime-int)
|
||||
const boost::posix_time::time_duration t_duration = boost::posix_time::milliseconds(static_cast<long>((gps_t + 604800 * static_cast<double>(eph.WN)) * 1000)); // NOLINT(google-runtime-int)
|
||||
boost::posix_time::ptime p_time(boost::gregorian::date(1999, 8, 22), t_duration);
|
||||
return p_time;
|
||||
}
|
||||
@ -3416,7 +3416,7 @@ boost::posix_time::ptime Rtcm::compute_GPS_time(const Gps_CNAV_Ephemeris& eph, d
|
||||
boost::posix_time::ptime Rtcm::compute_Galileo_time(const Galileo_Ephemeris& eph, double obs_time) const
|
||||
{
|
||||
const double galileo_t = obs_time;
|
||||
const boost::posix_time::time_duration t_duration = boost::posix_time::milliseconds(static_cast<long>((galileo_t + 604800 * static_cast<double>(eph.WN_5)) * 1000)); // NOLINT(google-runtime-int)
|
||||
const boost::posix_time::time_duration t_duration = boost::posix_time::milliseconds(static_cast<long>((galileo_t + 604800 * static_cast<double>(eph.WN)) * 1000)); // NOLINT(google-runtime-int)
|
||||
boost::posix_time::ptime p_time(boost::gregorian::date(1999, 8, 22), t_duration);
|
||||
return p_time;
|
||||
}
|
||||
@ -3778,7 +3778,7 @@ int32_t Rtcm::set_DF009(const Gnss_Synchro& gnss_synchro)
|
||||
|
||||
int32_t Rtcm::set_DF009(const Gps_Ephemeris& gps_eph)
|
||||
{
|
||||
const uint32_t prn_ = gps_eph.i_satellite_PRN;
|
||||
const uint32_t prn_ = gps_eph.PRN;
|
||||
if (prn_ > 32)
|
||||
{
|
||||
LOG(WARNING) << "GPS satellite ID must be between 1 and 32, but PRN " << prn_ << " was found";
|
||||
@ -4201,9 +4201,9 @@ int32_t Rtcm::set_DF050(const Gnss_Synchro& gnss_synchro)
|
||||
int32_t Rtcm::set_DF051(const Gps_Ephemeris& gps_eph, double obs_time)
|
||||
{
|
||||
const double gps_t = obs_time;
|
||||
const boost::posix_time::time_duration t_duration = boost::posix_time::milliseconds(static_cast<int64_t>((gps_t + 604800 * static_cast<double>(gps_eph.i_GPS_week)) * 1000));
|
||||
const boost::posix_time::time_duration t_duration = boost::posix_time::milliseconds(static_cast<int64_t>((gps_t + 604800 * static_cast<double>(gps_eph.WN)) * 1000));
|
||||
std::string now_ptime;
|
||||
if (gps_eph.i_GPS_week < 512)
|
||||
if (gps_eph.WN < 512)
|
||||
{
|
||||
boost::posix_time::ptime p_time(boost::gregorian::date(2019, 4, 7), t_duration);
|
||||
now_ptime = to_iso_string(p_time);
|
||||
@ -4224,9 +4224,9 @@ int32_t Rtcm::set_DF051(const Gps_Ephemeris& gps_eph, double obs_time)
|
||||
int32_t Rtcm::set_DF052(const Gps_Ephemeris& gps_eph, double obs_time)
|
||||
{
|
||||
const double gps_t = obs_time;
|
||||
const boost::posix_time::time_duration t_duration = boost::posix_time::milliseconds(static_cast<int64_t>((gps_t + 604800 * static_cast<double>(gps_eph.i_GPS_week)) * 1000));
|
||||
const boost::posix_time::time_duration t_duration = boost::posix_time::milliseconds(static_cast<int64_t>((gps_t + 604800 * static_cast<double>(gps_eph.WN)) * 1000));
|
||||
std::string now_ptime;
|
||||
if (gps_eph.i_GPS_week < 512)
|
||||
if (gps_eph.WN < 512)
|
||||
{
|
||||
boost::posix_time::ptime p_time(boost::gregorian::date(2019, 4, 7), t_duration);
|
||||
now_ptime = to_iso_string(p_time);
|
||||
@ -4248,7 +4248,7 @@ int32_t Rtcm::set_DF052(const Gps_Ephemeris& gps_eph, double obs_time)
|
||||
|
||||
int32_t Rtcm::set_DF071(const Gps_Ephemeris& gps_eph)
|
||||
{
|
||||
const auto iode = static_cast<uint32_t>(gps_eph.d_IODE_SF2);
|
||||
const auto iode = static_cast<uint32_t>(gps_eph.IODE_SF2);
|
||||
DF071 = std::bitset<8>(iode);
|
||||
return 0;
|
||||
}
|
||||
@ -4256,7 +4256,7 @@ int32_t Rtcm::set_DF071(const Gps_Ephemeris& gps_eph)
|
||||
|
||||
int32_t Rtcm::set_DF076(const Gps_Ephemeris& gps_eph)
|
||||
{
|
||||
const auto week_number = static_cast<uint32_t>(gps_eph.i_GPS_week);
|
||||
const auto week_number = static_cast<uint32_t>(gps_eph.WN);
|
||||
DF076 = std::bitset<10>(week_number);
|
||||
return 0;
|
||||
}
|
||||
@ -4264,7 +4264,7 @@ int32_t Rtcm::set_DF076(const Gps_Ephemeris& gps_eph)
|
||||
|
||||
int32_t Rtcm::set_DF077(const Gps_Ephemeris& gps_eph)
|
||||
{
|
||||
const auto ura = static_cast<uint16_t>(gps_eph.i_SV_accuracy);
|
||||
const auto ura = static_cast<uint16_t>(gps_eph.SV_accuracy);
|
||||
DF077 = std::bitset<4>(ura);
|
||||
return 0;
|
||||
}
|
||||
@ -4272,7 +4272,7 @@ int32_t Rtcm::set_DF077(const Gps_Ephemeris& gps_eph)
|
||||
|
||||
int32_t Rtcm::set_DF078(const Gps_Ephemeris& gps_eph)
|
||||
{
|
||||
const auto code_on_L2 = static_cast<uint16_t>(gps_eph.i_code_on_L2);
|
||||
const auto code_on_L2 = static_cast<uint16_t>(gps_eph.code_on_L2);
|
||||
DF078 = std::bitset<2>(code_on_L2);
|
||||
return 0;
|
||||
}
|
||||
@ -4280,7 +4280,7 @@ int32_t Rtcm::set_DF078(const Gps_Ephemeris& gps_eph)
|
||||
|
||||
int32_t Rtcm::set_DF079(const Gps_Ephemeris& gps_eph)
|
||||
{
|
||||
const auto idot = static_cast<uint32_t>(std::round(gps_eph.d_IDOT / I_DOT_LSB));
|
||||
const auto idot = static_cast<uint32_t>(std::round(gps_eph.idot / I_DOT_LSB));
|
||||
DF079 = std::bitset<14>(idot);
|
||||
return 0;
|
||||
}
|
||||
@ -4288,7 +4288,7 @@ int32_t Rtcm::set_DF079(const Gps_Ephemeris& gps_eph)
|
||||
|
||||
int32_t Rtcm::set_DF080(const Gps_Ephemeris& gps_eph)
|
||||
{
|
||||
const auto iode = static_cast<uint16_t>(gps_eph.d_IODE_SF2);
|
||||
const auto iode = static_cast<uint16_t>(gps_eph.IODE_SF2);
|
||||
DF080 = std::bitset<8>(iode);
|
||||
return 0;
|
||||
}
|
||||
@ -4296,7 +4296,7 @@ int32_t Rtcm::set_DF080(const Gps_Ephemeris& gps_eph)
|
||||
|
||||
int32_t Rtcm::set_DF081(const Gps_Ephemeris& gps_eph)
|
||||
{
|
||||
const auto toc = static_cast<uint32_t>(std::round(gps_eph.d_Toc / T_OC_LSB));
|
||||
const auto toc = static_cast<uint32_t>(std::round(gps_eph.toc / T_OC_LSB));
|
||||
DF081 = std::bitset<16>(toc);
|
||||
return 0;
|
||||
}
|
||||
@ -4304,7 +4304,7 @@ int32_t Rtcm::set_DF081(const Gps_Ephemeris& gps_eph)
|
||||
|
||||
int32_t Rtcm::set_DF082(const Gps_Ephemeris& gps_eph)
|
||||
{
|
||||
const auto af2 = static_cast<int16_t>(std::round(gps_eph.d_A_f2 / A_F2_LSB));
|
||||
const auto af2 = static_cast<int16_t>(std::round(gps_eph.af2 / A_F2_LSB));
|
||||
DF082 = std::bitset<8>(af2);
|
||||
return 0;
|
||||
}
|
||||
@ -4312,7 +4312,7 @@ int32_t Rtcm::set_DF082(const Gps_Ephemeris& gps_eph)
|
||||
|
||||
int32_t Rtcm::set_DF083(const Gps_Ephemeris& gps_eph)
|
||||
{
|
||||
const auto af1 = static_cast<int32_t>(std::round(gps_eph.d_A_f1 / A_F1_LSB));
|
||||
const auto af1 = static_cast<int32_t>(std::round(gps_eph.af1 / A_F1_LSB));
|
||||
DF083 = std::bitset<16>(af1);
|
||||
return 0;
|
||||
}
|
||||
@ -4320,7 +4320,7 @@ int32_t Rtcm::set_DF083(const Gps_Ephemeris& gps_eph)
|
||||
|
||||
int32_t Rtcm::set_DF084(const Gps_Ephemeris& gps_eph)
|
||||
{
|
||||
const auto af0 = static_cast<int64_t>(std::round(gps_eph.d_A_f0 / A_F0_LSB));
|
||||
const auto af0 = static_cast<int64_t>(std::round(gps_eph.af0 / A_F0_LSB));
|
||||
DF084 = std::bitset<22>(af0);
|
||||
return 0;
|
||||
}
|
||||
@ -4328,7 +4328,7 @@ int32_t Rtcm::set_DF084(const Gps_Ephemeris& gps_eph)
|
||||
|
||||
int32_t Rtcm::set_DF085(const Gps_Ephemeris& gps_eph)
|
||||
{
|
||||
const auto iodc = static_cast<uint32_t>(gps_eph.d_IODC);
|
||||
const auto iodc = static_cast<uint32_t>(gps_eph.IODC);
|
||||
DF085 = std::bitset<10>(iodc);
|
||||
return 0;
|
||||
}
|
||||
@ -4336,7 +4336,7 @@ int32_t Rtcm::set_DF085(const Gps_Ephemeris& gps_eph)
|
||||
|
||||
int32_t Rtcm::set_DF086(const Gps_Ephemeris& gps_eph)
|
||||
{
|
||||
const auto crs = static_cast<int32_t>(std::round(gps_eph.d_Crs / C_RS_LSB));
|
||||
const auto crs = static_cast<int32_t>(std::round(gps_eph.Crs / C_RS_LSB));
|
||||
DF086 = std::bitset<16>(crs);
|
||||
return 0;
|
||||
}
|
||||
@ -4344,7 +4344,7 @@ int32_t Rtcm::set_DF086(const Gps_Ephemeris& gps_eph)
|
||||
|
||||
int32_t Rtcm::set_DF087(const Gps_Ephemeris& gps_eph)
|
||||
{
|
||||
const auto delta_n = static_cast<int32_t>(std::round(gps_eph.d_Delta_n / DELTA_N_LSB));
|
||||
const auto delta_n = static_cast<int32_t>(std::round(gps_eph.delta_n / DELTA_N_LSB));
|
||||
DF087 = std::bitset<16>(delta_n);
|
||||
return 0;
|
||||
}
|
||||
@ -4352,7 +4352,7 @@ int32_t Rtcm::set_DF087(const Gps_Ephemeris& gps_eph)
|
||||
|
||||
int32_t Rtcm::set_DF088(const Gps_Ephemeris& gps_eph)
|
||||
{
|
||||
const auto m0 = static_cast<int64_t>(std::round(gps_eph.d_M_0 / M_0_LSB));
|
||||
const auto m0 = static_cast<int64_t>(std::round(gps_eph.M_0 / M_0_LSB));
|
||||
DF088 = std::bitset<32>(m0);
|
||||
return 0;
|
||||
}
|
||||
@ -4360,14 +4360,14 @@ int32_t Rtcm::set_DF088(const Gps_Ephemeris& gps_eph)
|
||||
|
||||
int32_t Rtcm::set_DF089(const Gps_Ephemeris& gps_eph)
|
||||
{
|
||||
const auto cuc = static_cast<int32_t>(std::round(gps_eph.d_Cuc / C_UC_LSB));
|
||||
const auto cuc = static_cast<int32_t>(std::round(gps_eph.Cuc / C_UC_LSB));
|
||||
DF089 = std::bitset<16>(cuc);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t Rtcm::set_DF090(const Gps_Ephemeris& gps_eph)
|
||||
{
|
||||
const auto ecc = static_cast<uint64_t>(std::round(gps_eph.d_e_eccentricity / ECCENTRICITY_LSB));
|
||||
const auto ecc = static_cast<uint64_t>(std::round(gps_eph.ecc / ECCENTRICITY_LSB));
|
||||
DF090 = std::bitset<32>(ecc);
|
||||
return 0;
|
||||
}
|
||||
@ -4375,7 +4375,7 @@ int32_t Rtcm::set_DF090(const Gps_Ephemeris& gps_eph)
|
||||
|
||||
int32_t Rtcm::set_DF091(const Gps_Ephemeris& gps_eph)
|
||||
{
|
||||
const auto cus = static_cast<int32_t>(std::round(gps_eph.d_Cus / C_US_LSB));
|
||||
const auto cus = static_cast<int32_t>(std::round(gps_eph.Cus / C_US_LSB));
|
||||
DF091 = std::bitset<16>(cus);
|
||||
return 0;
|
||||
}
|
||||
@ -4383,7 +4383,7 @@ int32_t Rtcm::set_DF091(const Gps_Ephemeris& gps_eph)
|
||||
|
||||
int32_t Rtcm::set_DF092(const Gps_Ephemeris& gps_eph)
|
||||
{
|
||||
const auto sqr_a = static_cast<uint64_t>(std::round(gps_eph.d_sqrt_A / SQRT_A_LSB));
|
||||
const auto sqr_a = static_cast<uint64_t>(std::round(gps_eph.sqrtA / SQRT_A_LSB));
|
||||
DF092 = std::bitset<32>(sqr_a);
|
||||
return 0;
|
||||
}
|
||||
@ -4391,7 +4391,7 @@ int32_t Rtcm::set_DF092(const Gps_Ephemeris& gps_eph)
|
||||
|
||||
int32_t Rtcm::set_DF093(const Gps_Ephemeris& gps_eph)
|
||||
{
|
||||
const auto toe = static_cast<uint32_t>(std::round(gps_eph.d_Toe / T_OE_LSB));
|
||||
const auto toe = static_cast<uint32_t>(std::round(gps_eph.toe / T_OE_LSB));
|
||||
DF093 = std::bitset<16>(toe);
|
||||
return 0;
|
||||
}
|
||||
@ -4399,7 +4399,7 @@ int32_t Rtcm::set_DF093(const Gps_Ephemeris& gps_eph)
|
||||
|
||||
int32_t Rtcm::set_DF094(const Gps_Ephemeris& gps_eph)
|
||||
{
|
||||
const auto cic = static_cast<int32_t>(std::round(gps_eph.d_Cic / C_IC_LSB));
|
||||
const auto cic = static_cast<int32_t>(std::round(gps_eph.Cic / C_IC_LSB));
|
||||
DF094 = std::bitset<16>(cic);
|
||||
return 0;
|
||||
}
|
||||
@ -4407,7 +4407,7 @@ int32_t Rtcm::set_DF094(const Gps_Ephemeris& gps_eph)
|
||||
|
||||
int32_t Rtcm::set_DF095(const Gps_Ephemeris& gps_eph)
|
||||
{
|
||||
const auto Omega0 = static_cast<int64_t>(std::round(gps_eph.d_OMEGA0 / OMEGA_0_LSB));
|
||||
const auto Omega0 = static_cast<int64_t>(std::round(gps_eph.OMEGA_0 / OMEGA_0_LSB));
|
||||
DF095 = std::bitset<32>(Omega0);
|
||||
return 0;
|
||||
}
|
||||
@ -4415,7 +4415,7 @@ int32_t Rtcm::set_DF095(const Gps_Ephemeris& gps_eph)
|
||||
|
||||
int32_t Rtcm::set_DF096(const Gps_Ephemeris& gps_eph)
|
||||
{
|
||||
const auto cis = static_cast<int32_t>(std::round(gps_eph.d_Cis / C_IS_LSB));
|
||||
const auto cis = static_cast<int32_t>(std::round(gps_eph.Cis / C_IS_LSB));
|
||||
DF096 = std::bitset<16>(cis);
|
||||
return 0;
|
||||
}
|
||||
@ -4423,7 +4423,7 @@ int32_t Rtcm::set_DF096(const Gps_Ephemeris& gps_eph)
|
||||
|
||||
int32_t Rtcm::set_DF097(const Gps_Ephemeris& gps_eph)
|
||||
{
|
||||
const auto i0 = static_cast<int64_t>(std::round(gps_eph.d_i_0 / I_0_LSB));
|
||||
const auto i0 = static_cast<int64_t>(std::round(gps_eph.i_0 / I_0_LSB));
|
||||
DF097 = std::bitset<32>(i0);
|
||||
return 0;
|
||||
}
|
||||
@ -4431,7 +4431,7 @@ int32_t Rtcm::set_DF097(const Gps_Ephemeris& gps_eph)
|
||||
|
||||
int32_t Rtcm::set_DF098(const Gps_Ephemeris& gps_eph)
|
||||
{
|
||||
const auto crc = static_cast<int32_t>(std::round(gps_eph.d_Crc / C_RC_LSB));
|
||||
const auto crc = static_cast<int32_t>(std::round(gps_eph.Crc / C_RC_LSB));
|
||||
DF098 = std::bitset<16>(crc);
|
||||
return 0;
|
||||
}
|
||||
@ -4439,7 +4439,7 @@ int32_t Rtcm::set_DF098(const Gps_Ephemeris& gps_eph)
|
||||
|
||||
int32_t Rtcm::set_DF099(const Gps_Ephemeris& gps_eph)
|
||||
{
|
||||
const auto omega = static_cast<int64_t>(std::round(gps_eph.d_OMEGA / OMEGA_LSB));
|
||||
const auto omega = static_cast<int64_t>(std::round(gps_eph.omega / OMEGA_LSB));
|
||||
DF099 = std::bitset<32>(omega);
|
||||
return 0;
|
||||
}
|
||||
@ -4447,7 +4447,7 @@ int32_t Rtcm::set_DF099(const Gps_Ephemeris& gps_eph)
|
||||
|
||||
int32_t Rtcm::set_DF100(const Gps_Ephemeris& gps_eph)
|
||||
{
|
||||
const auto omegadot = static_cast<int64_t>(std::round(gps_eph.d_OMEGA_DOT / OMEGA_DOT_LSB));
|
||||
const auto omegadot = static_cast<int64_t>(std::round(gps_eph.OMEGAdot / OMEGA_DOT_LSB));
|
||||
DF100 = std::bitset<24>(omegadot);
|
||||
return 0;
|
||||
}
|
||||
@ -4455,7 +4455,7 @@ int32_t Rtcm::set_DF100(const Gps_Ephemeris& gps_eph)
|
||||
|
||||
int32_t Rtcm::set_DF101(const Gps_Ephemeris& gps_eph)
|
||||
{
|
||||
const auto tgd = static_cast<int16_t>(std::round(gps_eph.d_TGD / T_GD_LSB));
|
||||
const auto tgd = static_cast<int16_t>(std::round(gps_eph.TGD / T_GD_LSB));
|
||||
DF101 = std::bitset<8>(tgd);
|
||||
return 0;
|
||||
}
|
||||
@ -4463,7 +4463,7 @@ int32_t Rtcm::set_DF101(const Gps_Ephemeris& gps_eph)
|
||||
|
||||
int32_t Rtcm::set_DF102(const Gps_Ephemeris& gps_eph)
|
||||
{
|
||||
const auto sv_heath = static_cast<uint16_t>(gps_eph.i_SV_health);
|
||||
const auto sv_heath = static_cast<uint16_t>(gps_eph.SV_health);
|
||||
DF102 = std::bitset<6>(sv_heath);
|
||||
return 0;
|
||||
}
|
||||
@ -4471,7 +4471,7 @@ int32_t Rtcm::set_DF102(const Gps_Ephemeris& gps_eph)
|
||||
|
||||
int32_t Rtcm::set_DF103(const Gps_Ephemeris& gps_eph)
|
||||
{
|
||||
DF103 = std::bitset<1>(gps_eph.b_L2_P_data_flag);
|
||||
DF103 = std::bitset<1>(gps_eph.L2_P_data_flag);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -4810,7 +4810,7 @@ int32_t Rtcm::set_DF248(double obs_time)
|
||||
|
||||
int32_t Rtcm::set_DF252(const Galileo_Ephemeris& gal_eph)
|
||||
{
|
||||
const uint32_t prn_ = gal_eph.i_satellite_PRN;
|
||||
const uint32_t prn_ = gal_eph.PRN;
|
||||
if (prn_ > 63)
|
||||
{
|
||||
LOG(WARNING) << "Galileo satellite ID must be between 0 and 63, but PRN " << prn_ << " was found";
|
||||
@ -4822,7 +4822,7 @@ int32_t Rtcm::set_DF252(const Galileo_Ephemeris& gal_eph)
|
||||
|
||||
int32_t Rtcm::set_DF289(const Galileo_Ephemeris& gal_eph)
|
||||
{
|
||||
const auto galileo_week_number = static_cast<uint32_t>(gal_eph.WN_5);
|
||||
const auto galileo_week_number = static_cast<uint32_t>(gal_eph.WN);
|
||||
if (galileo_week_number > 4095)
|
||||
{
|
||||
LOG(WARNING) << "Error decoding Galileo week number (it has a 4096 roll-off, but " << galileo_week_number << " was detected)";
|
||||
@ -4834,7 +4834,7 @@ int32_t Rtcm::set_DF289(const Galileo_Ephemeris& gal_eph)
|
||||
|
||||
int32_t Rtcm::set_DF290(const Galileo_Ephemeris& gal_eph)
|
||||
{
|
||||
const auto iod_nav = static_cast<uint32_t>(gal_eph.IOD_nav_1);
|
||||
const auto iod_nav = static_cast<uint32_t>(gal_eph.IOD_nav);
|
||||
if (iod_nav > 1023)
|
||||
{
|
||||
LOG(WARNING) << "Error decoding Galileo IODnav (it has a max of 1023, but " << iod_nav << " was detected)";
|
||||
@ -4846,7 +4846,7 @@ int32_t Rtcm::set_DF290(const Galileo_Ephemeris& gal_eph)
|
||||
|
||||
int32_t Rtcm::set_DF291(const Galileo_Ephemeris& gal_eph)
|
||||
{
|
||||
const auto SISA = static_cast<uint16_t>(gal_eph.SISA_3);
|
||||
const auto SISA = static_cast<uint16_t>(gal_eph.SISA);
|
||||
// SISA = 0; // SIS Accuracy, data content definition not given in Galileo OS SIS ICD, Issue 1.1, Sept 2010
|
||||
DF291 = std::bitset<8>(SISA);
|
||||
return 0;
|
||||
@ -4855,7 +4855,7 @@ int32_t Rtcm::set_DF291(const Galileo_Ephemeris& gal_eph)
|
||||
|
||||
int32_t Rtcm::set_DF292(const Galileo_Ephemeris& gal_eph)
|
||||
{
|
||||
const auto idot = static_cast<int32_t>(std::round(gal_eph.iDot_2 / FNAV_IDOT_2_LSB));
|
||||
const auto idot = static_cast<int32_t>(std::round(gal_eph.idot / FNAV_IDOT_2_LSB));
|
||||
DF292 = std::bitset<14>(idot);
|
||||
return 0;
|
||||
}
|
||||
@ -4863,7 +4863,7 @@ int32_t Rtcm::set_DF292(const Galileo_Ephemeris& gal_eph)
|
||||
|
||||
int32_t Rtcm::set_DF293(const Galileo_Ephemeris& gal_eph)
|
||||
{
|
||||
const auto toc = static_cast<uint32_t>(gal_eph.t0c_4);
|
||||
const auto toc = static_cast<uint32_t>(gal_eph.toc);
|
||||
if (toc > 604740)
|
||||
{
|
||||
LOG(WARNING) << "Error decoding Galileo ephemeris time (max of 604740, but " << toc << " was detected)";
|
||||
@ -4875,7 +4875,7 @@ int32_t Rtcm::set_DF293(const Galileo_Ephemeris& gal_eph)
|
||||
|
||||
int32_t Rtcm::set_DF294(const Galileo_Ephemeris& gal_eph)
|
||||
{
|
||||
const auto af2 = static_cast<int16_t>(std::round(gal_eph.af2_4 / FNAV_AF2_1_LSB));
|
||||
const auto af2 = static_cast<int16_t>(std::round(gal_eph.af2 / FNAV_AF2_1_LSB));
|
||||
DF294 = std::bitset<6>(af2);
|
||||
return 0;
|
||||
}
|
||||
@ -4883,7 +4883,7 @@ int32_t Rtcm::set_DF294(const Galileo_Ephemeris& gal_eph)
|
||||
|
||||
int32_t Rtcm::set_DF295(const Galileo_Ephemeris& gal_eph)
|
||||
{
|
||||
const auto af1 = static_cast<int64_t>(std::round(gal_eph.af1_4 / FNAV_AF1_1_LSB));
|
||||
const auto af1 = static_cast<int64_t>(std::round(gal_eph.af1 / FNAV_AF1_1_LSB));
|
||||
DF295 = std::bitset<21>(af1);
|
||||
return 0;
|
||||
}
|
||||
@ -4891,7 +4891,7 @@ int32_t Rtcm::set_DF295(const Galileo_Ephemeris& gal_eph)
|
||||
|
||||
int32_t Rtcm::set_DF296(const Galileo_Ephemeris& gal_eph)
|
||||
{
|
||||
const int64_t af0 = static_cast<uint32_t>(std::round(gal_eph.af0_4 / FNAV_AF0_1_LSB));
|
||||
const int64_t af0 = static_cast<uint32_t>(std::round(gal_eph.af0 / FNAV_AF0_1_LSB));
|
||||
DF296 = std::bitset<31>(af0);
|
||||
return 0;
|
||||
}
|
||||
@ -4899,7 +4899,7 @@ int32_t Rtcm::set_DF296(const Galileo_Ephemeris& gal_eph)
|
||||
|
||||
int32_t Rtcm::set_DF297(const Galileo_Ephemeris& gal_eph)
|
||||
{
|
||||
const auto crs = static_cast<int32_t>(std::round(gal_eph.C_rs_3 / FNAV_CRS_3_LSB));
|
||||
const auto crs = static_cast<int32_t>(std::round(gal_eph.Crs / FNAV_CRS_3_LSB));
|
||||
DF297 = std::bitset<16>(crs);
|
||||
return 0;
|
||||
}
|
||||
@ -4907,7 +4907,7 @@ int32_t Rtcm::set_DF297(const Galileo_Ephemeris& gal_eph)
|
||||
|
||||
int32_t Rtcm::set_DF298(const Galileo_Ephemeris& gal_eph)
|
||||
{
|
||||
const auto delta_n = static_cast<int32_t>(std::round(gal_eph.delta_n_3 / FNAV_DELTAN_3_LSB));
|
||||
const auto delta_n = static_cast<int32_t>(std::round(gal_eph.delta_n / FNAV_DELTAN_3_LSB));
|
||||
DF298 = std::bitset<16>(delta_n);
|
||||
return 0;
|
||||
}
|
||||
@ -4915,7 +4915,7 @@ int32_t Rtcm::set_DF298(const Galileo_Ephemeris& gal_eph)
|
||||
|
||||
int32_t Rtcm::set_DF299(const Galileo_Ephemeris& gal_eph)
|
||||
{
|
||||
const auto m0 = static_cast<int64_t>(std::round(gal_eph.M0_1 / FNAV_M0_2_LSB));
|
||||
const auto m0 = static_cast<int64_t>(std::round(gal_eph.M_0 / FNAV_M0_2_LSB));
|
||||
DF299 = std::bitset<32>(m0);
|
||||
return 0;
|
||||
}
|
||||
@ -4923,7 +4923,7 @@ int32_t Rtcm::set_DF299(const Galileo_Ephemeris& gal_eph)
|
||||
|
||||
int32_t Rtcm::set_DF300(const Galileo_Ephemeris& gal_eph)
|
||||
{
|
||||
const int32_t cuc = static_cast<uint32_t>(std::round(gal_eph.C_uc_3 / FNAV_CUC_3_LSB));
|
||||
const int32_t cuc = static_cast<uint32_t>(std::round(gal_eph.Cuc / FNAV_CUC_3_LSB));
|
||||
DF300 = std::bitset<16>(cuc);
|
||||
return 0;
|
||||
}
|
||||
@ -4931,7 +4931,7 @@ int32_t Rtcm::set_DF300(const Galileo_Ephemeris& gal_eph)
|
||||
|
||||
int32_t Rtcm::set_DF301(const Galileo_Ephemeris& gal_eph)
|
||||
{
|
||||
const auto ecc = static_cast<uint64_t>(std::round(gal_eph.e_1 / FNAV_E_2_LSB));
|
||||
const auto ecc = static_cast<uint64_t>(std::round(gal_eph.ecc / FNAV_E_2_LSB));
|
||||
DF301 = std::bitset<32>(ecc);
|
||||
return 0;
|
||||
}
|
||||
@ -4939,7 +4939,7 @@ int32_t Rtcm::set_DF301(const Galileo_Ephemeris& gal_eph)
|
||||
|
||||
int32_t Rtcm::set_DF302(const Galileo_Ephemeris& gal_eph)
|
||||
{
|
||||
const auto cus = static_cast<int32_t>(std::round(gal_eph.C_us_3 / FNAV_CUS_3_LSB));
|
||||
const auto cus = static_cast<int32_t>(std::round(gal_eph.Cus / FNAV_CUS_3_LSB));
|
||||
DF302 = std::bitset<16>(cus);
|
||||
return 0;
|
||||
}
|
||||
@ -4947,7 +4947,7 @@ int32_t Rtcm::set_DF302(const Galileo_Ephemeris& gal_eph)
|
||||
|
||||
int32_t Rtcm::set_DF303(const Galileo_Ephemeris& gal_eph)
|
||||
{
|
||||
const auto sqr_a = static_cast<uint64_t>(std::round(gal_eph.A_1 / FNAV_A12_2_LSB));
|
||||
const auto sqr_a = static_cast<uint64_t>(std::round(gal_eph.sqrtA / FNAV_A12_2_LSB));
|
||||
DF303 = std::bitset<32>(sqr_a);
|
||||
return 0;
|
||||
}
|
||||
@ -4955,7 +4955,7 @@ int32_t Rtcm::set_DF303(const Galileo_Ephemeris& gal_eph)
|
||||
|
||||
int32_t Rtcm::set_DF304(const Galileo_Ephemeris& gal_eph)
|
||||
{
|
||||
const auto toe = static_cast<uint32_t>(std::round(gal_eph.t0e_1 / FNAV_T0E_3_LSB));
|
||||
const auto toe = static_cast<uint32_t>(std::round(gal_eph.toe / FNAV_T0E_3_LSB));
|
||||
DF304 = std::bitset<14>(toe);
|
||||
return 0;
|
||||
}
|
||||
@ -4963,7 +4963,7 @@ int32_t Rtcm::set_DF304(const Galileo_Ephemeris& gal_eph)
|
||||
|
||||
int32_t Rtcm::set_DF305(const Galileo_Ephemeris& gal_eph)
|
||||
{
|
||||
const auto cic = static_cast<int32_t>(std::round(gal_eph.C_ic_4 / FNAV_CIC_4_LSB));
|
||||
const auto cic = static_cast<int32_t>(std::round(gal_eph.Cic / FNAV_CIC_4_LSB));
|
||||
DF305 = std::bitset<16>(cic);
|
||||
return 0;
|
||||
}
|
||||
@ -4971,7 +4971,7 @@ int32_t Rtcm::set_DF305(const Galileo_Ephemeris& gal_eph)
|
||||
|
||||
int32_t Rtcm::set_DF306(const Galileo_Ephemeris& gal_eph)
|
||||
{
|
||||
const auto Omega0 = static_cast<int64_t>(std::round(gal_eph.OMEGA_0_2 / FNAV_OMEGA0_2_LSB));
|
||||
const auto Omega0 = static_cast<int64_t>(std::round(gal_eph.OMEGA_0 / FNAV_OMEGA0_2_LSB));
|
||||
DF306 = std::bitset<32>(Omega0);
|
||||
return 0;
|
||||
}
|
||||
@ -4979,7 +4979,7 @@ int32_t Rtcm::set_DF306(const Galileo_Ephemeris& gal_eph)
|
||||
|
||||
int32_t Rtcm::set_DF307(const Galileo_Ephemeris& gal_eph)
|
||||
{
|
||||
const auto cis = static_cast<int32_t>(std::round(gal_eph.C_is_4 / FNAV_CIS_4_LSB));
|
||||
const auto cis = static_cast<int32_t>(std::round(gal_eph.Cis / FNAV_CIS_4_LSB));
|
||||
DF307 = std::bitset<16>(cis);
|
||||
return 0;
|
||||
}
|
||||
@ -4987,7 +4987,7 @@ int32_t Rtcm::set_DF307(const Galileo_Ephemeris& gal_eph)
|
||||
|
||||
int32_t Rtcm::set_DF308(const Galileo_Ephemeris& gal_eph)
|
||||
{
|
||||
const auto i0 = static_cast<int64_t>(std::round(gal_eph.i_0_2 / FNAV_I0_3_LSB));
|
||||
const auto i0 = static_cast<int64_t>(std::round(gal_eph.i_0 / FNAV_I0_3_LSB));
|
||||
DF308 = std::bitset<32>(i0);
|
||||
return 0;
|
||||
}
|
||||
@ -4995,7 +4995,7 @@ int32_t Rtcm::set_DF308(const Galileo_Ephemeris& gal_eph)
|
||||
|
||||
int32_t Rtcm::set_DF309(const Galileo_Ephemeris& gal_eph)
|
||||
{
|
||||
const int32_t crc = static_cast<uint32_t>(std::round(gal_eph.C_rc_3 / FNAV_CRC_3_LSB));
|
||||
const int32_t crc = static_cast<uint32_t>(std::round(gal_eph.Crc / FNAV_CRC_3_LSB));
|
||||
DF309 = std::bitset<16>(crc);
|
||||
return 0;
|
||||
}
|
||||
@ -5003,7 +5003,7 @@ int32_t Rtcm::set_DF309(const Galileo_Ephemeris& gal_eph)
|
||||
|
||||
int32_t Rtcm::set_DF310(const Galileo_Ephemeris& gal_eph)
|
||||
{
|
||||
const auto omega = static_cast<int32_t>(std::round(gal_eph.omega_2 / FNAV_OMEGA0_2_LSB));
|
||||
const auto omega = static_cast<int32_t>(std::round(gal_eph.omega / FNAV_OMEGA0_2_LSB));
|
||||
DF310 = std::bitset<32>(omega);
|
||||
return 0;
|
||||
}
|
||||
@ -5011,7 +5011,7 @@ int32_t Rtcm::set_DF310(const Galileo_Ephemeris& gal_eph)
|
||||
|
||||
int32_t Rtcm::set_DF311(const Galileo_Ephemeris& gal_eph)
|
||||
{
|
||||
const auto Omegadot = static_cast<int64_t>(std::round(gal_eph.OMEGA_dot_3 / FNAV_OMEGADOT_2_LSB));
|
||||
const auto Omegadot = static_cast<int64_t>(std::round(gal_eph.OMEGAdot / FNAV_OMEGADOT_2_LSB));
|
||||
DF311 = std::bitset<24>(Omegadot);
|
||||
return 0;
|
||||
}
|
||||
@ -5019,7 +5019,7 @@ int32_t Rtcm::set_DF311(const Galileo_Ephemeris& gal_eph)
|
||||
|
||||
int32_t Rtcm::set_DF312(const Galileo_Ephemeris& gal_eph)
|
||||
{
|
||||
const auto bdg_E1_E5a = static_cast<int32_t>(std::round(gal_eph.BGD_E1E5a_5 / FNAV_BGD_1_LSB));
|
||||
const auto bdg_E1_E5a = static_cast<int32_t>(std::round(gal_eph.BGD_E1E5a / FNAV_BGD_1_LSB));
|
||||
DF312 = std::bitset<10>(bdg_E1_E5a);
|
||||
return 0;
|
||||
}
|
||||
@ -5027,7 +5027,7 @@ int32_t Rtcm::set_DF312(const Galileo_Ephemeris& gal_eph)
|
||||
|
||||
int32_t Rtcm::set_DF313(const Galileo_Ephemeris& gal_eph)
|
||||
{
|
||||
const auto bdg_E5b_E1 = static_cast<uint32_t>(std::round(gal_eph.BGD_E1E5b_5));
|
||||
const auto bdg_E5b_E1 = static_cast<uint32_t>(std::round(gal_eph.BGD_E1E5b));
|
||||
// bdg_E5b_E1 = 0; // reserved
|
||||
DF313 = std::bitset<10>(bdg_E5b_E1);
|
||||
return 0;
|
||||
|
@ -457,7 +457,7 @@ bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
|
||||
obsd_t newobs{};
|
||||
obs_data[valid_obs + glo_valid_obs] = insert_obs_to_rtklib(newobs,
|
||||
gnss_observables_iter->second,
|
||||
galileo_ephemeris_iter->second.WN_5,
|
||||
galileo_ephemeris_iter->second.WN,
|
||||
0);
|
||||
valid_obs++;
|
||||
}
|
||||
@ -481,7 +481,7 @@ bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
|
||||
{
|
||||
obs_data[i + glo_valid_obs] = insert_obs_to_rtklib(obs_data[i + glo_valid_obs],
|
||||
gnss_observables_iter->second,
|
||||
galileo_ephemeris_iter->second.WN_5,
|
||||
galileo_ephemeris_iter->second.WN,
|
||||
2); // Band 3 (L5/E5)
|
||||
found_E1_obs = true;
|
||||
break;
|
||||
@ -499,7 +499,7 @@ bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
|
||||
{}, {0.0, 0.0, 0.0}, {}};
|
||||
obs_data[valid_obs + glo_valid_obs] = insert_obs_to_rtklib(newobs,
|
||||
gnss_observables_iter->second,
|
||||
galileo_ephemeris_iter->second.WN_5,
|
||||
galileo_ephemeris_iter->second.WN,
|
||||
2); // Band 3 (L5/E5)
|
||||
valid_obs++;
|
||||
}
|
||||
@ -527,7 +527,7 @@ bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
|
||||
obsd_t newobs{};
|
||||
obs_data[valid_obs + glo_valid_obs] = insert_obs_to_rtklib(newobs,
|
||||
gnss_observables_iter->second,
|
||||
gps_ephemeris_iter->second.i_GPS_week,
|
||||
gps_ephemeris_iter->second.WN,
|
||||
0,
|
||||
this->is_pre_2009());
|
||||
valid_obs++;
|
||||
@ -576,7 +576,7 @@ bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
|
||||
{}, {0.0, 0.0, 0.0}, {}};
|
||||
obs_data[valid_obs + glo_valid_obs] = insert_obs_to_rtklib(newobs,
|
||||
gnss_observables_iter->second,
|
||||
gps_cnav_ephemeris_iter->second.i_GPS_week,
|
||||
gps_cnav_ephemeris_iter->second.WN,
|
||||
1); // Band 2 (L2)
|
||||
valid_obs++;
|
||||
}
|
||||
@ -605,7 +605,7 @@ bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
|
||||
eph_data[i] = eph_to_rtklib(gps_cnav_ephemeris_iter->second);
|
||||
obs_data[i + glo_valid_obs] = insert_obs_to_rtklib(obs_data[i],
|
||||
gnss_observables_iter->second,
|
||||
gps_cnav_ephemeris_iter->second.i_GPS_week,
|
||||
gps_cnav_ephemeris_iter->second.WN,
|
||||
2); // Band 3 (L5)
|
||||
break;
|
||||
}
|
||||
@ -623,7 +623,7 @@ bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
|
||||
{}, {0.0, 0.0, 0.0}, {}};
|
||||
obs_data[valid_obs + glo_valid_obs] = insert_obs_to_rtklib(newobs,
|
||||
gnss_observables_iter->second,
|
||||
gps_cnav_ephemeris_iter->second.i_GPS_week,
|
||||
gps_cnav_ephemeris_iter->second.WN,
|
||||
2); // Band 3 (L5)
|
||||
valid_obs++;
|
||||
}
|
||||
@ -717,7 +717,7 @@ bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
|
||||
obsd_t newobs{};
|
||||
obs_data[valid_obs + glo_valid_obs] = insert_obs_to_rtklib(newobs,
|
||||
gnss_observables_iter->second,
|
||||
beidou_ephemeris_iter->second.i_BEIDOU_week + BEIDOU_DNAV_BDT2GPST_WEEK_NUM_OFFSET,
|
||||
beidou_ephemeris_iter->second.WN + BEIDOU_DNAV_BDT2GPST_WEEK_NUM_OFFSET,
|
||||
0);
|
||||
valid_obs++;
|
||||
}
|
||||
@ -739,7 +739,7 @@ bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
|
||||
{
|
||||
obs_data[i + glo_valid_obs] = insert_obs_to_rtklib(obs_data[i + glo_valid_obs],
|
||||
gnss_observables_iter->second,
|
||||
beidou_ephemeris_iter->second.i_BEIDOU_week + BEIDOU_DNAV_BDT2GPST_WEEK_NUM_OFFSET,
|
||||
beidou_ephemeris_iter->second.WN + BEIDOU_DNAV_BDT2GPST_WEEK_NUM_OFFSET,
|
||||
2); // Band 3 (L2/G2/B3)
|
||||
found_B1I_obs = true;
|
||||
break;
|
||||
@ -757,7 +757,7 @@ bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
|
||||
{}, {0.0, 0.0, 0.0}, {}};
|
||||
obs_data[valid_obs + glo_valid_obs] = insert_obs_to_rtklib(newobs,
|
||||
gnss_observables_iter->second,
|
||||
beidou_ephemeris_iter->second.i_BEIDOU_week + BEIDOU_DNAV_BDT2GPST_WEEK_NUM_OFFSET,
|
||||
beidou_ephemeris_iter->second.WN + BEIDOU_DNAV_BDT2GPST_WEEK_NUM_OFFSET,
|
||||
2); // Band 2 (L2/G2)
|
||||
valid_obs++;
|
||||
}
|
||||
@ -791,59 +791,59 @@ bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
|
||||
nav_data.ng = glo_valid_obs;
|
||||
if (gps_iono.valid)
|
||||
{
|
||||
nav_data.ion_gps[0] = gps_iono.d_alpha0;
|
||||
nav_data.ion_gps[1] = gps_iono.d_alpha1;
|
||||
nav_data.ion_gps[2] = gps_iono.d_alpha2;
|
||||
nav_data.ion_gps[3] = gps_iono.d_alpha3;
|
||||
nav_data.ion_gps[4] = gps_iono.d_beta0;
|
||||
nav_data.ion_gps[5] = gps_iono.d_beta1;
|
||||
nav_data.ion_gps[6] = gps_iono.d_beta2;
|
||||
nav_data.ion_gps[7] = gps_iono.d_beta3;
|
||||
nav_data.ion_gps[0] = gps_iono.alpha0;
|
||||
nav_data.ion_gps[1] = gps_iono.alpha1;
|
||||
nav_data.ion_gps[2] = gps_iono.alpha2;
|
||||
nav_data.ion_gps[3] = gps_iono.alpha3;
|
||||
nav_data.ion_gps[4] = gps_iono.beta0;
|
||||
nav_data.ion_gps[5] = gps_iono.beta1;
|
||||
nav_data.ion_gps[6] = gps_iono.beta2;
|
||||
nav_data.ion_gps[7] = gps_iono.beta3;
|
||||
}
|
||||
if (!(gps_iono.valid) and gps_cnav_iono.valid)
|
||||
{
|
||||
nav_data.ion_gps[0] = gps_cnav_iono.d_alpha0;
|
||||
nav_data.ion_gps[1] = gps_cnav_iono.d_alpha1;
|
||||
nav_data.ion_gps[2] = gps_cnav_iono.d_alpha2;
|
||||
nav_data.ion_gps[3] = gps_cnav_iono.d_alpha3;
|
||||
nav_data.ion_gps[4] = gps_cnav_iono.d_beta0;
|
||||
nav_data.ion_gps[5] = gps_cnav_iono.d_beta1;
|
||||
nav_data.ion_gps[6] = gps_cnav_iono.d_beta2;
|
||||
nav_data.ion_gps[7] = gps_cnav_iono.d_beta3;
|
||||
nav_data.ion_gps[0] = gps_cnav_iono.alpha0;
|
||||
nav_data.ion_gps[1] = gps_cnav_iono.alpha1;
|
||||
nav_data.ion_gps[2] = gps_cnav_iono.alpha2;
|
||||
nav_data.ion_gps[3] = gps_cnav_iono.alpha3;
|
||||
nav_data.ion_gps[4] = gps_cnav_iono.beta0;
|
||||
nav_data.ion_gps[5] = gps_cnav_iono.beta1;
|
||||
nav_data.ion_gps[6] = gps_cnav_iono.beta2;
|
||||
nav_data.ion_gps[7] = gps_cnav_iono.beta3;
|
||||
}
|
||||
if (galileo_iono.ai0_5 != 0.0)
|
||||
if (galileo_iono.ai0 != 0.0)
|
||||
{
|
||||
nav_data.ion_gal[0] = galileo_iono.ai0_5;
|
||||
nav_data.ion_gal[1] = galileo_iono.ai1_5;
|
||||
nav_data.ion_gal[2] = galileo_iono.ai2_5;
|
||||
nav_data.ion_gal[0] = galileo_iono.ai0;
|
||||
nav_data.ion_gal[1] = galileo_iono.ai1;
|
||||
nav_data.ion_gal[2] = galileo_iono.ai2;
|
||||
nav_data.ion_gal[3] = 0.0;
|
||||
}
|
||||
if (beidou_dnav_iono.valid)
|
||||
{
|
||||
nav_data.ion_cmp[0] = beidou_dnav_iono.d_alpha0;
|
||||
nav_data.ion_cmp[1] = beidou_dnav_iono.d_alpha1;
|
||||
nav_data.ion_cmp[2] = beidou_dnav_iono.d_alpha2;
|
||||
nav_data.ion_cmp[3] = beidou_dnav_iono.d_alpha3;
|
||||
nav_data.ion_cmp[4] = beidou_dnav_iono.d_beta0;
|
||||
nav_data.ion_cmp[5] = beidou_dnav_iono.d_beta0;
|
||||
nav_data.ion_cmp[6] = beidou_dnav_iono.d_beta0;
|
||||
nav_data.ion_cmp[7] = beidou_dnav_iono.d_beta3;
|
||||
nav_data.ion_cmp[0] = beidou_dnav_iono.alpha0;
|
||||
nav_data.ion_cmp[1] = beidou_dnav_iono.alpha1;
|
||||
nav_data.ion_cmp[2] = beidou_dnav_iono.alpha2;
|
||||
nav_data.ion_cmp[3] = beidou_dnav_iono.alpha3;
|
||||
nav_data.ion_cmp[4] = beidou_dnav_iono.beta0;
|
||||
nav_data.ion_cmp[5] = beidou_dnav_iono.beta0;
|
||||
nav_data.ion_cmp[6] = beidou_dnav_iono.beta0;
|
||||
nav_data.ion_cmp[7] = beidou_dnav_iono.beta3;
|
||||
}
|
||||
if (gps_utc_model.valid)
|
||||
{
|
||||
nav_data.utc_gps[0] = gps_utc_model.d_A0;
|
||||
nav_data.utc_gps[1] = gps_utc_model.d_A1;
|
||||
nav_data.utc_gps[2] = gps_utc_model.d_t_OT;
|
||||
nav_data.utc_gps[3] = gps_utc_model.i_WN_T;
|
||||
nav_data.leaps = gps_utc_model.d_DeltaT_LS;
|
||||
nav_data.utc_gps[0] = gps_utc_model.A0;
|
||||
nav_data.utc_gps[1] = gps_utc_model.A1;
|
||||
nav_data.utc_gps[2] = gps_utc_model.tot;
|
||||
nav_data.utc_gps[3] = gps_utc_model.WN_T;
|
||||
nav_data.leaps = gps_utc_model.DeltaT_LS;
|
||||
}
|
||||
if (!(gps_utc_model.valid) and gps_cnav_utc_model.valid)
|
||||
{
|
||||
nav_data.utc_gps[0] = gps_cnav_utc_model.d_A0;
|
||||
nav_data.utc_gps[1] = gps_cnav_utc_model.d_A1;
|
||||
nav_data.utc_gps[2] = gps_cnav_utc_model.d_t_OT;
|
||||
nav_data.utc_gps[3] = gps_cnav_utc_model.i_WN_T;
|
||||
nav_data.leaps = gps_cnav_utc_model.d_DeltaT_LS;
|
||||
nav_data.utc_gps[0] = gps_cnav_utc_model.A0;
|
||||
nav_data.utc_gps[1] = gps_cnav_utc_model.A1;
|
||||
nav_data.utc_gps[2] = gps_cnav_utc_model.tot;
|
||||
nav_data.utc_gps[3] = gps_cnav_utc_model.WN_T;
|
||||
nav_data.leaps = gps_cnav_utc_model.DeltaT_LS;
|
||||
}
|
||||
if (glonass_gnav_utc_model.valid)
|
||||
{
|
||||
@ -852,21 +852,21 @@ bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
|
||||
nav_data.utc_glo[2] = 0.0; // ??
|
||||
nav_data.utc_glo[3] = 0.0; // ??
|
||||
}
|
||||
if (galileo_utc_model.A0_6 != 0.0)
|
||||
if (galileo_utc_model.A0 != 0.0)
|
||||
{
|
||||
nav_data.utc_gal[0] = galileo_utc_model.A0_6;
|
||||
nav_data.utc_gal[1] = galileo_utc_model.A1_6;
|
||||
nav_data.utc_gal[2] = galileo_utc_model.t0t_6;
|
||||
nav_data.utc_gal[3] = galileo_utc_model.WNot_6;
|
||||
nav_data.leaps = galileo_utc_model.Delta_tLS_6;
|
||||
nav_data.utc_gal[0] = galileo_utc_model.A0;
|
||||
nav_data.utc_gal[1] = galileo_utc_model.A1;
|
||||
nav_data.utc_gal[2] = galileo_utc_model.tot;
|
||||
nav_data.utc_gal[3] = galileo_utc_model.WNot;
|
||||
nav_data.leaps = galileo_utc_model.Delta_tLS;
|
||||
}
|
||||
if (beidou_dnav_utc_model.valid)
|
||||
{
|
||||
nav_data.utc_cmp[0] = beidou_dnav_utc_model.d_A0_UTC;
|
||||
nav_data.utc_cmp[1] = beidou_dnav_utc_model.d_A1_UTC;
|
||||
nav_data.utc_cmp[0] = beidou_dnav_utc_model.A0_UTC;
|
||||
nav_data.utc_cmp[1] = beidou_dnav_utc_model.A1_UTC;
|
||||
nav_data.utc_cmp[2] = 0.0; // ??
|
||||
nav_data.utc_cmp[3] = 0.0; // ??
|
||||
nav_data.leaps = beidou_dnav_utc_model.i_DeltaT_LS;
|
||||
nav_data.leaps = beidou_dnav_utc_model.DeltaT_LS;
|
||||
}
|
||||
|
||||
/* update carrier wave length using native function call in RTKlib */
|
||||
|
@ -80,50 +80,50 @@ public:
|
||||
|
||||
std::string data;
|
||||
|
||||
monitor_.set_i_satellite_prn(monitor->i_satellite_PRN);
|
||||
monitor_.set_i_satellite_prn(monitor->PRN);
|
||||
monitor_.set_iod_ephemeris(monitor->IOD_ephemeris);
|
||||
monitor_.set_iod_nav_1(monitor->IOD_nav_1);
|
||||
monitor_.set_m0_1(monitor->M0_1); //!< Mean anomaly at reference time [semi-circles]
|
||||
monitor_.set_delta_n_3(monitor->delta_n_3); //!< Mean motion difference from computed value [semi-circles/sec]
|
||||
monitor_.set_e_1(monitor->e_1); //!< Eccentricity
|
||||
monitor_.set_a_1(monitor->A_1); //!< Square root of the semi-major axis [meters^1/2]
|
||||
monitor_.set_omega_0_2(monitor->OMEGA_0_2); //!< Longitude of ascending node of orbital plane at weekly epoch [semi-circles]
|
||||
monitor_.set_i_0_2(monitor->i_0_2); //!< Inclination angle at reference time [semi-circles]
|
||||
monitor_.set_omega_2(monitor->omega_2); //!< Argument of perigee [semi-circles]
|
||||
monitor_.set_omega_dot_3(monitor->OMEGA_dot_3); //!< Rate of right ascension [semi-circles/sec]
|
||||
monitor_.set_idot_2(monitor->iDot_2); //!< Rate of inclination angle [semi-circles/sec]
|
||||
monitor_.set_c_uc_3(monitor->C_uc_3); //!< Amplitude of the cosine harmonic correction term to the argument of latitude [radians]
|
||||
monitor_.set_c_us_3(monitor->C_us_3); //!< Amplitude of the sine harmonic correction term to the argument of latitude [radians]
|
||||
monitor_.set_c_rc_3(monitor->C_rc_3); //!< Amplitude of the cosine harmonic correction term to the orbit radius [meters]
|
||||
monitor_.set_c_rs_3(monitor->C_rs_3); //!< Amplitude of the sine harmonic correction term to the orbit radius [meters]
|
||||
monitor_.set_c_ic_4(monitor->C_ic_4); //!< Amplitude of the cosine harmonic correction term to the angle of inclination [radians]
|
||||
monitor_.set_c_is_4(monitor->C_is_4); //!< Amplitude of the sine harmonic correction term to the angle of inclination [radians]
|
||||
monitor_.set_d_toe(monitor->t0e_1); // Ephemeris reference time
|
||||
monitor_.set_iod_nav_1(monitor->IOD_nav);
|
||||
monitor_.set_m0_1(monitor->M_0); //!< Mean anomaly at reference time [semi-circles]
|
||||
monitor_.set_delta_n_3(monitor->delta_n); //!< Mean motion difference from computed value [semi-circles/sec]
|
||||
monitor_.set_e_1(monitor->ecc); //!< Eccentricity
|
||||
monitor_.set_a_1(monitor->sqrtA); //!< Square root of the semi-major axis [meters^1/2]
|
||||
monitor_.set_omega_0_2(monitor->OMEGA_0); //!< Longitude of ascending node of orbital plane at weekly epoch [semi-circles]
|
||||
monitor_.set_i_0_2(monitor->i_0); //!< Inclination angle at reference time [semi-circles]
|
||||
monitor_.set_omega_2(monitor->omega); //!< Argument of perigee [semi-circles]
|
||||
monitor_.set_omega_dot_3(monitor->OMEGAdot); //!< Rate of right ascension [semi-circles/sec]
|
||||
monitor_.set_idot_2(monitor->idot); //!< Rate of inclination angle [semi-circles/sec]
|
||||
monitor_.set_c_uc_3(monitor->Cuc); //!< Amplitude of the cosine harmonic correction term to the argument of latitude [radians]
|
||||
monitor_.set_c_us_3(monitor->Cus); //!< Amplitude of the sine harmonic correction term to the argument of latitude [radians]
|
||||
monitor_.set_c_rc_3(monitor->Crc); //!< Amplitude of the cosine harmonic correction term to the orbit radius [meters]
|
||||
monitor_.set_c_rs_3(monitor->Crs); //!< Amplitude of the sine harmonic correction term to the orbit radius [meters]
|
||||
monitor_.set_c_ic_4(monitor->Cic); //!< Amplitude of the cosine harmonic correction term to the angle of inclination [radians]
|
||||
monitor_.set_c_is_4(monitor->Cis); //!< Amplitude of the sine harmonic correction term to the angle of inclination [radians]
|
||||
monitor_.set_d_toe(monitor->toe); //!< Ephemeris reference time
|
||||
|
||||
/*Clock correction parameters*/
|
||||
monitor_.set_d_toc(monitor->t0c_4); // Clock correction data reference Time of Week
|
||||
monitor_.set_af0_4(monitor->af0_4); //!< SV clock bias correction coefficient [s]
|
||||
monitor_.set_af1_4(monitor->af1_4); //!< SV clock drift correction coefficient [s/s]
|
||||
monitor_.set_af2_4(monitor->af2_4); //!< SV clock drift rate correction coefficient [s/s^2]
|
||||
monitor_.set_d_toc(monitor->toc); //!< Clock correction data reference Time of Week
|
||||
monitor_.set_af0_4(monitor->af0); //!< SV clock bias correction coefficient [s]
|
||||
monitor_.set_af1_4(monitor->af1); //!< SV clock drift correction coefficient [s/s]
|
||||
monitor_.set_af2_4(monitor->af2); //!< SV clock drift rate correction coefficient [s/s^2]
|
||||
|
||||
/*GST*/
|
||||
// Not belong to ephemeris set (page 1 to 4)
|
||||
monitor_.set_wn_5(monitor->WN_5); //!< Week number
|
||||
monitor_.set_tow_5(monitor->TOW_5); //!< Time of Week
|
||||
monitor_.set_galileo_satclkdrift(monitor->Galileo_satClkDrift);
|
||||
monitor_.set_galileo_dtr(monitor->Galileo_dtr); //!< relativistic clock correction term
|
||||
monitor_.set_wn_5(monitor->WN); //!< Week number
|
||||
monitor_.set_tow_5(monitor->tow); //!< Time of Week
|
||||
monitor_.set_galileo_satclkdrift(monitor->satClkDrift);
|
||||
monitor_.set_galileo_dtr(monitor->dtr); //!< relativistic clock correction term
|
||||
|
||||
// SV status
|
||||
monitor_.set_sisa_3(monitor->SISA_3);
|
||||
monitor_.set_e5a_hs(monitor->E5a_HS); //!< E5a Signal Health Status
|
||||
monitor_.set_e5b_hs_5(monitor->E5b_HS_5); //!< E5b Signal Health Status
|
||||
monitor_.set_e1b_hs_5(monitor->E1B_HS_5); //!< E1B Signal Health Status
|
||||
monitor_.set_e5a_dvs(monitor->E5a_DVS); //!< E5a Data Validity Status
|
||||
monitor_.set_e5b_dvs_5(monitor->E5b_DVS_5); //!< E5b Data Validity Status
|
||||
monitor_.set_e1b_dvs_5(monitor->E1B_DVS_5); //!< E1B Data Validity Status
|
||||
monitor_.set_sisa_3(monitor->SISA);
|
||||
monitor_.set_e5a_hs(monitor->E5a_HS); //!< E5a Signal Health Status
|
||||
monitor_.set_e5b_hs_5(monitor->E5b_HS); //!< E5b Signal Health Status
|
||||
monitor_.set_e1b_hs_5(monitor->E1B_HS); //!< E1B Signal Health Status
|
||||
monitor_.set_e5a_dvs(monitor->E5a_DVS); //!< E5a Data Validity Status
|
||||
monitor_.set_e5b_dvs_5(monitor->E5b_DVS); //!< E5b Data Validity Status
|
||||
monitor_.set_e1b_dvs_5(monitor->E1B_DVS); //!< E1B Data Validity Status
|
||||
|
||||
monitor_.set_bgd_e1e5a_5(monitor->BGD_E1E5a_5); //!< E1-E5a Broadcast Group Delay [s]
|
||||
monitor_.set_bgd_e1e5b_5(monitor->BGD_E1E5b_5); //!< E1-E5b Broadcast Group Delay [s]
|
||||
monitor_.set_bgd_e1e5a_5(monitor->BGD_E1E5a); //!< E1-E5a Broadcast Group Delay [s]
|
||||
monitor_.set_bgd_e1e5b_5(monitor->BGD_E1E5b); //!< E1-E5b Broadcast Group Delay [s]
|
||||
|
||||
monitor_.SerializeToString(&data);
|
||||
return data;
|
||||
@ -133,51 +133,51 @@ public:
|
||||
{
|
||||
Galileo_Ephemeris monitor;
|
||||
|
||||
monitor.i_satellite_PRN = mon.i_satellite_prn();
|
||||
monitor.PRN = mon.i_satellite_prn();
|
||||
|
||||
monitor.IOD_ephemeris = mon.iod_ephemeris();
|
||||
monitor.IOD_nav_1 = mon.iod_nav_1();
|
||||
monitor.M0_1 = mon.m0_1(); //!< Mean anomaly at reference time [semi-circles]
|
||||
monitor.delta_n_3 = mon.delta_n_3(); //!< Mean motion difference from computed value [semi-circles/sec]
|
||||
monitor.e_1 = mon.e_1(); //!< Eccentricity
|
||||
monitor.A_1 = mon.a_1(); //!< Square root of the semi-major axis [meters^1/2]
|
||||
monitor.OMEGA_0_2 = mon.omega_0_2(); //!< Longitude of ascending node of orbital plane at weekly epoch [semi-circles]
|
||||
monitor.i_0_2 = mon.i_0_2(); //!< Inclination angle at reference time [semi-circles]
|
||||
monitor.omega_2 = mon.omega_2(); //!< Argument of perigee [semi-circles]
|
||||
monitor.OMEGA_dot_3 = mon.omega_dot_3(); //!< Rate of right ascension [semi-circles/sec]
|
||||
monitor.iDot_2 = mon.idot_2(); //!< Rate of inclination angle [semi-circles/sec]
|
||||
monitor.C_uc_3 = mon.c_uc_3(); //!< Amplitude of the cosine harmonic correction term to the argument of latitude [radians]
|
||||
monitor.C_us_3 = mon.c_us_3(); //!< Amplitude of the sine harmonic correction term to the argument of latitude [radians]
|
||||
monitor.C_rc_3 = mon.c_rc_3(); //!< Amplitude of the cosine harmonic correction term to the orbit radius [meters]
|
||||
monitor.C_rs_3 = mon.c_rs_3(); //!< Amplitude of the sine harmonic correction term to the orbit radius [meters]
|
||||
monitor.C_ic_4 = mon.c_ic_4(); //!< Amplitude of the cosine harmonic correction term to the angle of inclination [radians]
|
||||
monitor.C_is_4 = mon.c_is_4(); //!< Amplitude of the sine harmonic correction term to the angle of inclination [radians]
|
||||
monitor.t0e_1 = mon.d_toe(); // Ephemeris reference time
|
||||
monitor.IOD_nav = mon.iod_nav_1();
|
||||
monitor.M_0 = mon.m0_1(); //!< Mean anomaly at reference time [semi-circles]
|
||||
monitor.delta_n = mon.delta_n_3(); //!< Mean motion difference from computed value [semi-circles/sec]
|
||||
monitor.ecc = mon.e_1(); //!< Eccentricity
|
||||
monitor.sqrtA = mon.a_1(); //!< Square root of the semi-major axis [meters^1/2]
|
||||
monitor.OMEGA_0 = mon.omega_0_2(); //!< Longitude of ascending node of orbital plane at weekly epoch [semi-circles]
|
||||
monitor.i_0 = mon.i_0_2(); //!< Inclination angle at reference time [semi-circles]
|
||||
monitor.omega = mon.omega_2(); //!< Argument of perigee [semi-circles]
|
||||
monitor.OMEGAdot = mon.omega_dot_3(); //!< Rate of right ascension [semi-circles/sec]
|
||||
monitor.idot = mon.idot_2(); //!< Rate of inclination angle [semi-circles/sec]
|
||||
monitor.Cuc = mon.c_uc_3(); //!< Amplitude of the cosine harmonic correction term to the argument of latitude [radians]
|
||||
monitor.Cus = mon.c_us_3(); //!< Amplitude of the sine harmonic correction term to the argument of latitude [radians]
|
||||
monitor.Crc = mon.c_rc_3(); //!< Amplitude of the cosine harmonic correction term to the orbit radius [meters]
|
||||
monitor.Crs = mon.c_rs_3(); //!< Amplitude of the sine harmonic correction term to the orbit radius [meters]
|
||||
monitor.Cic = mon.c_ic_4(); //!< Amplitude of the cosine harmonic correction term to the angle of inclination [radians]
|
||||
monitor.Cis = mon.c_is_4(); //!< Amplitude of the sine harmonic correction term to the angle of inclination [radians]
|
||||
monitor.toe = mon.d_toe(); // Ephemeris reference time
|
||||
|
||||
/*Clock correction parameters*/
|
||||
monitor.t0c_4 = mon.d_toc(); // Clock correction data reference Time of Week
|
||||
monitor.af0_4 = mon.af0_4(); //!< SV clock bias correction coefficient [s]
|
||||
monitor.af1_4 = mon.af1_4(); //!< SV clock drift correction coefficient [s/s]
|
||||
monitor.af2_4 = mon.af2_4(); //!< SV clock drift rate correction coefficient [s/s^2]
|
||||
monitor.toc = mon.d_toc(); // Clock correction data reference Time of Week
|
||||
monitor.af0 = mon.af0_4(); //!< SV clock bias correction coefficient [s]
|
||||
monitor.af1 = mon.af1_4(); //!< SV clock drift correction coefficient [s/s]
|
||||
monitor.af2 = mon.af2_4(); //!< SV clock drift rate correction coefficient [s/s^2]
|
||||
|
||||
/*GST*/
|
||||
// Not belong to ephemeris set (page 1 to 4)
|
||||
monitor.WN_5 = mon.wn_5(); //!< Week number
|
||||
monitor.TOW_5 = mon.tow_5(); //!< Time of Week
|
||||
monitor.Galileo_satClkDrift = mon.galileo_satclkdrift();
|
||||
monitor.Galileo_dtr = mon.galileo_dtr(); //!< relativistic clock correction term
|
||||
monitor.WN = mon.wn_5(); //!< Week number
|
||||
monitor.tow = mon.tow_5(); //!< Time of Week
|
||||
monitor.satClkDrift = mon.galileo_satclkdrift();
|
||||
monitor.dtr = mon.galileo_dtr(); //!< relativistic clock correction term
|
||||
|
||||
// SV status
|
||||
monitor.SISA_3 = mon.sisa_3();
|
||||
monitor.E5a_HS = mon.e5a_hs(); //!< E5a Signal Health Status
|
||||
monitor.E5b_HS_5 = mon.e5b_hs_5(); //!< E5b Signal Health Status
|
||||
monitor.E1B_HS_5 = mon.e1b_hs_5(); //!< E1B Signal Health Status
|
||||
monitor.E5a_DVS = mon.e5a_dvs(); //!< E5a Data Validity Status
|
||||
monitor.E5b_DVS_5 = mon.e5b_dvs_5(); //!< E5b Data Validity Status
|
||||
monitor.E1B_DVS_5 = mon.e1b_dvs_5(); //!< E1B Data Validity Status
|
||||
monitor.SISA = mon.sisa_3();
|
||||
monitor.E5a_HS = mon.e5a_hs(); //!< E5a Signal Health Status
|
||||
monitor.E5b_HS = mon.e5b_hs_5(); //!< E5b Signal Health Status
|
||||
monitor.E1B_HS = mon.e1b_hs_5(); //!< E1B Signal Health Status
|
||||
monitor.E5a_DVS = mon.e5a_dvs(); //!< E5a Data Validity Status
|
||||
monitor.E5b_DVS = mon.e5b_dvs_5(); //!< E5b Data Validity Status
|
||||
monitor.E1B_DVS = mon.e1b_dvs_5(); //!< E1B Data Validity Status
|
||||
|
||||
monitor.BGD_E1E5a_5 = mon.bgd_e1e5a_5(); //!< E1-E5a Broadcast Group Delay [s]
|
||||
monitor.BGD_E1E5b_5 = mon.bgd_e1e5b_5(); //!< E1-E5b Broadcast Group Delay [s]
|
||||
monitor.BGD_E1E5a = mon.bgd_e1e5a_5(); //!< E1-E5a Broadcast Group Delay [s]
|
||||
monitor.BGD_E1E5b = mon.bgd_e1e5b_5(); //!< E1-E5b Broadcast Group Delay [s]
|
||||
|
||||
return monitor;
|
||||
}
|
||||
|
@ -78,47 +78,47 @@ public:
|
||||
{
|
||||
monitor_.Clear();
|
||||
std::string data;
|
||||
monitor_.set_i_satellite_prn(monitor->i_satellite_PRN); // SV PRN NUMBER
|
||||
monitor_.set_d_tow(monitor->d_TOW); //!< time of gps week of the ephemeris set (taken from subframes tow) [s]
|
||||
monitor_.set_d_crs(monitor->d_Crs); //!< amplitude of the sine harmonic correction term to the orbit radius [m]
|
||||
monitor_.set_d_delta_n(monitor->d_Delta_n); //!< mean motion difference from computed value [semi-circles/s]
|
||||
monitor_.set_d_m_0(monitor->d_M_0); //!< mean anomaly at reference time [semi-circles]
|
||||
monitor_.set_d_cuc(monitor->d_Cuc); //!< amplitude of the cosine harmonic correction term to the argument of latitude [rad]
|
||||
monitor_.set_d_e_eccentricity(monitor->d_e_eccentricity); //!< eccentricity [dimensionless]
|
||||
monitor_.set_d_cus(monitor->d_Cus); //!< amplitude of the sine harmonic correction term to the argument of latitude [rad]
|
||||
monitor_.set_d_sqrt_a(monitor->d_sqrt_A); //!< square root of the semi-major axis [sqrt(m)]
|
||||
monitor_.set_d_toe(monitor->d_Toe); //!< ephemeris data reference time of week (ref. 20.3.3.4.3 is-gps-200k) [s]
|
||||
monitor_.set_d_toc(monitor->d_Toc); //!< clock data reference time (ref. 20.3.3.3.3.1 is-gps-200k) [s]
|
||||
monitor_.set_d_cic(monitor->d_Cic); //!< amplitude of the cosine harmonic correction term to the angle of inclination [rad]
|
||||
monitor_.set_d_omega0(monitor->d_OMEGA0); //!< longitude of ascending node of orbit plane at weekly epoch [semi-circles]
|
||||
monitor_.set_d_cis(monitor->d_Cis); //!< amplitude of the sine harmonic correction term to the angle of inclination [rad]
|
||||
monitor_.set_d_i_0(monitor->d_i_0); //!< inclination angle at reference time [semi-circles]
|
||||
monitor_.set_d_crc(monitor->d_Crc); //!< amplitude of the cosine harmonic correction term to the orbit radius [m]
|
||||
monitor_.set_d_omega(monitor->d_OMEGA); //!< argument of perigee [semi-cicles]
|
||||
monitor_.set_d_omega_dot(monitor->d_OMEGA_DOT); //!< rate of right ascension [semi-circles/s]
|
||||
monitor_.set_d_idot(monitor->d_IDOT); //!< rate of inclination angle [semi-circles/s]
|
||||
monitor_.set_i_code_on_l2(monitor->i_code_on_L2); //!< if 1, p code on in l2; if 2, c/a code on in l2;
|
||||
monitor_.set_i_gps_week(monitor->i_GPS_week); //!< gps week number, aka wn [week]
|
||||
monitor_.set_b_l2_p_data_flag(monitor->b_L2_P_data_flag); //!< when true, indicates that the nav data stream was commanded off on the p-code of the l2 channel
|
||||
monitor_.set_i_sv_accuracy(monitor->i_SV_accuracy); //!< user range accuracy (ura) index of the sv (reference paragraph 6.2.1) for the standard positioning service user (ref 20.3.3.3.1.3 is-gps-200k)
|
||||
monitor_.set_i_sv_health(monitor->i_SV_health);
|
||||
monitor_.set_d_tgd(monitor->d_TGD); //!< estimated group delay differential: l1-l2 correction term only for the benefit of "l1 p(y)" or "l2 p(y)" s users [s]
|
||||
monitor_.set_d_iodc(monitor->d_IODC); //!< issue of data, clock
|
||||
monitor_.set_d_iode_sf2(monitor->d_IODE_SF2); //!< issue of data, ephemeris (iode), subframe 2
|
||||
monitor_.set_d_iode_sf3(monitor->d_IODE_SF3); //!< issue of data, ephemeris(iode), subframe 3
|
||||
monitor_.set_i_aodo(monitor->i_AODO); //!< age of data offset (aodo) term for the navigation message correction table (nmct) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s]
|
||||
monitor_.set_i_satellite_prn(monitor->PRN); //!< SV PRN NUMBER
|
||||
monitor_.set_d_tow(monitor->tow); //!< time of gps week of the ephemeris set (taken from subframes tow) [s]
|
||||
monitor_.set_d_crs(monitor->Crs); //!< amplitude of the sine harmonic correction term to the orbit radius [m]
|
||||
monitor_.set_d_delta_n(monitor->delta_n); //!< mean motion difference from computed value [semi-circles/s]
|
||||
monitor_.set_d_m_0(monitor->M_0); //!< mean anomaly at reference time [semi-circles]
|
||||
monitor_.set_d_cuc(monitor->Cuc); //!< amplitude of the cosine harmonic correction term to the argument of latitude [rad]
|
||||
monitor_.set_d_e_eccentricity(monitor->ecc); //!< eccentricity [dimensionless]
|
||||
monitor_.set_d_cus(monitor->Cus); //!< amplitude of the sine harmonic correction term to the argument of latitude [rad]
|
||||
monitor_.set_d_sqrt_a(monitor->sqrtA); //!< square root of the semi-major axis [sqrt(m)]
|
||||
monitor_.set_d_toe(monitor->toe); //!< ephemeris data reference time of week (ref. 20.3.3.4.3 is-gps-200k) [s]
|
||||
monitor_.set_d_toc(monitor->toc); //!< clock data reference time (ref. 20.3.3.3.3.1 is-gps-200k) [s]
|
||||
monitor_.set_d_cic(monitor->Cic); //!< amplitude of the cosine harmonic correction term to the angle of inclination [rad]
|
||||
monitor_.set_d_omega0(monitor->OMEGA_0); //!< longitude of ascending node of orbit plane at weekly epoch [semi-circles]
|
||||
monitor_.set_d_cis(monitor->Cis); //!< amplitude of the sine harmonic correction term to the angle of inclination [rad]
|
||||
monitor_.set_d_i_0(monitor->i_0); //!< inclination angle at reference time [semi-circles]
|
||||
monitor_.set_d_crc(monitor->Crc); //!< amplitude of the cosine harmonic correction term to the orbit radius [m]
|
||||
monitor_.set_d_omega(monitor->omega); //!< argument of perigee [semi-cicles]
|
||||
monitor_.set_d_omega_dot(monitor->OMEGAdot); //!< rate of right ascension [semi-circles/s]
|
||||
monitor_.set_d_idot(monitor->idot); //!< rate of inclination angle [semi-circles/s]
|
||||
monitor_.set_i_code_on_l2(monitor->code_on_L2); //!< if 1, p code on in l2; if 2, c/a code on in l2;
|
||||
monitor_.set_i_gps_week(monitor->WN); //!< gps week number, aka wn [week]
|
||||
monitor_.set_b_l2_p_data_flag(monitor->L2_P_data_flag); //!< when true, indicates that the nav data stream was commanded off on the p-code of the l2 channel
|
||||
monitor_.set_i_sv_accuracy(monitor->SV_accuracy); //!< user range accuracy (ura) index of the sv (reference paragraph 6.2.1) for the standard positioning service user (ref 20.3.3.3.1.3 is-gps-200k)
|
||||
monitor_.set_i_sv_health(monitor->SV_health);
|
||||
monitor_.set_d_tgd(monitor->TGD); //!< estimated group delay differential: l1-l2 correction term only for the benefit of "l1 p(y)" or "l2 p(y)" s users [s]
|
||||
monitor_.set_d_iodc(monitor->IODC); //!< issue of data, clock
|
||||
monitor_.set_d_iode_sf2(monitor->IODE_SF2); //!< issue of data, ephemeris (iode), subframe 2
|
||||
monitor_.set_d_iode_sf3(monitor->IODE_SF3); //!< issue of data, ephemeris(iode), subframe 3
|
||||
monitor_.set_i_aodo(monitor->AODO); //!< age of data offset (aodo) term for the navigation message correction table (nmct) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s]
|
||||
|
||||
monitor_.set_b_fit_interval_flag(monitor->b_fit_interval_flag); //!< indicates the curve-fit interval used by the cs (block ii/iia/iir/iir-m/iif) and ss (block iiia) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours.
|
||||
monitor_.set_d_spare1(monitor->d_spare1);
|
||||
monitor_.set_d_spare2(monitor->d_spare2);
|
||||
|
||||
monitor_.set_d_a_f0(monitor->d_A_f0); //!< coefficient 0 of code phase offset model [s]
|
||||
monitor_.set_d_a_f1(monitor->d_A_f1); //!< coefficient 1 of code phase offset model [s/s]
|
||||
monitor_.set_d_a_f2(monitor->d_A_f2); //!< coefficient 2 of code phase offset model [s/s^2]
|
||||
monitor_.set_d_a_f0(monitor->af0); //!< coefficient 0 of code phase offset model [s]
|
||||
monitor_.set_d_a_f1(monitor->af1); //!< coefficient 1 of code phase offset model [s/s]
|
||||
monitor_.set_d_a_f2(monitor->af2); //!< coefficient 2 of code phase offset model [s/s^2]
|
||||
|
||||
monitor_.set_b_integrity_status_flag(monitor->b_integrity_status_flag);
|
||||
monitor_.set_b_alert_flag(monitor->b_alert_flag); //!< if true, indicates that the sv ura may be worse than indicated in d_sv_accuracy, use that sv at our own risk.
|
||||
monitor_.set_b_antispoofing_flag(monitor->b_antispoofing_flag); //!< if true, the antispoofing mode is on in that sv
|
||||
monitor_.set_b_alert_flag(monitor->b_alert_flag); //!< if true, indicates that the sv ura may be worse than indicated in d_sv_accuracy, use that sv at our own risk.
|
||||
monitor_.set_b_antispoofing_flag(monitor->b_antispoofing_flag); //!< if true, the antispoofing mode is on in that sv
|
||||
|
||||
monitor_.SerializeToString(&data);
|
||||
return data;
|
||||
@ -128,47 +128,47 @@ public:
|
||||
{
|
||||
Gps_Ephemeris monitor;
|
||||
|
||||
monitor.i_satellite_PRN = mon.i_satellite_prn(); // SV PRN NUMBER
|
||||
monitor.d_TOW = mon.d_tow(); //!< time of gps week of the ephemeris set (taken from subframes tow) [s]
|
||||
monitor.d_Crs = mon.d_crs(); //!< amplitude of the sine harmonic correction term to the orbit radius [m]
|
||||
monitor.d_Delta_n = mon.d_delta_n(); //!< mean motion difference from computed value [semi-circles/s]
|
||||
monitor.d_M_0 = mon.d_m_0(); //!< mean anomaly at reference time [semi-circles]
|
||||
monitor.d_Cuc = mon.d_cuc(); //!< amplitude of the cosine harmonic correction term to the argument of latitude [rad]
|
||||
monitor.d_e_eccentricity = mon.d_e_eccentricity(); //!< eccentricity [dimensionless]
|
||||
monitor.d_Cus = mon.d_cus(); //!< amplitude of the sine harmonic correction term to the argument of latitude [rad]
|
||||
monitor.d_sqrt_A = mon.d_sqrt_a(); //!< square root of the semi-major axis [sqrt(m)]
|
||||
monitor.d_Toe = mon.d_toe(); //!< ephemeris data reference time of week (ref. 20.3.3.4.3 is-gps-200k) [s]
|
||||
monitor.d_Toc = mon.d_toc(); //!< clock data reference time (ref. 20.3.3.3.3.1 is-gps-200k) [s]
|
||||
monitor.d_Cic = mon.d_cic(); //!< amplitude of the cosine harmonic correction term to the angle of inclination [rad]
|
||||
monitor.d_OMEGA0 = mon.d_omega0(); //!< longitude of ascending node of orbit plane at weekly epoch [semi-circles]
|
||||
monitor.d_Cis = mon.d_cis(); //!< amplitude of the sine harmonic correction term to the angle of inclination [rad]
|
||||
monitor.d_i_0 = mon.d_i_0(); //!< inclination angle at reference time [semi-circles]
|
||||
monitor.d_Crc = mon.d_crc(); //!< amplitude of the cosine harmonic correction term to the orbit radius [m]
|
||||
monitor.d_OMEGA = mon.d_omega(); //!< argument of perigee [semi-cicles]
|
||||
monitor.d_OMEGA_DOT = mon.d_omega_dot(); //!< rate of right ascension [semi-circles/s]
|
||||
monitor.d_IDOT = mon.d_idot(); //!< rate of inclination angle [semi-circles/s]
|
||||
monitor.i_code_on_L2 = mon.i_code_on_l2(); //!< if 1, p code on in l2; if 2, c/a code on in l2;
|
||||
monitor.i_GPS_week = mon.i_gps_week(); //!< gps week number, aka wn [week]
|
||||
monitor.b_L2_P_data_flag = mon.b_l2_p_data_flag(); //!< when true, indicates that the nav data stream was commanded off on the p-code of the l2 channel
|
||||
monitor.i_SV_accuracy = mon.i_sv_accuracy(); //!< user range accuracy (ura) index of the sv (reference paragraph 6.2.1) for the standard positioning service user (ref 20.3.3.3.1.3 is-gps-200k)
|
||||
monitor.i_SV_health = mon.i_sv_health();
|
||||
monitor.d_TGD = mon.d_tgd(); //!< estimated group delay differential: l1-l2 correction term only for the benefit of "l1 p(y)" or "l2 p(y)" s users [s]
|
||||
monitor.d_IODC = mon.d_iodc(); //!< issue of data, clock
|
||||
monitor.d_IODE_SF2 = mon.d_iode_sf2(); //!< issue of data, ephemeris (iode), subframe 2
|
||||
monitor.d_IODE_SF3 = mon.d_iode_sf3(); //!< issue of data, ephemeris(iode), subframe 3
|
||||
monitor.i_AODO = mon.i_aodo(); //!< age of data offset (aodo) term for the navigation message correction table (nmct) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s]
|
||||
monitor.PRN = mon.i_satellite_prn(); //!< SV PRN NUMBER
|
||||
monitor.tow = mon.d_tow(); //!< time of gps week of the ephemeris set (taken from subframes tow) [s]
|
||||
monitor.Crs = mon.d_crs(); //!< amplitude of the sine harmonic correction term to the orbit radius [m]
|
||||
monitor.delta_n = mon.d_delta_n(); //!< mean motion difference from computed value [semi-circles/s]
|
||||
monitor.M_0 = mon.d_m_0(); //!< mean anomaly at reference time [semi-circles]
|
||||
monitor.Cuc = mon.d_cuc(); //!< amplitude of the cosine harmonic correction term to the argument of latitude [rad]
|
||||
monitor.ecc = mon.d_e_eccentricity(); //!< eccentricity [dimensionless]
|
||||
monitor.Cus = mon.d_cus(); //!< amplitude of the sine harmonic correction term to the argument of latitude [rad]
|
||||
monitor.sqrtA = mon.d_sqrt_a(); //!< square root of the semi-major axis [sqrt(m)]
|
||||
monitor.toe = mon.d_toe(); //!< ephemeris data reference time of week (ref. 20.3.3.4.3 is-gps-200k) [s]
|
||||
monitor.toc = mon.d_toc(); //!< clock data reference time (ref. 20.3.3.3.3.1 is-gps-200k) [s]
|
||||
monitor.Cic = mon.d_cic(); //!< amplitude of the cosine harmonic correction term to the angle of inclination [rad]
|
||||
monitor.OMEGA_0 = mon.d_omega0(); //!< longitude of ascending node of orbit plane at weekly epoch [semi-circles]
|
||||
monitor.Cis = mon.d_cis(); //!< amplitude of the sine harmonic correction term to the angle of inclination [rad]
|
||||
monitor.i_0 = mon.d_i_0(); //!< inclination angle at reference time [semi-circles]
|
||||
monitor.Crc = mon.d_crc(); //!< amplitude of the cosine harmonic correction term to the orbit radius [m]
|
||||
monitor.omega = mon.d_omega(); //!< argument of perigee [semi-cicles]
|
||||
monitor.OMEGAdot = mon.d_omega_dot(); //!< rate of right ascension [semi-circles/s]
|
||||
monitor.idot = mon.d_idot(); //!< rate of inclination angle [semi-circles/s]
|
||||
monitor.code_on_L2 = mon.i_code_on_l2(); //!< if 1, p code on in l2; if 2, c/a code on in l2;
|
||||
monitor.WN = mon.i_gps_week(); //!< gps week number, aka wn [week]
|
||||
monitor.L2_P_data_flag = mon.b_l2_p_data_flag(); //!< when true, indicates that the nav data stream was commanded off on the p-code of the l2 channel
|
||||
monitor.SV_accuracy = mon.i_sv_accuracy(); //!< user range accuracy (ura) index of the sv (reference paragraph 6.2.1) for the standard positioning service user (ref 20.3.3.3.1.3 is-gps-200k)
|
||||
monitor.SV_health = mon.i_sv_health();
|
||||
monitor.TGD = mon.d_tgd(); //!< estimated group delay differential: l1-l2 correction term only for the benefit of "l1 p(y)" or "l2 p(y)" s users [s]
|
||||
monitor.IODC = mon.d_iodc(); //!< issue of data, clock
|
||||
monitor.IODE_SF2 = mon.d_iode_sf2(); //!< issue of data, ephemeris (iode), subframe 2
|
||||
monitor.IODE_SF3 = mon.d_iode_sf3(); //!< issue of data, ephemeris(iode), subframe 3
|
||||
monitor.AODO = mon.i_aodo(); //!< age of data offset (aodo) term for the navigation message correction table (nmct) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s]
|
||||
|
||||
monitor.b_fit_interval_flag = mon.b_fit_interval_flag(); //!< indicates the curve-fit interval used by the cs (block ii/iia/iir/iir-m/iif) and ss (block iiia) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours.
|
||||
monitor.d_spare1 = mon.d_spare1();
|
||||
monitor.d_spare2 = mon.d_spare2();
|
||||
|
||||
monitor.d_A_f0 = mon.d_a_f0(); //!< coefficient 0 of code phase offset model [s]
|
||||
monitor.d_A_f1 = mon.d_a_f1(); //!< coefficient 1 of code phase offset model [s/s]
|
||||
monitor.d_A_f2 = mon.d_a_f2(); //!< coefficient 2 of code phase offset model [s/s^2]
|
||||
monitor.af0 = mon.d_a_f0(); //!< coefficient 0 of code phase offset model [s]
|
||||
monitor.af1 = mon.d_a_f1(); //!< coefficient 1 of code phase offset model [s/s]
|
||||
monitor.af2 = mon.d_a_f2(); //!< coefficient 2 of code phase offset model [s/s^2]
|
||||
|
||||
monitor.b_integrity_status_flag = mon.b_integrity_status_flag();
|
||||
monitor.b_alert_flag = mon.b_alert_flag(); //!< if true, indicates that the sv ura may be worse than indicated in d_sv_accuracy, use that sv at our own risk.
|
||||
monitor.b_antispoofing_flag = mon.b_antispoofing_flag(); //!< if true, the antispoofing mode is on in that sv
|
||||
monitor.b_alert_flag = mon.b_alert_flag(); //!< if true, indicates that the sv ura may be worse than indicated in d_sv_accuracy, use that sv at our own risk.
|
||||
monitor.b_antispoofing_flag = mon.b_antispoofing_flag(); //!< if true, the antispoofing mode is on in that sv
|
||||
|
||||
return monitor;
|
||||
}
|
||||
|
@ -162,13 +162,13 @@ void pcps_assisted_acquisition_cc::get_assistance()
|
||||
// TODO: use the LO tolerance here
|
||||
if (gps_acq_assisistance.dopplerUncertainty >= 1000)
|
||||
{
|
||||
d_doppler_max = gps_acq_assisistance.d_Doppler0 + gps_acq_assisistance.dopplerUncertainty * 2;
|
||||
d_doppler_min = gps_acq_assisistance.d_Doppler0 - gps_acq_assisistance.dopplerUncertainty * 2;
|
||||
d_doppler_max = gps_acq_assisistance.Doppler0 + gps_acq_assisistance.dopplerUncertainty * 2;
|
||||
d_doppler_min = gps_acq_assisistance.Doppler0 - gps_acq_assisistance.dopplerUncertainty * 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
d_doppler_max = gps_acq_assisistance.d_Doppler0 + 1000;
|
||||
d_doppler_min = gps_acq_assisistance.d_Doppler0 - 1000;
|
||||
d_doppler_max = gps_acq_assisistance.Doppler0 + 1000;
|
||||
d_doppler_min = gps_acq_assisistance.Doppler0 - 1000;
|
||||
}
|
||||
this->d_disable_assist = false;
|
||||
std::cout << "Acq assist ENABLED for GPS SV " << this->d_gnss_synchro->PRN << " (Doppler max,Doppler min)=("
|
||||
|
@ -168,36 +168,36 @@ eph_t eph_to_rtklib(const Galileo_Ephemeris& gal_eph)
|
||||
eph_t rtklib_sat = {0, 0, 0, 0, 0, 0, 0, 0, {0, 0}, {0, 0}, {0, 0}, 0.0, 0.0, 0.0, 0.0, 0.0,
|
||||
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, {}, {}, 0.0, 0.0};
|
||||
// Galileo is the third satellite system for RTKLIB, so, add the required offset to discriminate Galileo ephemeris
|
||||
rtklib_sat.sat = gal_eph.i_satellite_PRN + NSATGPS + NSATGLO;
|
||||
rtklib_sat.A = gal_eph.A_1 * gal_eph.A_1;
|
||||
rtklib_sat.M0 = gal_eph.M0_1;
|
||||
rtklib_sat.deln = gal_eph.delta_n_3;
|
||||
rtklib_sat.OMG0 = gal_eph.OMEGA_0_2;
|
||||
rtklib_sat.OMGd = gal_eph.OMEGA_dot_3;
|
||||
rtklib_sat.omg = gal_eph.omega_2;
|
||||
rtklib_sat.i0 = gal_eph.i_0_2;
|
||||
rtklib_sat.idot = gal_eph.iDot_2;
|
||||
rtklib_sat.e = gal_eph.e_1;
|
||||
rtklib_sat.sat = gal_eph.PRN + NSATGPS + NSATGLO;
|
||||
rtklib_sat.A = gal_eph.sqrtA * gal_eph.sqrtA;
|
||||
rtklib_sat.M0 = gal_eph.M_0;
|
||||
rtklib_sat.deln = gal_eph.delta_n;
|
||||
rtklib_sat.OMG0 = gal_eph.OMEGA_0;
|
||||
rtklib_sat.OMGd = gal_eph.OMEGAdot;
|
||||
rtklib_sat.omg = gal_eph.omega;
|
||||
rtklib_sat.i0 = gal_eph.i_0;
|
||||
rtklib_sat.idot = gal_eph.idot;
|
||||
rtklib_sat.e = gal_eph.ecc;
|
||||
rtklib_sat.Adot = 0; // only in CNAV;
|
||||
rtklib_sat.ndot = 0; // only in CNAV;
|
||||
|
||||
rtklib_sat.week = gal_eph.WN_5 + 1024; /* week of tow in GPS (not mod-1024) week scale */
|
||||
rtklib_sat.cic = gal_eph.C_ic_4;
|
||||
rtklib_sat.cis = gal_eph.C_is_4;
|
||||
rtklib_sat.cuc = gal_eph.C_uc_3;
|
||||
rtklib_sat.cus = gal_eph.C_us_3;
|
||||
rtklib_sat.crc = gal_eph.C_rc_3;
|
||||
rtklib_sat.crs = gal_eph.C_rs_3;
|
||||
rtklib_sat.f0 = gal_eph.af0_4;
|
||||
rtklib_sat.f1 = gal_eph.af1_4;
|
||||
rtklib_sat.f2 = gal_eph.af2_4;
|
||||
rtklib_sat.tgd[0] = gal_eph.BGD_E1E5a_5;
|
||||
rtklib_sat.tgd[1] = gal_eph.BGD_E1E5b_5;
|
||||
rtklib_sat.week = gal_eph.WN + 1024; /* week of tow in GPS (not mod-1024) week scale */
|
||||
rtklib_sat.cic = gal_eph.Cic;
|
||||
rtklib_sat.cis = gal_eph.Cis;
|
||||
rtklib_sat.cuc = gal_eph.Cuc;
|
||||
rtklib_sat.cus = gal_eph.Cus;
|
||||
rtklib_sat.crc = gal_eph.Crc;
|
||||
rtklib_sat.crs = gal_eph.Crs;
|
||||
rtklib_sat.f0 = gal_eph.af0;
|
||||
rtklib_sat.f1 = gal_eph.af1;
|
||||
rtklib_sat.f2 = gal_eph.af2;
|
||||
rtklib_sat.tgd[0] = gal_eph.BGD_E1E5a;
|
||||
rtklib_sat.tgd[1] = gal_eph.BGD_E1E5b;
|
||||
rtklib_sat.tgd[2] = 0;
|
||||
rtklib_sat.tgd[3] = 0;
|
||||
rtklib_sat.toes = gal_eph.t0e_1;
|
||||
rtklib_sat.toc = gpst2time(rtklib_sat.week, gal_eph.t0c_4);
|
||||
rtklib_sat.ttr = gpst2time(rtklib_sat.week, gal_eph.TOW_5);
|
||||
rtklib_sat.toes = gal_eph.toe;
|
||||
rtklib_sat.toc = gpst2time(rtklib_sat.week, gal_eph.toc);
|
||||
rtklib_sat.ttr = gpst2time(rtklib_sat.week, gal_eph.tow);
|
||||
|
||||
/* adjustment for week handover */
|
||||
double tow;
|
||||
@ -226,36 +226,36 @@ eph_t eph_to_rtklib(const Gps_Ephemeris& gps_eph, bool pre_2009_file)
|
||||
{
|
||||
eph_t rtklib_sat = {0, 0, 0, 0, 0, 0, 0, 0, {0, 0}, {0, 0}, {0, 0}, 0.0, 0.0, 0.0, 0.0, 0.0,
|
||||
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, {}, {}, 0.0, 0.0};
|
||||
rtklib_sat.sat = gps_eph.i_satellite_PRN;
|
||||
rtklib_sat.A = gps_eph.d_sqrt_A * gps_eph.d_sqrt_A;
|
||||
rtklib_sat.M0 = gps_eph.d_M_0;
|
||||
rtklib_sat.deln = gps_eph.d_Delta_n;
|
||||
rtklib_sat.OMG0 = gps_eph.d_OMEGA0;
|
||||
rtklib_sat.OMGd = gps_eph.d_OMEGA_DOT;
|
||||
rtklib_sat.omg = gps_eph.d_OMEGA;
|
||||
rtklib_sat.i0 = gps_eph.d_i_0;
|
||||
rtklib_sat.idot = gps_eph.d_IDOT;
|
||||
rtklib_sat.e = gps_eph.d_e_eccentricity;
|
||||
rtklib_sat.sat = gps_eph.PRN;
|
||||
rtklib_sat.A = gps_eph.sqrtA * gps_eph.sqrtA;
|
||||
rtklib_sat.M0 = gps_eph.M_0;
|
||||
rtklib_sat.deln = gps_eph.delta_n;
|
||||
rtklib_sat.OMG0 = gps_eph.OMEGA_0;
|
||||
rtklib_sat.OMGd = gps_eph.OMEGAdot;
|
||||
rtklib_sat.omg = gps_eph.omega;
|
||||
rtklib_sat.i0 = gps_eph.i_0;
|
||||
rtklib_sat.idot = gps_eph.idot;
|
||||
rtklib_sat.e = gps_eph.ecc;
|
||||
rtklib_sat.Adot = 0; // only in CNAV;
|
||||
rtklib_sat.ndot = 0; // only in CNAV;
|
||||
|
||||
rtklib_sat.week = adjgpsweek(gps_eph.i_GPS_week, pre_2009_file); /* week of tow */
|
||||
rtklib_sat.cic = gps_eph.d_Cic;
|
||||
rtklib_sat.cis = gps_eph.d_Cis;
|
||||
rtklib_sat.cuc = gps_eph.d_Cuc;
|
||||
rtklib_sat.cus = gps_eph.d_Cus;
|
||||
rtklib_sat.crc = gps_eph.d_Crc;
|
||||
rtklib_sat.crs = gps_eph.d_Crs;
|
||||
rtklib_sat.f0 = gps_eph.d_A_f0;
|
||||
rtklib_sat.f1 = gps_eph.d_A_f1;
|
||||
rtklib_sat.f2 = gps_eph.d_A_f2;
|
||||
rtklib_sat.tgd[0] = gps_eph.d_TGD;
|
||||
rtklib_sat.week = adjgpsweek(gps_eph.WN, pre_2009_file); /* week of tow */
|
||||
rtklib_sat.cic = gps_eph.Cic;
|
||||
rtklib_sat.cis = gps_eph.Cis;
|
||||
rtklib_sat.cuc = gps_eph.Cuc;
|
||||
rtklib_sat.cus = gps_eph.Cus;
|
||||
rtklib_sat.crc = gps_eph.Crc;
|
||||
rtklib_sat.crs = gps_eph.Crs;
|
||||
rtklib_sat.f0 = gps_eph.af0;
|
||||
rtklib_sat.f1 = gps_eph.af1;
|
||||
rtklib_sat.f2 = gps_eph.af2;
|
||||
rtklib_sat.tgd[0] = gps_eph.TGD;
|
||||
rtklib_sat.tgd[1] = 0.0;
|
||||
rtklib_sat.tgd[2] = 0.0;
|
||||
rtklib_sat.tgd[3] = 0.0;
|
||||
rtklib_sat.toes = gps_eph.d_Toe;
|
||||
rtklib_sat.toc = gpst2time(rtklib_sat.week, gps_eph.d_Toc);
|
||||
rtklib_sat.ttr = gpst2time(rtklib_sat.week, gps_eph.d_TOW);
|
||||
rtklib_sat.toes = gps_eph.toe;
|
||||
rtklib_sat.toc = gpst2time(rtklib_sat.week, gps_eph.toc);
|
||||
rtklib_sat.ttr = gpst2time(rtklib_sat.week, gps_eph.tow);
|
||||
|
||||
/* adjustment for week handover */
|
||||
double tow;
|
||||
@ -284,45 +284,45 @@ eph_t eph_to_rtklib(const Beidou_Dnav_Ephemeris& bei_eph)
|
||||
{
|
||||
eph_t rtklib_sat = {0, 0, 0, 0, 0, 0, 0, 0, {0, 0}, {0, 0}, {0, 0}, 0.0, 0.0, 0.0, 0.0, 0.0,
|
||||
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, {}, {}, 0.0, 0.0};
|
||||
rtklib_sat.sat = bei_eph.i_satellite_PRN + NSATGPS + NSATGLO + NSATGAL + NSATQZS;
|
||||
rtklib_sat.A = bei_eph.d_sqrt_A * bei_eph.d_sqrt_A;
|
||||
rtklib_sat.M0 = bei_eph.d_M_0;
|
||||
rtklib_sat.deln = bei_eph.d_Delta_n;
|
||||
rtklib_sat.OMG0 = bei_eph.d_OMEGA0;
|
||||
rtklib_sat.OMGd = bei_eph.d_OMEGA_DOT;
|
||||
rtklib_sat.omg = bei_eph.d_OMEGA;
|
||||
rtklib_sat.i0 = bei_eph.d_i_0;
|
||||
rtklib_sat.idot = bei_eph.d_IDOT;
|
||||
rtklib_sat.e = bei_eph.d_eccentricity;
|
||||
rtklib_sat.sat = bei_eph.PRN + NSATGPS + NSATGLO + NSATGAL + NSATQZS;
|
||||
rtklib_sat.A = bei_eph.sqrtA * bei_eph.sqrtA;
|
||||
rtklib_sat.M0 = bei_eph.M_0;
|
||||
rtklib_sat.deln = bei_eph.delta_n;
|
||||
rtklib_sat.OMG0 = bei_eph.OMEGA_0;
|
||||
rtklib_sat.OMGd = bei_eph.OMEGAdot;
|
||||
rtklib_sat.omg = bei_eph.omega;
|
||||
rtklib_sat.i0 = bei_eph.i_0;
|
||||
rtklib_sat.idot = bei_eph.idot;
|
||||
rtklib_sat.e = bei_eph.ecc;
|
||||
rtklib_sat.Adot = 0; // only in CNAV;
|
||||
rtklib_sat.ndot = 0; // only in CNAV;
|
||||
|
||||
rtklib_sat.svh = bei_eph.i_SV_health;
|
||||
rtklib_sat.sva = bei_eph.i_SV_accuracy;
|
||||
rtklib_sat.svh = bei_eph.SV_health;
|
||||
rtklib_sat.sva = bei_eph.SV_accuracy;
|
||||
|
||||
rtklib_sat.code = bei_eph.i_sig_type; /* B1I data */
|
||||
rtklib_sat.flag = bei_eph.i_nav_type; /* MEO/IGSO satellite */
|
||||
rtklib_sat.iode = static_cast<int32_t>(bei_eph.d_AODE); /* AODE */
|
||||
rtklib_sat.iodc = static_cast<int32_t>(bei_eph.d_AODC); /* AODC */
|
||||
|
||||
rtklib_sat.week = bei_eph.i_BEIDOU_week; /* week of tow */
|
||||
rtklib_sat.cic = bei_eph.d_Cic;
|
||||
rtklib_sat.cis = bei_eph.d_Cis;
|
||||
rtklib_sat.cuc = bei_eph.d_Cuc;
|
||||
rtklib_sat.cus = bei_eph.d_Cus;
|
||||
rtklib_sat.crc = bei_eph.d_Crc;
|
||||
rtklib_sat.crs = bei_eph.d_Crs;
|
||||
rtklib_sat.f0 = bei_eph.d_A_f0;
|
||||
rtklib_sat.f1 = bei_eph.d_A_f1;
|
||||
rtklib_sat.f2 = bei_eph.d_A_f2;
|
||||
rtklib_sat.week = bei_eph.WN; /* week of tow */
|
||||
rtklib_sat.cic = bei_eph.Cic;
|
||||
rtklib_sat.cis = bei_eph.Cis;
|
||||
rtklib_sat.cuc = bei_eph.Cuc;
|
||||
rtklib_sat.cus = bei_eph.Cus;
|
||||
rtklib_sat.crc = bei_eph.Crc;
|
||||
rtklib_sat.crs = bei_eph.Crs;
|
||||
rtklib_sat.f0 = bei_eph.af0;
|
||||
rtklib_sat.f1 = bei_eph.af1;
|
||||
rtklib_sat.f2 = bei_eph.af2;
|
||||
rtklib_sat.tgd[0] = bei_eph.d_TGD1;
|
||||
rtklib_sat.tgd[1] = bei_eph.d_TGD2;
|
||||
rtklib_sat.tgd[2] = 0.0;
|
||||
rtklib_sat.tgd[3] = 0.0;
|
||||
rtklib_sat.toes = bei_eph.d_Toe;
|
||||
rtklib_sat.toe = bdt2gpst(bdt2time(rtklib_sat.week, bei_eph.d_Toe));
|
||||
rtklib_sat.toc = bdt2gpst(bdt2time(rtklib_sat.week, bei_eph.d_Toc));
|
||||
rtklib_sat.ttr = bdt2gpst(bdt2time(rtklib_sat.week, bei_eph.d_TOW));
|
||||
rtklib_sat.toes = bei_eph.toe;
|
||||
rtklib_sat.toe = bdt2gpst(bdt2time(rtklib_sat.week, bei_eph.toe));
|
||||
rtklib_sat.toc = bdt2gpst(bdt2time(rtklib_sat.week, bei_eph.toc));
|
||||
rtklib_sat.ttr = bdt2gpst(bdt2time(rtklib_sat.week, bei_eph.tow));
|
||||
/* adjustment for week handover */
|
||||
double tow;
|
||||
double toc;
|
||||
@ -353,44 +353,40 @@ eph_t eph_to_rtklib(const Gps_CNAV_Ephemeris& gps_cnav_eph)
|
||||
{
|
||||
eph_t rtklib_sat = {0, 0, 0, 0, 0, 0, 0, 0, {0, 0}, {0, 0}, {0, 0}, 0.0, 0.0, 0.0, 0.0, 0.0,
|
||||
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, {}, {}, 0.0, 0.0};
|
||||
rtklib_sat.sat = gps_cnav_eph.i_satellite_PRN;
|
||||
const double A_REF = 26559710.0; // See IS-GPS-200L, pp. 161
|
||||
rtklib_sat.A = A_REF + gps_cnav_eph.d_DELTA_A;
|
||||
rtklib_sat.M0 = gps_cnav_eph.d_M_0;
|
||||
rtklib_sat.deln = gps_cnav_eph.d_Delta_n;
|
||||
rtklib_sat.OMG0 = gps_cnav_eph.d_OMEGA0;
|
||||
// Compute the angle between the ascending node and the Greenwich meridian
|
||||
const double OMEGA_DOT_REF = -2.6e-9; // semicircles / s, see IS-GPS-200L pp. 160
|
||||
double d_OMEGA_DOT = OMEGA_DOT_REF * GNSS_PI + gps_cnav_eph.d_DELTA_OMEGA_DOT;
|
||||
rtklib_sat.OMGd = d_OMEGA_DOT;
|
||||
rtklib_sat.omg = gps_cnav_eph.d_OMEGA;
|
||||
rtklib_sat.i0 = gps_cnav_eph.d_i_0;
|
||||
rtklib_sat.idot = gps_cnav_eph.d_IDOT;
|
||||
rtklib_sat.e = gps_cnav_eph.d_e_eccentricity;
|
||||
rtklib_sat.Adot = gps_cnav_eph.d_A_DOT; // only in CNAV;
|
||||
rtklib_sat.ndot = gps_cnav_eph.d_DELTA_DOT_N; // only in CNAV;
|
||||
rtklib_sat.sat = gps_cnav_eph.PRN;
|
||||
rtklib_sat.A = gps_cnav_eph.sqrtA * gps_cnav_eph.sqrtA;
|
||||
rtklib_sat.M0 = gps_cnav_eph.M_0;
|
||||
rtklib_sat.deln = gps_cnav_eph.delta_n;
|
||||
rtklib_sat.OMG0 = gps_cnav_eph.OMEGA_0;
|
||||
rtklib_sat.OMGd = gps_cnav_eph.OMEGAdot;
|
||||
rtklib_sat.omg = gps_cnav_eph.omega;
|
||||
rtklib_sat.i0 = gps_cnav_eph.i_0;
|
||||
rtklib_sat.idot = gps_cnav_eph.idot;
|
||||
rtklib_sat.e = gps_cnav_eph.ecc;
|
||||
rtklib_sat.Adot = gps_cnav_eph.Adot; // only in CNAV;
|
||||
rtklib_sat.ndot = gps_cnav_eph.delta_ndot; // only in CNAV;
|
||||
|
||||
rtklib_sat.week = adjgpsweek(gps_cnav_eph.i_GPS_week); /* week of tow */
|
||||
rtklib_sat.cic = gps_cnav_eph.d_Cic;
|
||||
rtklib_sat.cis = gps_cnav_eph.d_Cis;
|
||||
rtklib_sat.cuc = gps_cnav_eph.d_Cuc;
|
||||
rtklib_sat.cus = gps_cnav_eph.d_Cus;
|
||||
rtklib_sat.crc = gps_cnav_eph.d_Crc;
|
||||
rtklib_sat.crs = gps_cnav_eph.d_Crs;
|
||||
rtklib_sat.f0 = gps_cnav_eph.d_A_f0;
|
||||
rtklib_sat.f1 = gps_cnav_eph.d_A_f1;
|
||||
rtklib_sat.f2 = gps_cnav_eph.d_A_f2;
|
||||
rtklib_sat.tgd[0] = gps_cnav_eph.d_TGD;
|
||||
rtklib_sat.week = adjgpsweek(gps_cnav_eph.WN); /* week of tow */
|
||||
rtklib_sat.cic = gps_cnav_eph.Cic;
|
||||
rtklib_sat.cis = gps_cnav_eph.Cis;
|
||||
rtklib_sat.cuc = gps_cnav_eph.Cuc;
|
||||
rtklib_sat.cus = gps_cnav_eph.Cus;
|
||||
rtklib_sat.crc = gps_cnav_eph.Crc;
|
||||
rtklib_sat.crs = gps_cnav_eph.Crs;
|
||||
rtklib_sat.f0 = gps_cnav_eph.af0;
|
||||
rtklib_sat.f1 = gps_cnav_eph.af1;
|
||||
rtklib_sat.f2 = gps_cnav_eph.af2;
|
||||
rtklib_sat.tgd[0] = gps_cnav_eph.TGD;
|
||||
rtklib_sat.tgd[1] = 0.0;
|
||||
rtklib_sat.tgd[2] = 0.0;
|
||||
rtklib_sat.tgd[3] = 0.0;
|
||||
rtklib_sat.isc[0] = gps_cnav_eph.d_ISCL1;
|
||||
rtklib_sat.isc[1] = gps_cnav_eph.d_ISCL2;
|
||||
rtklib_sat.isc[2] = gps_cnav_eph.d_ISCL5I;
|
||||
rtklib_sat.isc[3] = gps_cnav_eph.d_ISCL5Q;
|
||||
rtklib_sat.toes = gps_cnav_eph.d_Toe1;
|
||||
rtklib_sat.toc = gpst2time(rtklib_sat.week, gps_cnav_eph.d_Toc);
|
||||
rtklib_sat.ttr = gpst2time(rtklib_sat.week, gps_cnav_eph.d_TOW);
|
||||
rtklib_sat.isc[0] = gps_cnav_eph.ISCL1;
|
||||
rtklib_sat.isc[1] = gps_cnav_eph.ISCL2;
|
||||
rtklib_sat.isc[2] = gps_cnav_eph.ISCL5I;
|
||||
rtklib_sat.isc[3] = gps_cnav_eph.ISCL5Q;
|
||||
rtklib_sat.toes = gps_cnav_eph.toe1;
|
||||
rtklib_sat.toc = gpst2time(rtklib_sat.week, gps_cnav_eph.toc);
|
||||
rtklib_sat.ttr = gpst2time(rtklib_sat.week, gps_cnav_eph.tow);
|
||||
|
||||
/* adjustment for week handover */
|
||||
double tow;
|
||||
@ -421,24 +417,24 @@ alm_t alm_to_rtklib(const Gps_Almanac& gps_alm)
|
||||
|
||||
rtklib_alm = {0, 0, 0, 0, {0, 0}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
|
||||
|
||||
rtklib_alm.sat = gps_alm.i_satellite_PRN;
|
||||
rtklib_alm.svh = gps_alm.i_SV_health;
|
||||
rtklib_alm.svconf = gps_alm.i_AS_status;
|
||||
rtklib_alm.week = gps_alm.i_WNa;
|
||||
rtklib_alm.sat = gps_alm.PRN;
|
||||
rtklib_alm.svh = gps_alm.SV_health;
|
||||
rtklib_alm.svconf = gps_alm.AS_status;
|
||||
rtklib_alm.week = gps_alm.WNa;
|
||||
gtime_t toa;
|
||||
toa.time = gps_alm.i_Toa;
|
||||
toa.time = gps_alm.toa;
|
||||
toa.sec = 0.0;
|
||||
rtklib_alm.toa = toa;
|
||||
rtklib_alm.A = gps_alm.d_sqrt_A * gps_alm.d_sqrt_A;
|
||||
rtklib_alm.e = gps_alm.d_e_eccentricity;
|
||||
rtklib_alm.i0 = (gps_alm.d_Delta_i + 0.3) * GNSS_PI;
|
||||
rtklib_alm.OMG0 = gps_alm.d_OMEGA0 * GNSS_PI;
|
||||
rtklib_alm.OMGd = gps_alm.d_OMEGA_DOT * GNSS_PI;
|
||||
rtklib_alm.omg = gps_alm.d_OMEGA * GNSS_PI;
|
||||
rtklib_alm.M0 = gps_alm.d_M_0 * GNSS_PI;
|
||||
rtklib_alm.f0 = gps_alm.d_A_f0;
|
||||
rtklib_alm.f1 = gps_alm.d_A_f1;
|
||||
rtklib_alm.toas = gps_alm.i_Toa;
|
||||
rtklib_alm.A = gps_alm.sqrtA * gps_alm.sqrtA;
|
||||
rtklib_alm.e = gps_alm.ecc;
|
||||
rtklib_alm.i0 = (gps_alm.delta_i + 0.3) * GNSS_PI;
|
||||
rtklib_alm.OMG0 = gps_alm.OMEGA_0 * GNSS_PI;
|
||||
rtklib_alm.OMGd = gps_alm.OMEGAdot * GNSS_PI;
|
||||
rtklib_alm.omg = gps_alm.omega * GNSS_PI;
|
||||
rtklib_alm.M0 = gps_alm.M_0 * GNSS_PI;
|
||||
rtklib_alm.f0 = gps_alm.af0;
|
||||
rtklib_alm.f1 = gps_alm.af1;
|
||||
rtklib_alm.toas = gps_alm.toa;
|
||||
|
||||
return rtklib_alm;
|
||||
}
|
||||
@ -450,25 +446,25 @@ alm_t alm_to_rtklib(const Galileo_Almanac& gal_alm)
|
||||
|
||||
rtklib_alm = {0, 0, 0, 0, {0, 0}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
|
||||
|
||||
rtklib_alm.sat = gal_alm.i_satellite_PRN + NSATGPS + NSATGLO;
|
||||
rtklib_alm.sat = gal_alm.PRN + NSATGPS + NSATGLO;
|
||||
rtklib_alm.svh = gal_alm.E1B_HS;
|
||||
rtklib_alm.svconf = gal_alm.E1B_HS;
|
||||
rtklib_alm.week = gal_alm.i_WNa;
|
||||
rtklib_alm.week = gal_alm.WNa;
|
||||
gtime_t toa;
|
||||
toa.time = gal_alm.i_Toa;
|
||||
toa.time = gal_alm.toa;
|
||||
toa.sec = 0.0;
|
||||
rtklib_alm.toa = toa;
|
||||
rtklib_alm.A = 5440.588203494 + gal_alm.d_Delta_sqrt_A;
|
||||
rtklib_alm.A = 5440.588203494 + gal_alm.delta_sqrtA;
|
||||
rtklib_alm.A = rtklib_alm.A * rtklib_alm.A;
|
||||
rtklib_alm.e = gal_alm.d_e_eccentricity;
|
||||
rtklib_alm.i0 = (gal_alm.d_Delta_i + 56.0 / 180.0) * GNSS_PI;
|
||||
rtklib_alm.OMG0 = gal_alm.d_OMEGA0 * GNSS_PI;
|
||||
rtklib_alm.OMGd = gal_alm.d_OMEGA_DOT * GNSS_PI;
|
||||
rtklib_alm.omg = gal_alm.d_OMEGA * GNSS_PI;
|
||||
rtklib_alm.M0 = gal_alm.d_M_0 * GNSS_PI;
|
||||
rtklib_alm.f0 = gal_alm.d_A_f0;
|
||||
rtklib_alm.f1 = gal_alm.d_A_f1;
|
||||
rtklib_alm.toas = gal_alm.i_Toa;
|
||||
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;
|
||||
rtklib_alm.OMGd = gal_alm.OMEGAdot * GNSS_PI;
|
||||
rtklib_alm.omg = gal_alm.omega * GNSS_PI;
|
||||
rtklib_alm.M0 = gal_alm.M_0 * GNSS_PI;
|
||||
rtklib_alm.f0 = gal_alm.af0;
|
||||
rtklib_alm.f1 = gal_alm.af1;
|
||||
rtklib_alm.toas = gal_alm.toa;
|
||||
|
||||
return rtklib_alm;
|
||||
}
|
||||
|
@ -381,7 +381,7 @@ void galileo_telemetry_decoder_gs::decode_INAV_word(float *page_part_symbols, in
|
||||
std::cout << TEXT_BLUE << "New Galileo E5b I/NAV message received in channel " << d_channel << ": UTC model parameters from satellite " << d_satellite << TEXT_RESET << '\n';
|
||||
}
|
||||
this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj));
|
||||
d_delta_t = tmp_obj->A_0G_10 + tmp_obj->A_1G_10 * (static_cast<double>(d_TOW_at_current_symbol_ms) / 1000.0 - tmp_obj->t_0G_10 + 604800 * (std::fmod(static_cast<float>(d_inav_nav.get_Galileo_week() - tmp_obj->WN_0G_10), 64.0)));
|
||||
d_delta_t = tmp_obj->A_0G + tmp_obj->A_1G * (static_cast<double>(d_TOW_at_current_symbol_ms) / 1000.0 - tmp_obj->t_0G + 604800 * (std::fmod(static_cast<float>(d_inav_nav.get_Galileo_week() - tmp_obj->WN_0G), 64.0)));
|
||||
DLOG(INFO) << "delta_t=" << d_delta_t << "[s]";
|
||||
}
|
||||
if (d_inav_nav.have_new_almanac() == true)
|
||||
|
@ -411,7 +411,7 @@ int glonass_l1_ca_telemetry_decoder_gs::general_work(int noutput_items __attribu
|
||||
|
||||
// if(d_nav.flag_GGTO_1 == true and d_nav.flag_GGTO_2 == true and d_nav.flag_GGTO_3 == true and d_nav.flag_GGTO_4 == true) // all GGTO parameters arrived
|
||||
// {
|
||||
// delta_t = d_nav.A_0G_10 + d_nav.A_1G_10 * (d_TOW_at_current_symbol - d_nav.t_0G_10 + 604800.0 * (fmod((d_nav.WN_0 - d_nav.WN_0G_10), 64)));
|
||||
// delta_t = d_nav.A_0G + d_nav.A_1G * (d_TOW_at_current_symbol - d_nav.t_0G + 604800.0 * (fmod((d_nav.WN_0 - d_nav.WN_0G), 64)));
|
||||
// }
|
||||
|
||||
if (d_flag_frame_sync == true and d_nav.is_flag_TOW_set() == true)
|
||||
|
@ -410,7 +410,7 @@ int glonass_l2_ca_telemetry_decoder_gs::general_work(int noutput_items __attribu
|
||||
|
||||
// if(d_nav.flag_GGTO_1 == true and d_nav.flag_GGTO_2 == true and d_nav.flag_GGTO_3 == true and d_nav.flag_GGTO_4 == true) // all GGTO parameters arrived
|
||||
// {
|
||||
// delta_t = d_nav.A_0G_10 + d_nav.A_1G_10 * (d_TOW_at_current_symbol - d_nav.t_0G_10 + 604800.0 * (fmod((d_nav.WN_0 - d_nav.WN_0G_10), 64)));
|
||||
// delta_t = d_nav.A_0G + d_nav.A_1G * (d_TOW_at_current_symbol - d_nav.t_0G + 604800.0 * (fmod((d_nav.WN_0 - d_nav.WN_0G), 64)));
|
||||
// }
|
||||
|
||||
if (d_flag_frame_sync == true and d_nav.is_flag_TOW_set() == true)
|
||||
|
@ -200,7 +200,7 @@ void Gnss_Sdr_Supl_Client::read_supl_data()
|
||||
if (assist.set & SUPL_RRLP_ASSIST_REFTIME)
|
||||
{
|
||||
/* TS 44.031: GPSTOW, range 0-604799.92, resolution 0.08 sec, 23-bit presentation */
|
||||
gps_time.d_TOW = static_cast<double>(assist.time.gps_tow) * 0.08;
|
||||
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);
|
||||
@ -210,29 +210,29 @@ void Gnss_Sdr_Supl_Client::read_supl_data()
|
||||
// READ UTC MODEL
|
||||
if (assist.set & SUPL_RRLP_ASSIST_UTC)
|
||||
{
|
||||
gps_utc.d_A0 = static_cast<double>(assist.utc.a0) * pow(2.0, -30);
|
||||
gps_utc.d_A1 = static_cast<double>(assist.utc.a1) * pow(2.0, -50);
|
||||
gps_utc.d_DeltaT_LS = static_cast<int32_t>(assist.utc.delta_tls);
|
||||
gps_utc.d_DeltaT_LSF = static_cast<int32_t>(assist.utc.delta_tlsf);
|
||||
gps_utc.d_t_OT = static_cast<int32_t>(assist.utc.tot) * pow(2.0, 12);
|
||||
gps_utc.i_DN = static_cast<int32_t>(assist.utc.dn);
|
||||
gps_utc.i_WN_T = static_cast<int32_t>(assist.utc.wnt);
|
||||
gps_utc.i_WN_LSF = static_cast<int32_t>(assist.utc.wnlsf);
|
||||
gps_utc.A0 = static_cast<double>(assist.utc.a0) * pow(2.0, -30);
|
||||
gps_utc.A1 = static_cast<double>(assist.utc.a1) * pow(2.0, -50);
|
||||
gps_utc.DeltaT_LS = static_cast<int32_t>(assist.utc.delta_tls);
|
||||
gps_utc.DeltaT_LSF = static_cast<int32_t>(assist.utc.delta_tlsf);
|
||||
gps_utc.tot = static_cast<int32_t>(assist.utc.tot) * pow(2.0, 12);
|
||||
gps_utc.DN = static_cast<int32_t>(assist.utc.dn);
|
||||
gps_utc.WN_T = static_cast<int32_t>(assist.utc.wnt);
|
||||
gps_utc.WN_LSF = static_cast<int32_t>(assist.utc.wnlsf);
|
||||
gps_utc.valid = true;
|
||||
}
|
||||
|
||||
// READ IONOSPHERIC MODEL
|
||||
if (assist.set & SUPL_RRLP_ASSIST_IONO)
|
||||
{
|
||||
gps_iono.d_alpha0 = static_cast<double>(assist.iono.a0) * ALPHA_0_LSB;
|
||||
gps_iono.d_alpha1 = static_cast<double>(assist.iono.a1) * ALPHA_1_LSB;
|
||||
gps_iono.d_alpha2 = static_cast<double>(assist.iono.a2) * ALPHA_2_LSB;
|
||||
gps_iono.d_alpha3 = static_cast<double>(assist.iono.a3) * ALPHA_3_LSB;
|
||||
gps_iono.alpha0 = static_cast<double>(assist.iono.a0) * ALPHA_0_LSB;
|
||||
gps_iono.alpha1 = static_cast<double>(assist.iono.a1) * ALPHA_1_LSB;
|
||||
gps_iono.alpha2 = static_cast<double>(assist.iono.a2) * ALPHA_2_LSB;
|
||||
gps_iono.alpha3 = static_cast<double>(assist.iono.a3) * ALPHA_3_LSB;
|
||||
|
||||
gps_iono.d_beta0 = static_cast<double>(assist.iono.b0) * BETA_0_LSB;
|
||||
gps_iono.d_beta1 = static_cast<double>(assist.iono.b1) * BETA_1_LSB;
|
||||
gps_iono.d_beta2 = static_cast<double>(assist.iono.b2) * BETA_2_LSB;
|
||||
gps_iono.d_beta3 = static_cast<double>(assist.iono.b3) * BETA_3_LSB;
|
||||
gps_iono.beta0 = static_cast<double>(assist.iono.b0) * BETA_0_LSB;
|
||||
gps_iono.beta1 = static_cast<double>(assist.iono.b1) * BETA_1_LSB;
|
||||
gps_iono.beta2 = static_cast<double>(assist.iono.b2) * BETA_2_LSB;
|
||||
gps_iono.beta3 = static_cast<double>(assist.iono.b3) * BETA_3_LSB;
|
||||
gps_iono.valid = true;
|
||||
}
|
||||
|
||||
@ -252,17 +252,17 @@ void Gnss_Sdr_Supl_Client::read_supl_data()
|
||||
gps_almanac_map.insert(std::pair<int, Gps_Almanac>(a->prn, gps_almanac_entry));
|
||||
gps_almanac_iterator = this->gps_almanac_map.find(a->prn);
|
||||
}
|
||||
gps_almanac_iterator->second.i_satellite_PRN = a->prn;
|
||||
gps_almanac_iterator->second.d_A_f0 = static_cast<double>(a->AF0) * pow(2.0, -20);
|
||||
gps_almanac_iterator->second.d_A_f1 = static_cast<double>(a->AF1) * pow(2.0, -38);
|
||||
gps_almanac_iterator->second.d_Delta_i = static_cast<double>(a->Ksii) * pow(2.0, -19);
|
||||
gps_almanac_iterator->second.d_OMEGA = static_cast<double>(a->w) * pow(2.0, -23);
|
||||
gps_almanac_iterator->second.d_OMEGA0 = static_cast<double>(a->OMEGA_0) * pow(2.0, -23);
|
||||
gps_almanac_iterator->second.d_sqrt_A = static_cast<double>(a->A_sqrt) * pow(2.0, -11);
|
||||
gps_almanac_iterator->second.d_OMEGA_DOT = static_cast<double>(a->OMEGA_dot) * pow(2.0, -38);
|
||||
gps_almanac_iterator->second.i_Toa = static_cast<int32_t>(a->toa * pow(2.0, 12));
|
||||
gps_almanac_iterator->second.d_e_eccentricity = static_cast<double>(a->e) * pow(2.0, -21);
|
||||
gps_almanac_iterator->second.d_M_0 = static_cast<double>(a->M0) * pow(2.0, -23);
|
||||
gps_almanac_iterator->second.PRN = a->prn;
|
||||
gps_almanac_iterator->second.af0 = static_cast<double>(a->AF0) * pow(2.0, -20);
|
||||
gps_almanac_iterator->second.af1 = static_cast<double>(a->AF1) * pow(2.0, -38);
|
||||
gps_almanac_iterator->second.delta_i = static_cast<double>(a->Ksii) * pow(2.0, -19);
|
||||
gps_almanac_iterator->second.omega = static_cast<double>(a->w) * pow(2.0, -23);
|
||||
gps_almanac_iterator->second.OMEGA_0 = static_cast<double>(a->OMEGA_0) * pow(2.0, -23);
|
||||
gps_almanac_iterator->second.sqrtA = static_cast<double>(a->A_sqrt) * pow(2.0, -11);
|
||||
gps_almanac_iterator->second.OMEGAdot = static_cast<double>(a->OMEGA_dot) * pow(2.0, -38);
|
||||
gps_almanac_iterator->second.toa = static_cast<int32_t>(a->toa * pow(2.0, 12));
|
||||
gps_almanac_iterator->second.ecc = static_cast<double>(a->e) * pow(2.0, -21);
|
||||
gps_almanac_iterator->second.M_0 = static_cast<double>(a->M0) * pow(2.0, -23);
|
||||
}
|
||||
}
|
||||
|
||||
@ -284,46 +284,46 @@ void Gnss_Sdr_Supl_Client::read_supl_data()
|
||||
}
|
||||
if (gps_time.valid)
|
||||
{
|
||||
gps_eph_iterator->second.i_GPS_week = assist.time.gps_week;
|
||||
gps_eph_iterator->second.WN = assist.time.gps_week;
|
||||
/* TS 44.031: GPSTOW, range 0-604799.92, resolution 0.08 sec, 23-bit presentation */
|
||||
gps_eph_iterator->second.d_TOW = static_cast<double>(assist.time.gps_tow) * 0.08;
|
||||
gps_eph_iterator->second.tow = static_cast<double>(assist.time.gps_tow) * 0.08;
|
||||
}
|
||||
else
|
||||
{
|
||||
gps_eph_iterator->second.i_GPS_week = 0;
|
||||
gps_eph_iterator->second.d_TOW = 0;
|
||||
gps_eph_iterator->second.WN = 0;
|
||||
gps_eph_iterator->second.tow = 0;
|
||||
}
|
||||
gps_eph_iterator->second.i_satellite_PRN = e->prn;
|
||||
gps_eph_iterator->second.PRN = e->prn;
|
||||
// SV navigation model
|
||||
gps_eph_iterator->second.i_code_on_L2 = e->bits;
|
||||
gps_eph_iterator->second.i_SV_accuracy = e->ura; // User Range Accuracy (URA)
|
||||
gps_eph_iterator->second.i_SV_health = e->health;
|
||||
gps_eph_iterator->second.d_IODC = static_cast<double>(e->IODC);
|
||||
gps_eph_iterator->second.code_on_L2 = e->bits;
|
||||
gps_eph_iterator->second.SV_accuracy = e->ura; // User Range Accuracy (URA)
|
||||
gps_eph_iterator->second.SV_health = e->health;
|
||||
gps_eph_iterator->second.IODC = static_cast<double>(e->IODC);
|
||||
// miss P flag (1 bit)
|
||||
// miss SF1 Reserved (87 bits)
|
||||
gps_eph_iterator->second.d_TGD = static_cast<double>(e->tgd) * T_GD_LSB;
|
||||
gps_eph_iterator->second.d_Toc = static_cast<double>(e->toc) * T_OC_LSB;
|
||||
gps_eph_iterator->second.d_A_f0 = static_cast<double>(e->AF0) * A_F0_LSB;
|
||||
gps_eph_iterator->second.d_A_f1 = static_cast<double>(e->AF1) * A_F1_LSB;
|
||||
gps_eph_iterator->second.d_A_f2 = static_cast<double>(e->AF2) * A_F2_LSB;
|
||||
gps_eph_iterator->second.d_Crc = static_cast<double>(e->Crc) * C_RC_LSB;
|
||||
gps_eph_iterator->second.d_Delta_n = static_cast<double>(e->delta_n) * DELTA_N_LSB;
|
||||
gps_eph_iterator->second.d_M_0 = static_cast<double>(e->M0) * M_0_LSB;
|
||||
gps_eph_iterator->second.d_Cuc = static_cast<double>(e->Cuc) * C_UC_LSB;
|
||||
gps_eph_iterator->second.d_e_eccentricity = static_cast<double>(e->e) * ECCENTRICITY_LSB;
|
||||
gps_eph_iterator->second.d_Cus = static_cast<double>(e->Cus) * C_US_LSB;
|
||||
gps_eph_iterator->second.d_sqrt_A = static_cast<double>(e->A_sqrt) * SQRT_A_LSB;
|
||||
gps_eph_iterator->second.d_Toe = static_cast<double>(e->toe) * T_OE_LSB;
|
||||
gps_eph_iterator->second.TGD = static_cast<double>(e->tgd) * T_GD_LSB;
|
||||
gps_eph_iterator->second.toc = static_cast<double>(e->toc) * T_OC_LSB;
|
||||
gps_eph_iterator->second.af0 = static_cast<double>(e->AF0) * A_F0_LSB;
|
||||
gps_eph_iterator->second.af1 = static_cast<double>(e->AF1) * A_F1_LSB;
|
||||
gps_eph_iterator->second.af2 = static_cast<double>(e->AF2) * A_F2_LSB;
|
||||
gps_eph_iterator->second.Crc = static_cast<double>(e->Crc) * C_RC_LSB;
|
||||
gps_eph_iterator->second.delta_n = static_cast<double>(e->delta_n) * DELTA_N_LSB;
|
||||
gps_eph_iterator->second.M_0 = static_cast<double>(e->M0) * M_0_LSB;
|
||||
gps_eph_iterator->second.Cuc = static_cast<double>(e->Cuc) * C_UC_LSB;
|
||||
gps_eph_iterator->second.ecc = static_cast<double>(e->e) * ECCENTRICITY_LSB;
|
||||
gps_eph_iterator->second.Cus = static_cast<double>(e->Cus) * C_US_LSB;
|
||||
gps_eph_iterator->second.sqrtA = static_cast<double>(e->A_sqrt) * SQRT_A_LSB;
|
||||
gps_eph_iterator->second.toe = static_cast<double>(e->toe) * T_OE_LSB;
|
||||
// miss fit interval flag (1 bit)
|
||||
gps_eph_iterator->second.i_AODO = e->AODA * AODO_LSB;
|
||||
gps_eph_iterator->second.d_Cic = static_cast<double>(e->Cic) * C_IC_LSB;
|
||||
gps_eph_iterator->second.d_OMEGA0 = static_cast<double>(e->OMEGA_0) * OMEGA_0_LSB;
|
||||
gps_eph_iterator->second.d_Cis = static_cast<double>(e->Cis) * C_IS_LSB;
|
||||
gps_eph_iterator->second.d_i_0 = static_cast<double>(e->i0) * I_0_LSB;
|
||||
gps_eph_iterator->second.d_Crs = static_cast<double>(e->Crs) * C_RS_LSB;
|
||||
gps_eph_iterator->second.d_OMEGA = static_cast<double>(e->w) * OMEGA_LSB;
|
||||
gps_eph_iterator->second.d_OMEGA_DOT = static_cast<double>(e->OMEGA_dot) * OMEGA_DOT_LSB;
|
||||
gps_eph_iterator->second.d_IDOT = static_cast<double>(e->i_dot) * I_DOT_LSB;
|
||||
gps_eph_iterator->second.AODO = e->AODA * AODO_LSB;
|
||||
gps_eph_iterator->second.Cic = static_cast<double>(e->Cic) * C_IC_LSB;
|
||||
gps_eph_iterator->second.OMEGA_0 = static_cast<double>(e->OMEGA_0) * OMEGA_0_LSB;
|
||||
gps_eph_iterator->second.Cis = static_cast<double>(e->Cis) * C_IS_LSB;
|
||||
gps_eph_iterator->second.i_0 = static_cast<double>(e->i0) * I_0_LSB;
|
||||
gps_eph_iterator->second.Crs = static_cast<double>(e->Crs) * C_RS_LSB;
|
||||
gps_eph_iterator->second.omega = static_cast<double>(e->w) * OMEGA_LSB;
|
||||
gps_eph_iterator->second.OMEGAdot = static_cast<double>(e->OMEGA_dot) * OMEGA_DOT_LSB;
|
||||
gps_eph_iterator->second.idot = static_cast<double>(e->i_dot) * I_DOT_LSB;
|
||||
}
|
||||
}
|
||||
|
||||
@ -345,10 +345,10 @@ void Gnss_Sdr_Supl_Client::read_supl_data()
|
||||
gps_acq_iterator = this->gps_acq_map.find(e->prn);
|
||||
}
|
||||
// fill the acquisition assistance structure
|
||||
gps_acq_iterator->second.i_satellite_PRN = e->prn;
|
||||
gps_acq_iterator->second.d_TOW = static_cast<double>(assist.acq_time);
|
||||
gps_acq_iterator->second.d_Doppler0 = static_cast<double>(e->doppler0);
|
||||
gps_acq_iterator->second.d_Doppler1 = static_cast<double>(e->doppler1);
|
||||
gps_acq_iterator->second.PRN = e->prn;
|
||||
gps_acq_iterator->second.tow = static_cast<double>(assist.acq_time);
|
||||
gps_acq_iterator->second.Doppler0 = static_cast<double>(e->doppler0);
|
||||
gps_acq_iterator->second.Doppler1 = static_cast<double>(e->doppler1);
|
||||
gps_acq_iterator->second.dopplerUncertainty = static_cast<double>(e->d_win);
|
||||
gps_acq_iterator->second.Code_Phase = static_cast<double>(e->code_ph);
|
||||
gps_acq_iterator->second.Code_Phase_int = static_cast<double>(e->code_ph_int);
|
||||
@ -754,7 +754,7 @@ bool Gnss_Sdr_Supl_Client::load_gal_iono_xml(const std::string& file_name)
|
||||
|
||||
bool Gnss_Sdr_Supl_Client::save_gal_iono_xml(const std::string& file_name, Galileo_Iono& iono)
|
||||
{
|
||||
if (iono.ai0_5 != 0.0)
|
||||
if (iono.ai0 != 0.0)
|
||||
{
|
||||
std::ofstream ofs;
|
||||
try
|
||||
@ -864,19 +864,19 @@ bool Gnss_Sdr_Supl_Client::read_gal_almanac_from_gsa(const std::string& file_nam
|
||||
try
|
||||
{
|
||||
uint32_t prn = static_cast<uint32_t>(std::stoi(almanac.child_value("SVID")));
|
||||
gal_alm.i_satellite_PRN = prn;
|
||||
gal_alm.i_Toa = std::stoi(almanac.child("almanac").child_value("t0a"));
|
||||
gal_alm.i_WNa = std::stoi(almanac.child("almanac").child_value("wna"));
|
||||
gal_alm.i_IODa = std::stoi(almanac.child("almanac").child_value("iod"));
|
||||
gal_alm.d_Delta_i = std::stod(almanac.child("almanac").child_value("deltai"));
|
||||
gal_alm.d_M_0 = std::stod(almanac.child("almanac").child_value("m0"));
|
||||
gal_alm.d_e_eccentricity = std::stod(almanac.child("almanac").child_value("ecc"));
|
||||
gal_alm.d_Delta_sqrt_A = std::stod(almanac.child("almanac").child_value("aSqRoot"));
|
||||
gal_alm.d_OMEGA0 = std::stod(almanac.child("almanac").child_value("omega0"));
|
||||
gal_alm.d_OMEGA = std::stod(almanac.child("almanac").child_value("w"));
|
||||
gal_alm.d_OMEGA_DOT = std::stod(almanac.child("almanac").child_value("omegaDot"));
|
||||
gal_alm.d_A_f0 = std::stod(almanac.child("almanac").child_value("af0"));
|
||||
gal_alm.d_A_f1 = std::stod(almanac.child("almanac").child_value("af1"));
|
||||
gal_alm.PRN = prn;
|
||||
gal_alm.toa = std::stoi(almanac.child("almanac").child_value("t0a"));
|
||||
gal_alm.WNa = std::stoi(almanac.child("almanac").child_value("wna"));
|
||||
gal_alm.IODa = std::stoi(almanac.child("almanac").child_value("iod"));
|
||||
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.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"));
|
||||
gal_alm.af0 = std::stod(almanac.child("almanac").child_value("af0"));
|
||||
gal_alm.af1 = std::stod(almanac.child("almanac").child_value("af1"));
|
||||
gal_alm.E5b_HS = std::stoi(almanac.child("svINavSignalStatus").child_value("statusE5b"));
|
||||
gal_alm.E1B_HS = std::stoi(almanac.child("svINavSignalStatus").child_value("statusE1B"));
|
||||
gal_alm.E5a_HS = std::stoi(almanac.child("svFNavSignalStatus").child_value("statusE5a"));
|
||||
|
@ -496,7 +496,7 @@ bool ControlThread::read_assistance_from_XML()
|
||||
gps_eph_iter != supl_client_ephemeris_.gps_ephemeris_map.cend();
|
||||
gps_eph_iter++)
|
||||
{
|
||||
std::cout << "From XML file: Read NAV ephemeris for satellite " << Gnss_Satellite("GPS", gps_eph_iter->second.i_satellite_PRN) << '\n';
|
||||
std::cout << "From XML file: Read NAV ephemeris for satellite " << Gnss_Satellite("GPS", gps_eph_iter->second.PRN) << '\n';
|
||||
const std::shared_ptr<Gps_Ephemeris> tmp_obj = std::make_shared<Gps_Ephemeris>(gps_eph_iter->second);
|
||||
flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj));
|
||||
}
|
||||
@ -526,7 +526,7 @@ bool ControlThread::read_assistance_from_XML()
|
||||
gps_alm_iter != supl_client_ephemeris_.gps_almanac_map.cend();
|
||||
gps_alm_iter++)
|
||||
{
|
||||
std::cout << "From XML file: Read GPS almanac for satellite " << Gnss_Satellite("GPS", gps_alm_iter->second.i_satellite_PRN) << '\n';
|
||||
std::cout << "From XML file: Read GPS almanac for satellite " << Gnss_Satellite("GPS", gps_alm_iter->second.PRN) << '\n';
|
||||
const std::shared_ptr<Gps_Almanac> tmp_obj = std::make_shared<Gps_Almanac>(gps_alm_iter->second);
|
||||
flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj));
|
||||
}
|
||||
@ -543,7 +543,7 @@ bool ControlThread::read_assistance_from_XML()
|
||||
gal_eph_iter != supl_client_ephemeris_.gal_ephemeris_map.cend();
|
||||
gal_eph_iter++)
|
||||
{
|
||||
std::cout << "From XML file: Read ephemeris for satellite " << Gnss_Satellite("Galileo", gal_eph_iter->second.i_satellite_PRN) << '\n';
|
||||
std::cout << "From XML file: Read ephemeris for satellite " << Gnss_Satellite("Galileo", gal_eph_iter->second.PRN) << '\n';
|
||||
const std::shared_ptr<Galileo_Ephemeris> tmp_obj = std::make_shared<Galileo_Ephemeris>(gal_eph_iter->second);
|
||||
flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj));
|
||||
}
|
||||
@ -573,7 +573,7 @@ bool ControlThread::read_assistance_from_XML()
|
||||
gal_alm_iter != supl_client_ephemeris_.gal_almanac_map.cend();
|
||||
gal_alm_iter++)
|
||||
{
|
||||
std::cout << "From XML file: Read Galileo almanac for satellite " << Gnss_Satellite("Galileo", gal_alm_iter->second.i_satellite_PRN) << '\n';
|
||||
std::cout << "From XML file: Read Galileo almanac for satellite " << Gnss_Satellite("Galileo", gal_alm_iter->second.PRN) << '\n';
|
||||
const std::shared_ptr<Galileo_Almanac> tmp_obj = std::make_shared<Galileo_Almanac>(gal_alm_iter->second);
|
||||
flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj));
|
||||
}
|
||||
@ -590,7 +590,7 @@ bool ControlThread::read_assistance_from_XML()
|
||||
gps_cnav_eph_iter != supl_client_ephemeris_.gps_cnav_ephemeris_map.cend();
|
||||
gps_cnav_eph_iter++)
|
||||
{
|
||||
std::cout << "From XML file: Read CNAV ephemeris for satellite " << Gnss_Satellite("GPS", gps_cnav_eph_iter->second.i_satellite_PRN) << '\n';
|
||||
std::cout << "From XML file: Read CNAV ephemeris for satellite " << Gnss_Satellite("GPS", gps_cnav_eph_iter->second.PRN) << '\n';
|
||||
const std::shared_ptr<Gps_CNAV_Ephemeris> tmp_obj = std::make_shared<Gps_CNAV_Ephemeris>(gps_cnav_eph_iter->second);
|
||||
flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj));
|
||||
}
|
||||
@ -615,7 +615,7 @@ bool ControlThread::read_assistance_from_XML()
|
||||
glo_gnav_eph_iter != supl_client_ephemeris_.glonass_gnav_ephemeris_map.cend();
|
||||
glo_gnav_eph_iter++)
|
||||
{
|
||||
std::cout << "From XML file: Read GLONASS GNAV ephemeris for satellite " << Gnss_Satellite("GLONASS", glo_gnav_eph_iter->second.i_satellite_PRN) << '\n';
|
||||
std::cout << "From XML file: Read GLONASS GNAV ephemeris for satellite " << Gnss_Satellite("GLONASS", glo_gnav_eph_iter->second.PRN) << '\n';
|
||||
const std::shared_ptr<Glonass_Gnav_Ephemeris> tmp_obj = std::make_shared<Glonass_Gnav_Ephemeris>(glo_gnav_eph_iter->second);
|
||||
flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj));
|
||||
}
|
||||
@ -744,7 +744,7 @@ void ControlThread::assist_GNSS()
|
||||
gps_eph_iter != supl_client_ephemeris_.gps_ephemeris_map.cend();
|
||||
gps_eph_iter++)
|
||||
{
|
||||
std::cout << "SUPL: Received ephemeris data for satellite " << Gnss_Satellite("GPS", gps_eph_iter->second.i_satellite_PRN) << '\n';
|
||||
std::cout << "SUPL: Received ephemeris data for satellite " << Gnss_Satellite("GPS", gps_eph_iter->second.PRN) << '\n';
|
||||
const std::shared_ptr<Gps_Ephemeris> tmp_obj = std::make_shared<Gps_Ephemeris>(gps_eph_iter->second);
|
||||
flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj));
|
||||
}
|
||||
@ -781,7 +781,7 @@ void ControlThread::assist_GNSS()
|
||||
gps_alm_iter != supl_client_ephemeris_.gps_almanac_map.cend();
|
||||
gps_alm_iter++)
|
||||
{
|
||||
std::cout << "SUPL: Received almanac data for satellite " << Gnss_Satellite("GPS", gps_alm_iter->second.i_satellite_PRN) << '\n';
|
||||
std::cout << "SUPL: Received almanac data for satellite " << Gnss_Satellite("GPS", gps_alm_iter->second.PRN) << '\n';
|
||||
const std::shared_ptr<Gps_Almanac> tmp_obj = std::make_shared<Gps_Almanac>(gps_alm_iter->second);
|
||||
flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj));
|
||||
}
|
||||
@ -835,8 +835,8 @@ void ControlThread::assist_GNSS()
|
||||
gps_acq_iter != supl_client_acquisition_.gps_acq_map.cend();
|
||||
gps_acq_iter++)
|
||||
{
|
||||
std::cout << "SUPL: Received acquisition assistance data for satellite " << Gnss_Satellite("GPS", gps_acq_iter->second.i_satellite_PRN) << '\n';
|
||||
global_gps_acq_assist_map.write(gps_acq_iter->second.i_satellite_PRN, gps_acq_iter->second);
|
||||
std::cout << "SUPL: Received acquisition assistance data for satellite " << Gnss_Satellite("GPS", gps_acq_iter->second.PRN) << '\n';
|
||||
global_gps_acq_assist_map.write(gps_acq_iter->second.PRN, gps_acq_iter->second);
|
||||
}
|
||||
if (supl_client_acquisition_.gps_ref_loc.valid == true)
|
||||
{
|
||||
@ -1006,10 +1006,10 @@ std::vector<std::pair<int, Gnss_Satellite>> ControlThread::get_visible_sats(time
|
||||
// push sat
|
||||
if (El > 0)
|
||||
{
|
||||
std::cout << "Using GPS Ephemeris: Sat " << it.second.i_satellite_PRN << " Az: " << Az << " El: " << El << '\n';
|
||||
std::cout << "Using GPS Ephemeris: Sat " << it.second.PRN << " Az: " << Az << " El: " << El << '\n';
|
||||
available_satellites.emplace_back(floor(El),
|
||||
(Gnss_Satellite(std::string("GPS"), it.second.i_satellite_PRN)));
|
||||
visible_gps.push_back(it.second.i_satellite_PRN);
|
||||
(Gnss_Satellite(std::string("GPS"), it.second.PRN)));
|
||||
visible_gps.push_back(it.second.PRN);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1031,10 +1031,10 @@ std::vector<std::pair<int, Gnss_Satellite>> ControlThread::get_visible_sats(time
|
||||
// push sat
|
||||
if (El > 0)
|
||||
{
|
||||
std::cout << "Using Galileo Ephemeris: Sat " << it.second.i_satellite_PRN << " Az: " << Az << " El: " << El << '\n';
|
||||
std::cout << "Using Galileo Ephemeris: Sat " << it.second.PRN << " Az: " << Az << " El: " << El << '\n';
|
||||
available_satellites.emplace_back(floor(El),
|
||||
(Gnss_Satellite(std::string("Galileo"), it.second.i_satellite_PRN)));
|
||||
visible_gal.push_back(it.second.i_satellite_PRN);
|
||||
(Gnss_Satellite(std::string("Galileo"), it.second.PRN)));
|
||||
visible_gal.push_back(it.second.PRN);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1058,12 +1058,12 @@ std::vector<std::pair<int, Gnss_Satellite>> ControlThread::get_visible_sats(time
|
||||
std::vector<unsigned int>::iterator it2;
|
||||
if (El > 0)
|
||||
{
|
||||
it2 = std::find(visible_gps.begin(), visible_gps.end(), it.second.i_satellite_PRN);
|
||||
it2 = std::find(visible_gps.begin(), visible_gps.end(), it.second.PRN);
|
||||
if (it2 == visible_gps.end())
|
||||
{
|
||||
std::cout << "Using GPS Almanac: Sat " << it.second.i_satellite_PRN << " Az: " << Az << " El: " << El << '\n';
|
||||
std::cout << "Using GPS Almanac: Sat " << it.second.PRN << " Az: " << Az << " El: " << El << '\n';
|
||||
available_satellites.emplace_back(floor(El),
|
||||
(Gnss_Satellite(std::string("GPS"), it.second.i_satellite_PRN)));
|
||||
(Gnss_Satellite(std::string("GPS"), it.second.PRN)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1088,12 +1088,12 @@ std::vector<std::pair<int, Gnss_Satellite>> ControlThread::get_visible_sats(time
|
||||
std::vector<unsigned int>::iterator it2;
|
||||
if (El > 0)
|
||||
{
|
||||
it2 = std::find(visible_gal.begin(), visible_gal.end(), it.second.i_satellite_PRN);
|
||||
it2 = std::find(visible_gal.begin(), visible_gal.end(), it.second.PRN);
|
||||
if (it2 == visible_gal.end())
|
||||
{
|
||||
std::cout << "Using Galileo Almanac: Sat " << it.second.i_satellite_PRN << " Az: " << Az << " El: " << El << '\n';
|
||||
std::cout << "Using Galileo Almanac: Sat " << it.second.PRN << " Az: " << Az << " El: " << El << '\n';
|
||||
available_satellites.emplace_back(floor(El),
|
||||
(Gnss_Satellite(std::string("Galileo"), it.second.i_satellite_PRN)));
|
||||
(Gnss_Satellite(std::string("Galileo"), it.second.PRN)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1116,28 +1116,28 @@ void ControlThread::gps_acq_assist_data_collector() const
|
||||
while (stop_ == false)
|
||||
{
|
||||
global_gps_acq_assist_queue.wait_and_pop(gps_acq);
|
||||
if (gps_acq.i_satellite_PRN == 0)
|
||||
if (gps_acq.PRN == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
// DEBUG MESSAGE
|
||||
std::cout << "Acquisition assistance record has arrived from SAT ID "
|
||||
<< gps_acq.i_satellite_PRN
|
||||
<< gps_acq.PRN
|
||||
<< " with Doppler "
|
||||
<< gps_acq.d_Doppler0
|
||||
<< gps_acq.Doppler0
|
||||
<< " [Hz]\n";
|
||||
// insert new acq record to the global ephemeris map
|
||||
if (global_gps_acq_assist_map.read(gps_acq.i_satellite_PRN, gps_acq_old))
|
||||
if (global_gps_acq_assist_map.read(gps_acq.PRN, gps_acq_old))
|
||||
{
|
||||
std::cout << "Acquisition assistance record updated\n";
|
||||
global_gps_acq_assist_map.write(gps_acq.i_satellite_PRN, gps_acq);
|
||||
global_gps_acq_assist_map.write(gps_acq.PRN, gps_acq);
|
||||
}
|
||||
else
|
||||
{
|
||||
// insert new acq record
|
||||
LOG(INFO) << "New acq assist record inserted";
|
||||
global_gps_acq_assist_map.write(gps_acq.i_satellite_PRN, gps_acq);
|
||||
global_gps_acq_assist_map.write(gps_acq.PRN, gps_acq);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
|
||||
set(SYSTEM_PARAMETERS_SOURCES
|
||||
gnss_ephemeris.cc
|
||||
gnss_satellite.cc
|
||||
gnss_signal.cc
|
||||
gps_navigation_message.cc
|
||||
@ -19,7 +20,6 @@ set(SYSTEM_PARAMETERS_SOURCES
|
||||
beidou_dnav_navigation_message.cc
|
||||
beidou_dnav_ephemeris.cc
|
||||
sbas_ephemeris.cc
|
||||
gps_cnav_ephemeris.cc
|
||||
gps_cnav_navigation_message.cc
|
||||
glonass_gnav_ephemeris.cc
|
||||
glonass_gnav_utc_model.cc
|
||||
@ -27,6 +27,7 @@ set(SYSTEM_PARAMETERS_SOURCES
|
||||
)
|
||||
|
||||
set(SYSTEM_PARAMETERS_HEADERS
|
||||
gnss_ephemeris.h
|
||||
gnss_satellite.h
|
||||
gnss_signal.h
|
||||
gps_navigation_message.h
|
||||
|
@ -159,6 +159,8 @@ constexpr int32_t CNAV_DN_LSB = 1;
|
||||
const std::vector<std::pair<int32_t, int32_t> > CNAV_DELTA_TLSF({{218, 8}});
|
||||
constexpr int32_t CNAV_DELTA_TLSF_LSB = 1;
|
||||
|
||||
constexpr double CNAV_A_REF = 26559710.0; // See IS-GPS-200L, pp. 161
|
||||
constexpr double CNAV_OMEGA_DOT_REF = -2.6e-9; // semicircles / s, see IS-GPS-200L pp. 160
|
||||
|
||||
// TODO: Add more frames (Almanac, etc...)
|
||||
|
||||
|
@ -46,7 +46,8 @@ public:
|
||||
template <class Archive>
|
||||
|
||||
/*!
|
||||
* \brief Serialize is a boost standard method to be called by the boost XML serialization. Here is used to save the Ref location on disk file.
|
||||
* \brief Serialize is a boost standard method to be called by the boost XML
|
||||
* serialization. Here is used to save the Ref location on disk file.
|
||||
*/
|
||||
inline void serialize(Archive& archive, const unsigned int version)
|
||||
{
|
||||
@ -54,10 +55,10 @@ public:
|
||||
if (version)
|
||||
{
|
||||
};
|
||||
archive& make_nvp("lat", lat);
|
||||
archive& make_nvp("lon", lon);
|
||||
archive& make_nvp("uncertainty", uncertainty);
|
||||
archive& make_nvp("valid", valid);
|
||||
archive& BOOST_SERIALIZATION_NVP(lat);
|
||||
archive& BOOST_SERIALIZATION_NVP(lon);
|
||||
archive& BOOST_SERIALIZATION_NVP(uncertainty);
|
||||
archive& BOOST_SERIALIZATION_NVP(valid);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -38,7 +38,7 @@ public:
|
||||
*/
|
||||
Agnss_Ref_Time() = default;
|
||||
|
||||
double d_TOW{};
|
||||
double tow{};
|
||||
double d_Week{};
|
||||
double d_tv_sec{};
|
||||
double d_tv_usec{};
|
||||
@ -47,19 +47,19 @@ public:
|
||||
template <class Archive>
|
||||
|
||||
/*!
|
||||
* \brief Serialize is a boost standard method to be called by the boost XML serialization. Here is used to save the ref time data on disk file.
|
||||
* \brief Serialize is a boost standard method to be called by the boost XML
|
||||
* serialization. Here is used to save the ref time data on disk file.
|
||||
*/
|
||||
inline void serialize(Archive& archive, const unsigned int version)
|
||||
{
|
||||
using boost::serialization::make_nvp;
|
||||
if (version)
|
||||
{
|
||||
};
|
||||
archive& make_nvp("d_TOW", d_TOW);
|
||||
archive& make_nvp("d_Week", d_Week);
|
||||
archive& make_nvp("d_tv_sec", d_tv_sec);
|
||||
archive& make_nvp("d_tv_usec", d_tv_usec);
|
||||
archive& make_nvp("valid", valid);
|
||||
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(valid);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -37,18 +37,18 @@ public:
|
||||
*/
|
||||
Beidou_Dnav_Almanac() = default;
|
||||
|
||||
unsigned int i_satellite_PRN{}; //!< SV PRN NUMBER
|
||||
double d_Delta_i{};
|
||||
double d_Toa{}; //!< Almanac data reference time of week [s]
|
||||
double d_M_0{}; //!< Mean Anomaly at Reference Time [semi-circles]
|
||||
double d_e_eccentricity{}; //!< Eccentricity [dimensionless]
|
||||
double d_sqrt_A{}; //!< Square Root of the Semi-Major Axis [sqrt(m)]
|
||||
double d_OMEGA0{}; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles]
|
||||
double d_OMEGA{}; //!< Argument of Perigee [semi-cicles]
|
||||
double d_OMEGA_DOT{}; //!< Rate of Right Ascension [semi-circles/s]
|
||||
int i_SV_health{}; //!< SV Health
|
||||
double d_A_f0{}; //!< Coefficient 0 of code phase offset model [s]
|
||||
double d_A_f1{}; //!< Coefficient 1 of code phase offset model [s/s]
|
||||
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]
|
||||
|
||||
template <class Archive>
|
||||
|
||||
@ -57,20 +57,20 @@ public:
|
||||
if (version)
|
||||
{
|
||||
};
|
||||
ar& BOOST_SERIALIZATION_NVP(i_satellite_PRN);
|
||||
ar& BOOST_SERIALIZATION_NVP(d_Delta_i);
|
||||
ar& BOOST_SERIALIZATION_NVP(d_Toa);
|
||||
// ar& BOOST_SERIALIZATION_NVP(i_WNa);
|
||||
ar& BOOST_SERIALIZATION_NVP(d_M_0);
|
||||
ar& BOOST_SERIALIZATION_NVP(d_e_eccentricity);
|
||||
ar& BOOST_SERIALIZATION_NVP(d_sqrt_A);
|
||||
ar& BOOST_SERIALIZATION_NVP(d_OMEGA0);
|
||||
ar& BOOST_SERIALIZATION_NVP(d_OMEGA);
|
||||
ar& BOOST_SERIALIZATION_NVP(d_OMEGA_DOT);
|
||||
ar& BOOST_SERIALIZATION_NVP(i_SV_health);
|
||||
// ar& BOOST_SERIALIZATION_NVP(i_AS_status);
|
||||
ar& BOOST_SERIALIZATION_NVP(d_A_f0);
|
||||
ar& BOOST_SERIALIZATION_NVP(d_A_f1);
|
||||
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(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);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -15,10 +15,8 @@
|
||||
*/
|
||||
|
||||
#include "beidou_dnav_ephemeris.h"
|
||||
#include "Beidou_DNAV.h"
|
||||
#include "gnss_satellite.h"
|
||||
#include <cmath>
|
||||
|
||||
#include <string>
|
||||
|
||||
Beidou_Dnav_Ephemeris::Beidou_Dnav_Ephemeris()
|
||||
{
|
||||
@ -28,191 +26,5 @@ Beidou_Dnav_Ephemeris::Beidou_Dnav_Ephemeris()
|
||||
{
|
||||
satelliteBlock[i] = gnss_sat.what_block(_system, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
double Beidou_Dnav_Ephemeris::check_t(double time)
|
||||
{
|
||||
const double half_week = 302400.0; // seconds
|
||||
double corrTime = time;
|
||||
if (time > half_week)
|
||||
{
|
||||
corrTime = time - 2.0 * half_week;
|
||||
}
|
||||
else if (time < -half_week)
|
||||
{
|
||||
corrTime = time + 2.0 * half_week;
|
||||
}
|
||||
return corrTime;
|
||||
}
|
||||
|
||||
|
||||
double Beidou_Dnav_Ephemeris::sv_clock_drift(double transmitTime)
|
||||
{
|
||||
double dt = check_t(transmitTime - d_Toc);
|
||||
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
dt -= d_A_f0 + d_A_f1 * dt + d_A_f2 * (dt * dt);
|
||||
}
|
||||
d_satClkDrift = d_A_f0 + d_A_f1 * dt + d_A_f2 * (dt * dt);
|
||||
|
||||
return d_satClkDrift;
|
||||
}
|
||||
|
||||
|
||||
// compute the relativistic correction term
|
||||
double Beidou_Dnav_Ephemeris::sv_clock_relativistic_term(double transmitTime)
|
||||
{
|
||||
// Restore semi-major axis
|
||||
const double a = d_sqrt_A * d_sqrt_A;
|
||||
|
||||
// Time from ephemeris reference epoch
|
||||
const double tk = check_t(transmitTime - d_Toe);
|
||||
|
||||
// Computed mean motion
|
||||
const double n0 = sqrt(BEIDOU_GM / (a * a * a));
|
||||
|
||||
// Corrected mean motion
|
||||
const double n = n0 + d_Delta_n;
|
||||
|
||||
// Mean anomaly
|
||||
double M = d_M_0 + n * tk;
|
||||
|
||||
// Reduce mean anomaly to between 0 and 2pi
|
||||
M = fmod((M + 2.0 * GNSS_PI), (2.0 * GNSS_PI));
|
||||
|
||||
// Initial guess of eccentric anomaly
|
||||
double E = M;
|
||||
double E_old;
|
||||
double dE;
|
||||
|
||||
// --- Iteratively compute eccentric anomaly -------------------------------
|
||||
for (int ii = 1; ii < 20; ii++)
|
||||
{
|
||||
E_old = E;
|
||||
E = M + d_eccentricity * sin(E);
|
||||
dE = fmod(E - E_old, 2.0 * GNSS_PI);
|
||||
if (fabs(dE) < 1e-12)
|
||||
{
|
||||
// Necessary precision is reached, exit from the loop
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Compute relativistic correction term
|
||||
d_dtr = BEIDOU_F * d_eccentricity * d_sqrt_A * sin(E);
|
||||
return d_dtr;
|
||||
}
|
||||
|
||||
|
||||
double Beidou_Dnav_Ephemeris::satellitePosition(double transmitTime)
|
||||
{
|
||||
// Find satellite's position -----------------------------------------------
|
||||
// Restore semi-major axis
|
||||
const double a = d_sqrt_A * d_sqrt_A;
|
||||
|
||||
// Time from ephemeris reference epoch
|
||||
double tk = check_t(transmitTime - d_Toe);
|
||||
|
||||
// Computed mean motion
|
||||
const double n0 = sqrt(BEIDOU_GM / (a * a * a));
|
||||
|
||||
// Corrected mean motion
|
||||
const double n = n0 + d_Delta_n;
|
||||
|
||||
// Mean anomaly
|
||||
double M = d_M_0 + n * tk;
|
||||
|
||||
// Reduce mean anomaly to between 0 and 2pi
|
||||
M = fmod((M + 2.0 * GNSS_PI), (2.0 * GNSS_PI));
|
||||
|
||||
// Initial guess of eccentric anomaly
|
||||
double E = M;
|
||||
double E_old;
|
||||
double dE;
|
||||
|
||||
// --- Iteratively compute eccentric anomaly -------------------------------
|
||||
for (int ii = 1; ii < 20; ii++)
|
||||
{
|
||||
E_old = E;
|
||||
E = M + d_eccentricity * sin(E);
|
||||
dE = fmod(E - E_old, 2.0 * GNSS_PI);
|
||||
if (fabs(dE) < 1e-12)
|
||||
{
|
||||
// Necessary precision is reached, exit from the loop
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Compute the true anomaly
|
||||
const double sek = sin(E);
|
||||
const double cek = cos(E);
|
||||
const double OneMinusecosE = 1.0 - d_eccentricity * cek;
|
||||
const double ekdot = n / OneMinusecosE;
|
||||
|
||||
// Compute the true anomaly
|
||||
const double sq1e2 = sqrt(1.0 - d_eccentricity * d_eccentricity);
|
||||
const double tmp_Y = sq1e2 * sek;
|
||||
const double tmp_X = cek - d_eccentricity;
|
||||
const double nu = atan2(tmp_Y, tmp_X);
|
||||
|
||||
// Compute angle phi (argument of Latitude)
|
||||
const double phi = nu + d_OMEGA;
|
||||
double pkdot = sq1e2 * ekdot / OneMinusecosE;
|
||||
|
||||
// Reduce phi to between 0 and 2*pi rad
|
||||
// phi = fmod((phi), (2.0 * GNSS_PI));
|
||||
const double s2pk = sin(2.0 * phi);
|
||||
const double c2pk = cos(2.0 * phi);
|
||||
|
||||
// Correct argument of latitude
|
||||
const double u = phi + d_Cuc * c2pk + d_Cus * s2pk;
|
||||
const double cuk = cos(u);
|
||||
const double suk = sin(u);
|
||||
const double ukdot = pkdot * (1.0 + 2.0 * (d_Cus * c2pk - d_Cuc * s2pk));
|
||||
|
||||
// Correct radius
|
||||
const double r = a * (1.0 - d_eccentricity * cek) + d_Crc * c2pk + d_Crs * s2pk;
|
||||
|
||||
const double rkdot = a * d_eccentricity * sek * ekdot + 2.0 * pkdot * (d_Crs * c2pk - d_Crc * s2pk);
|
||||
|
||||
// Correct inclination
|
||||
const double i = d_i_0 + d_IDOT * tk + d_Cic * c2pk + d_Cis * s2pk;
|
||||
const double sik = sin(i);
|
||||
const double cik = cos(i);
|
||||
const double ikdot = d_IDOT + 2.0 * pkdot * (d_Cis * c2pk - d_Cic * s2pk);
|
||||
|
||||
// Compute the angle between the ascending node and the Greenwich meridian
|
||||
const double Omega = d_OMEGA0 + (d_OMEGA_DOT - BEIDOU_OMEGA_EARTH_DOT) * tk - BEIDOU_OMEGA_EARTH_DOT * d_Toe;
|
||||
const double sok = sin(Omega);
|
||||
const double cok = cos(Omega);
|
||||
|
||||
// --- Compute satellite coordinates in Earth-fixed coordinates
|
||||
const double xprime = r * cuk;
|
||||
const double yprime = r * suk;
|
||||
d_satpos_X = xprime * cok - yprime * cik * sok;
|
||||
d_satpos_Y = xprime * sok + yprime * cik * cok;
|
||||
d_satpos_Z = yprime * sik;
|
||||
|
||||
// Satellite's velocity. Can be useful for Vector Tracking loops
|
||||
const double Omega_dot = d_OMEGA_DOT - BEIDOU_OMEGA_EARTH_DOT;
|
||||
|
||||
const double xpkdot = rkdot * cuk - yprime * ukdot;
|
||||
const double ypkdot = rkdot * suk + xprime * ukdot;
|
||||
const double tmp = ypkdot * cik - d_satpos_Z * ikdot;
|
||||
|
||||
d_satvel_X = -Omega_dot * d_satpos_Y + xpkdot * cok - tmp * sok;
|
||||
d_satvel_Y = Omega_dot * d_satpos_X + xpkdot * sok + tmp * cok;
|
||||
d_satvel_Z = yprime * cik * ikdot + ypkdot * sik;
|
||||
|
||||
// Time from ephemeris reference clock
|
||||
tk = check_t(transmitTime - d_Toc);
|
||||
|
||||
double dtr_s = d_A_f0 + d_A_f1 * tk + d_A_f2 * tk * tk;
|
||||
|
||||
/* relativity correction */
|
||||
dtr_s -= 2.0 * sqrt(BEIDOU_GM * a) * d_eccentricity * sek / (SPEED_OF_LIGHT_M_S * SPEED_OF_LIGHT_M_S);
|
||||
|
||||
return dtr_s;
|
||||
this->System = 'B';
|
||||
}
|
||||
|
@ -18,6 +18,7 @@
|
||||
#ifndef GNSS_SDR_BEIDOU_DNAV_EPHEMERIS_H
|
||||
#define GNSS_SDR_BEIDOU_DNAV_EPHEMERIS_H
|
||||
|
||||
#include "gnss_ephemeris.h"
|
||||
#include <boost/serialization/nvp.hpp>
|
||||
#include <map>
|
||||
#include <string>
|
||||
@ -29,13 +30,13 @@
|
||||
|
||||
|
||||
/*!
|
||||
* \brief This class is a storage and orbital model functions for the GPS SV ephemeris data as described in
|
||||
* \brief This is a storage class for the Beidou SV ephemeris data as described in
|
||||
* BeiDou Navigation Satellite System Signal In Space Interface Control Document
|
||||
* Open Service Signal B1I (Version 3.0)
|
||||
*
|
||||
* See http://en.beidou.gov.cn/SYSTEMS/Officialdocument/201902/P020190227601370045731.pdf
|
||||
*/
|
||||
class Beidou_Dnav_Ephemeris
|
||||
class Beidou_Dnav_Ephemeris : public Gnss_Ephemeris
|
||||
{
|
||||
public:
|
||||
/*!
|
||||
@ -43,99 +44,45 @@ public:
|
||||
*/
|
||||
Beidou_Dnav_Ephemeris();
|
||||
|
||||
/*!
|
||||
* \brief Compute the ECEF SV coordinates and ECEF velocity
|
||||
* Implementation of Table 20-IV (IS-GPS-200L)
|
||||
* and compute the clock bias term including relativistic effect (return value)
|
||||
*/
|
||||
double satellitePosition(double transmitTime);
|
||||
|
||||
/*!
|
||||
* \brief Sets (\a d_satClkDrift)and returns the clock drift in seconds according to the User Algorithm for SV Clock Correction
|
||||
* (IS-GPS-200L, 20.3.3.3.3.1)
|
||||
*/
|
||||
double sv_clock_drift(double transmitTime);
|
||||
|
||||
/*!
|
||||
* \brief Sets (\a d_dtr) and returns the clock relativistic correction term in seconds according to the User Algorithm for SV Clock Correction
|
||||
* (IS-GPS-200L, 20.3.3.3.3.1)
|
||||
*/
|
||||
double sv_clock_relativistic_term(double transmitTime);
|
||||
|
||||
unsigned int i_satellite_PRN{}; //!< SV PRN NUMBER
|
||||
double d_TOW{}; //!< Time of BEIDOU Week of the ephemeris set (taken from subframes TOW) [s]
|
||||
double d_Crs{}; //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m]
|
||||
double d_Delta_n{}; //!< Mean Motion Difference From Computed Value [semi-circles/s]
|
||||
double d_M_0{}; //!< Mean Anomaly at Reference Time [semi-circles]
|
||||
double d_Cuc{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad]
|
||||
double d_eccentricity{}; //!< Eccentricity [dimensionless]
|
||||
double d_Cus{}; //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad]
|
||||
double d_sqrt_A{}; //!< Square Root of the Semi-Major Axis [sqrt(m)]
|
||||
double d_Toe{}; //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200L) [s]
|
||||
double d_Toc{}; //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200L) [s]
|
||||
double d_Cic{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad]
|
||||
double d_OMEGA0{}; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles]
|
||||
double d_Cis{}; //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad]
|
||||
double d_i_0{}; //!< Inclination Angle at Reference Time [semi-circles]
|
||||
double d_Crc{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius [m]
|
||||
double d_OMEGA{}; //!< Argument of Perigee [semi-cicles]
|
||||
double d_OMEGA_DOT{}; //!< Rate of Right Ascension [semi-circles/s]
|
||||
double d_IDOT{}; //!< Rate of Inclination Angle [semi-circles/s]
|
||||
int i_BEIDOU_week{}; //!< BEIDOU week number, aka WN [week]
|
||||
int i_SV_accuracy{}; //!< User Range Accuracy (URA) index of the SV (reference paragraph 6.2.1) for the standard positioning service user (Ref 20.3.3.3.1.3 IS-GPS-200L)
|
||||
int i_SV_health{};
|
||||
int SV_accuracy{}; //!< User Range Accuracy (URA) index of the SV (reference paragraph 6.2.1) for the standard positioning service user (Ref 20.3.3.3.1.3 IS-GPS-200L)
|
||||
int SV_health{};
|
||||
double d_TGD1{}; //!< Estimated Group Delay Differential on B1I [s]
|
||||
double d_TGD2{}; //!< Estimated Group Delay Differential on B2I [s]
|
||||
double d_AODC{}; //!< Age of Data, Clock
|
||||
double d_AODE{}; //!< Age of Data, Ephemeris
|
||||
int i_AODO{}; //!< Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s]
|
||||
int AODO{}; //!< Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s]
|
||||
|
||||
int i_sig_type{}; //!< BDS: data source (0:unknown,1:B1I,2:B1Q,3:B2I,4:B2Q,5:B3I,6:B3Q) */
|
||||
int i_nav_type{}; //!< BDS: nav type (0:unknown,1:IGSO/MEO,2:GEO) */
|
||||
|
||||
bool b_fit_interval_flag{}; //!< indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours.
|
||||
bool b_fit_interval_flag{}; //!< Curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours.
|
||||
double d_spare1{};
|
||||
double d_spare2{};
|
||||
|
||||
double d_A_f0{}; //!< Coefficient 0 of code phase offset model [s]
|
||||
double d_A_f1{}; //!< Coefficient 1 of code phase offset model [s/s]
|
||||
double d_A_f2{}; //!< Coefficient 2 of code phase offset model [s/s^2]
|
||||
|
||||
/*! \brief If true, enhanced level of integrity assurance.
|
||||
*
|
||||
* If false, indicates that the conveying signal is provided with the legacy level of integrity assurance.
|
||||
* That is, the probability that the instantaneous URE of the conveying signal exceeds 4.42 times the upper bound
|
||||
* value of the current broadcast URA index, for more than 5.2 seconds, without an accompanying alert, is less
|
||||
* than 1E-5 per hour. If true, indicates that the conveying signal is provided with an enhanced level of
|
||||
* integrity assurance. That is, the probability that the instantaneous URE of the conveying signal exceeds 5.73
|
||||
* times the upper bound value of the current broadcast URA index, for more than 5.2 seconds, without an
|
||||
* accompanying alert, is less than 1E-8 per hour.
|
||||
* If false, indicates that the conveying signal is provided with the
|
||||
* legacy level of integrity assurance. That is, the probability that the
|
||||
* instantaneous URE of the conveying signal exceeds 4.42 times the upper
|
||||
* bound value of the current broadcast URA index, for more than 5.2
|
||||
* seconds, without an accompanying alert, is less than 1E-5 per hour. If
|
||||
* true, indicates that the conveying signal is provided with an enhanced
|
||||
* level of integrity assurance. That is, the probability that the
|
||||
* instantaneous URE of the conveying signal exceeds 5.73 times the upper
|
||||
* bound value of the current broadcast URA index, for more than 5.2
|
||||
* seconds, without an accompanying alert, is less than 1E-8 per hour.
|
||||
*/
|
||||
bool b_integrity_status_flag{};
|
||||
bool b_alert_flag{}; //!< If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk.
|
||||
bool b_antispoofing_flag{}; //!< If true, the AntiSpoofing mode is ON in that SV
|
||||
|
||||
// clock terms derived from ephemeris data
|
||||
double d_satClkDrift{}; //!< GPS clock error
|
||||
double d_dtr{}; //!< relativistic clock correction term
|
||||
|
||||
// satellite positions
|
||||
double d_satpos_X{}; //!< Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis.
|
||||
double d_satpos_Y{}; //!< Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system.
|
||||
double d_satpos_Z{}; //!< Earth-fixed coordinate z of the satellite [m]. The direction of the IERS (International Earth Rotation and Reference Systems Service) Reference Pole (IRP).
|
||||
|
||||
// Satellite velocity
|
||||
double d_satvel_X{}; //!< Earth-fixed velocity coordinate x of the satellite [m]
|
||||
double d_satvel_Y{}; //!< Earth-fixed velocity coordinate y of the satellite [m]
|
||||
double d_satvel_Z{}; //!< Earth-fixed velocity coordinate z of the satellite [m]
|
||||
bool b_alert_flag{}; //!< If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk.
|
||||
bool b_antispoofing_flag{}; //!< If true, the AntiSpoofing mode is ON in that SV
|
||||
|
||||
std::map<int, std::string> satelliteBlock; //!< Map that stores to which block the PRN belongs
|
||||
|
||||
|
||||
template <class Archive>
|
||||
|
||||
/*!
|
||||
* \brief Serialize is a boost standard method to be called by the boost XML serialization. Here is used to save the ephemeris data on disk file.
|
||||
* \brief Serialize is a boost standard method to be called by the boost XML
|
||||
* serialization. Here is used to save the ephemeris data on disk file.
|
||||
*/
|
||||
void serialize(Archive& archive, const unsigned int version)
|
||||
{
|
||||
@ -144,56 +91,46 @@ public:
|
||||
{
|
||||
};
|
||||
|
||||
archive& make_nvp("i_satellite_PRN", i_satellite_PRN); // SV PRN NUMBER
|
||||
archive& make_nvp("d_TOW", d_TOW); //!< Time of GPS Week of the ephemeris set (taken from subframes TOW) [s]
|
||||
archive& make_nvp("d_AODE", d_AODE);
|
||||
archive& make_nvp("d_Crs", d_Crs); //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m]
|
||||
archive& make_nvp("d_Delta_n", d_Delta_n); //!< Mean Motion Difference From Computed Value [semi-circles/s]
|
||||
archive& make_nvp("d_M_0", d_M_0); //!< Mean Anomaly at Reference Time [semi-circles]
|
||||
archive& make_nvp("d_Cuc", d_Cuc); //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad]
|
||||
archive& make_nvp("d_e_eccentricity", d_eccentricity); //!< Eccentricity [dimensionless]
|
||||
archive& make_nvp("d_Cus", d_Cus); //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad]
|
||||
archive& make_nvp("d_sqrt_A", d_sqrt_A); //!< Square Root of the Semi-Major Axis [sqrt(m)]
|
||||
archive& make_nvp("d_Toe", d_Toe); //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200L) [s]
|
||||
archive& make_nvp("d_Toc", d_Toe); //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200L) [s]
|
||||
archive& make_nvp("d_Cic", d_Cic); //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad]
|
||||
archive& make_nvp("d_OMEGA0", d_OMEGA0); //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles]
|
||||
archive& make_nvp("d_Cis", d_Cis); //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad]
|
||||
archive& make_nvp("d_i_0", d_i_0); //!< Inclination Angle at Reference Time [semi-circles]
|
||||
archive& make_nvp("d_Crc", d_Crc); //!< Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius [m]
|
||||
archive& make_nvp("d_OMEGA", d_OMEGA); //!< Argument of Perigee [semi-cicles]
|
||||
archive& make_nvp("d_OMEGA_DOT", d_OMEGA_DOT); //!< Rate of Right Ascension [semi-circles/s]
|
||||
archive& make_nvp("d_IDOT", d_IDOT); //!< Rate of Inclination Angle [semi-circles/s]
|
||||
archive& make_nvp("i_BEIDOU_week", i_BEIDOU_week); //!< GPS week number, aka WN [week]
|
||||
archive& make_nvp("i_SV_accuracy", i_SV_accuracy); //!< User Range Accuracy (URA) index of the SV (reference paragraph 6.2.1) for the standard positioning service user (Ref 20.3.3.3.1.3 IS-GPS-200L)
|
||||
archive& make_nvp("i_SV_health", i_SV_health);
|
||||
archive& make_nvp("d_AODC", d_AODC); //!< Issue of Data, Clock
|
||||
archive& make_nvp("d_TGD1", d_TGD1); //!< Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s]
|
||||
archive& make_nvp("d_TGD2", d_TGD2); //!< Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s]
|
||||
archive& make_nvp("i_AODO", i_AODO); //!< Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s]
|
||||
archive& BOOST_SERIALIZATION_NVP(PRN);
|
||||
archive& BOOST_SERIALIZATION_NVP(M_0);
|
||||
archive& BOOST_SERIALIZATION_NVP(delta_n);
|
||||
archive& BOOST_SERIALIZATION_NVP(ecc);
|
||||
archive& BOOST_SERIALIZATION_NVP(sqrtA);
|
||||
archive& BOOST_SERIALIZATION_NVP(OMEGA_0);
|
||||
archive& BOOST_SERIALIZATION_NVP(i_0);
|
||||
archive& BOOST_SERIALIZATION_NVP(omega);
|
||||
archive& BOOST_SERIALIZATION_NVP(OMEGAdot);
|
||||
archive& BOOST_SERIALIZATION_NVP(idot);
|
||||
archive& BOOST_SERIALIZATION_NVP(Cuc);
|
||||
archive& BOOST_SERIALIZATION_NVP(Cus);
|
||||
archive& BOOST_SERIALIZATION_NVP(Crc);
|
||||
archive& BOOST_SERIALIZATION_NVP(Crs);
|
||||
archive& BOOST_SERIALIZATION_NVP(Cic);
|
||||
archive& BOOST_SERIALIZATION_NVP(Cis);
|
||||
archive& BOOST_SERIALIZATION_NVP(toe);
|
||||
archive& BOOST_SERIALIZATION_NVP(toc);
|
||||
archive& BOOST_SERIALIZATION_NVP(af0);
|
||||
archive& BOOST_SERIALIZATION_NVP(af1);
|
||||
archive& BOOST_SERIALIZATION_NVP(af2);
|
||||
archive& BOOST_SERIALIZATION_NVP(WN);
|
||||
archive& BOOST_SERIALIZATION_NVP(tow);
|
||||
archive& BOOST_SERIALIZATION_NVP(satClkDrift);
|
||||
archive& BOOST_SERIALIZATION_NVP(dtr);
|
||||
|
||||
archive& make_nvp("b_fit_interval_flag", b_fit_interval_flag); //!< indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours.
|
||||
archive& make_nvp("d_spare1", d_spare1);
|
||||
archive& make_nvp("d_spare2", d_spare2);
|
||||
|
||||
archive& make_nvp("d_A_f0", d_A_f0); //!< Coefficient 0 of code phase offset model [s]
|
||||
archive& make_nvp("d_A_f1", d_A_f1); //!< Coefficient 1 of code phase offset model [s/s]
|
||||
archive& make_nvp("d_A_f2", d_A_f2); //!< Coefficient 2 of code phase offset model [s/s^2]
|
||||
|
||||
archive& make_nvp("b_integrity_status_flag", b_integrity_status_flag);
|
||||
archive& make_nvp("b_alert_flag", b_alert_flag); //!< If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk.
|
||||
archive& make_nvp("b_antispoofing_flag", b_antispoofing_flag); //!< If true, the AntiSpoofing mode is ON in that SV
|
||||
archive& BOOST_SERIALIZATION_NVP(d_AODE);
|
||||
archive& BOOST_SERIALIZATION_NVP(SV_accuracy);
|
||||
archive& BOOST_SERIALIZATION_NVP(SV_health);
|
||||
archive& BOOST_SERIALIZATION_NVP(d_AODC);
|
||||
archive& BOOST_SERIALIZATION_NVP(d_TGD1);
|
||||
archive& BOOST_SERIALIZATION_NVP(d_TGD2);
|
||||
archive& BOOST_SERIALIZATION_NVP(AODO);
|
||||
archive& BOOST_SERIALIZATION_NVP(b_fit_interval_flag);
|
||||
archive& BOOST_SERIALIZATION_NVP(d_spare1);
|
||||
archive& BOOST_SERIALIZATION_NVP(d_spare2);
|
||||
archive& BOOST_SERIALIZATION_NVP(b_integrity_status_flag);
|
||||
archive& BOOST_SERIALIZATION_NVP(b_alert_flag);
|
||||
archive& BOOST_SERIALIZATION_NVP(b_antispoofing_flag);
|
||||
}
|
||||
|
||||
private:
|
||||
/*
|
||||
* Accounts for the beginning or end of week crossover
|
||||
*
|
||||
* See paragraph 20.3.3.3.3.1 (IS-GPS-200L)
|
||||
* \param[in] - time in seconds
|
||||
* \param[out] - corrected time, in seconds
|
||||
*/
|
||||
double check_t(double time);
|
||||
};
|
||||
|
||||
|
||||
|
@ -36,14 +36,14 @@ public:
|
||||
Beidou_Dnav_Iono() = default; //!< Default constructor
|
||||
|
||||
// Ionospheric parameters
|
||||
double d_alpha0{}; //!< Coefficient 0 of a cubic equation representing the amplitude of the vertical delay [s]
|
||||
double d_alpha1{}; //!< Coefficient 1 of a cubic equation representing the amplitude of the vertical delay [s/semi-circle]
|
||||
double d_alpha2{}; //!< Coefficient 2 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^2]
|
||||
double d_alpha3{}; //!< Coefficient 3 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^3]
|
||||
double d_beta0{}; //!< Coefficient 0 of a cubic equation representing the period of the model [s]
|
||||
double d_beta1{}; //!< Coefficient 1 of a cubic equation representing the period of the model [s/semi-circle]
|
||||
double d_beta2{}; //!< Coefficient 2 of a cubic equation representing the period of the model [s(semi-circle)^2]
|
||||
double d_beta3{}; //!< Coefficient 3 of a cubic equation representing the period of the model [s(semi-circle)^3]
|
||||
double alpha0{}; //!< Coefficient 0 of a cubic equation representing the amplitude of the vertical delay [s]
|
||||
double alpha1{}; //!< Coefficient 1 of a cubic equation representing the amplitude of the vertical delay [s/semi-circle]
|
||||
double alpha2{}; //!< Coefficient 2 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^2]
|
||||
double alpha3{}; //!< Coefficient 3 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^3]
|
||||
double beta0{}; //!< Coefficient 0 of a cubic equation representing the period of the model [s]
|
||||
double beta1{}; //!< Coefficient 1 of a cubic equation representing the period of the model [s/semi-circle]
|
||||
double beta2{}; //!< Coefficient 2 of a cubic equation representing the period of the model [s(semi-circle)^2]
|
||||
double beta3{}; //!< Coefficient 3 of a cubic equation representing the period of the model [s(semi-circle)^3]
|
||||
|
||||
bool valid{}; //!< Valid flag
|
||||
|
||||
@ -54,18 +54,17 @@ public:
|
||||
*/
|
||||
void serialize(Archive& archive, const unsigned int version)
|
||||
{
|
||||
using boost::serialization::make_nvp;
|
||||
if (version)
|
||||
{
|
||||
};
|
||||
archive& make_nvp("d_alpha0", d_alpha0);
|
||||
archive& make_nvp("d_alpha1", d_alpha1);
|
||||
archive& make_nvp("d_alpha2", d_alpha2);
|
||||
archive& make_nvp("d_alpha3", d_alpha3);
|
||||
archive& make_nvp("d_beta0", d_beta0);
|
||||
archive& make_nvp("d_beta1", d_beta1);
|
||||
archive& make_nvp("d_beta2", d_beta2);
|
||||
archive& make_nvp("d_beta3", d_beta3);
|
||||
archive& BOOST_SERIALIZATION_NVP(alpha0);
|
||||
archive& BOOST_SERIALIZATION_NVP(alpha1);
|
||||
archive& BOOST_SERIALIZATION_NVP(alpha2);
|
||||
archive& BOOST_SERIALIZATION_NVP(alpha3);
|
||||
archive& BOOST_SERIALIZATION_NVP(beta0);
|
||||
archive& BOOST_SERIALIZATION_NVP(beta1);
|
||||
archive& BOOST_SERIALIZATION_NVP(beta2);
|
||||
archive& BOOST_SERIALIZATION_NVP(beta3);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -116,111 +116,6 @@ int64_t Beidou_Dnav_Navigation_Message::read_navigation_signed(
|
||||
}
|
||||
|
||||
|
||||
double Beidou_Dnav_Navigation_Message::check_t(double time)
|
||||
{
|
||||
const double half_week = 302400; // seconds
|
||||
double corrTime = time;
|
||||
if (time > half_week)
|
||||
{
|
||||
corrTime = time - 2 * half_week;
|
||||
}
|
||||
else if (time < -half_week)
|
||||
{
|
||||
corrTime = time + 2 * half_week;
|
||||
}
|
||||
return corrTime;
|
||||
}
|
||||
|
||||
|
||||
double Beidou_Dnav_Navigation_Message::sv_clock_correction(double transmitTime)
|
||||
{
|
||||
const double dt = check_t(transmitTime - d_Toc);
|
||||
d_satClkCorr = (d_A_f2 * dt + d_A_f1) * dt + d_A_f0 + d_dtr;
|
||||
double correctedTime = transmitTime - d_satClkCorr;
|
||||
return correctedTime;
|
||||
}
|
||||
|
||||
|
||||
void Beidou_Dnav_Navigation_Message::satellitePosition(double transmitTime)
|
||||
{
|
||||
// Find satellite's position -----------------------------------------------
|
||||
// Restore semi-major axis
|
||||
const double a = d_sqrt_A * d_sqrt_A;
|
||||
|
||||
// Time from ephemeris reference epoch
|
||||
const double tk = check_t(transmitTime - d_Toe_sf2);
|
||||
|
||||
// Computed mean motion
|
||||
const double n0 = sqrt(BEIDOU_GM / (a * a * a));
|
||||
|
||||
// Corrected mean motion
|
||||
const double n = n0 + d_Delta_n;
|
||||
|
||||
// Mean anomaly
|
||||
double M = d_M_0 + n * tk;
|
||||
|
||||
// Reduce mean anomaly to between 0 and 2pi
|
||||
M = fmod((M + 2 * GNSS_PI), (2 * GNSS_PI));
|
||||
|
||||
// Initial guess of eccentric anomaly
|
||||
double E = M;
|
||||
double E_old;
|
||||
double dE;
|
||||
// --- Iteratively compute eccentric anomaly -------------------------------
|
||||
for (int32_t ii = 1; ii < 20; ii++)
|
||||
{
|
||||
E_old = E;
|
||||
E = M + d_eccentricity * sin(E);
|
||||
dE = fmod(E - E_old, 2 * GNSS_PI);
|
||||
if (fabs(dE) < 1e-12)
|
||||
{
|
||||
// Necessary precision is reached, exit from the loop
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Compute relativistic correction term
|
||||
d_dtr = BEIDOU_F * d_eccentricity * d_sqrt_A * sin(E);
|
||||
|
||||
// Compute the true anomaly
|
||||
const double tmp_Y = sqrt(1.0 - d_eccentricity * d_eccentricity) * sin(E);
|
||||
const double tmp_X = cos(E) - d_eccentricity;
|
||||
const double nu = atan2(tmp_Y, tmp_X);
|
||||
|
||||
// Compute angle phi (argument of Latitude)
|
||||
double phi = nu + d_OMEGA;
|
||||
|
||||
// Reduce phi to between 0 and 2*pi rad
|
||||
phi = fmod((phi), (2 * GNSS_PI));
|
||||
|
||||
// Correct argument of latitude
|
||||
const double u = phi + d_Cuc * cos(2 * phi) + d_Cus * sin(2 * phi);
|
||||
|
||||
// Correct radius
|
||||
const double r = a * (1 - d_eccentricity * cos(E)) + d_Crc * cos(2 * phi) + d_Crs * sin(2 * phi);
|
||||
|
||||
// Correct inclination
|
||||
const double i = d_i_0 + d_IDOT * tk + d_Cic * cos(2 * phi) + d_Cis * sin(2 * phi);
|
||||
|
||||
// Compute the angle between the ascending node and the Greenwich meridian
|
||||
double Omega = d_OMEGA0 + (d_OMEGA_DOT - BEIDOU_OMEGA_EARTH_DOT) * tk - BEIDOU_OMEGA_EARTH_DOT * d_Toe_sf2;
|
||||
|
||||
// Reduce to between 0 and 2*pi rad
|
||||
Omega = fmod((Omega + 2 * GNSS_PI), (2 * GNSS_PI));
|
||||
|
||||
// --- Compute satellite coordinates in Earth-fixed coordinates
|
||||
d_satpos_X = cos(u) * r * cos(Omega) - sin(u) * r * cos(i) * sin(Omega);
|
||||
d_satpos_Y = cos(u) * r * sin(Omega) + sin(u) * r * cos(i) * cos(Omega);
|
||||
d_satpos_Z = sin(u) * r * sin(i);
|
||||
|
||||
// Satellite's velocity. Can be useful for Vector Tracking loops
|
||||
const double Omega_dot = d_OMEGA_DOT - BEIDOU_OMEGA_EARTH_DOT;
|
||||
d_satvel_X = -Omega_dot * (cos(u) * r + sin(u) * r * cos(i)) + d_satpos_X * cos(Omega) - d_satpos_Y * cos(i) * sin(Omega);
|
||||
d_satvel_Y = Omega_dot * (cos(u) * r * cos(Omega) - sin(u) * r * cos(i) * sin(Omega)) + d_satpos_X * sin(Omega) + d_satpos_Y * cos(i) * cos(Omega);
|
||||
d_satvel_Z = d_satpos_Y * sin(i);
|
||||
}
|
||||
|
||||
|
||||
int32_t Beidou_Dnav_Navigation_Message::d1_subframe_decoder(std::string const& subframe)
|
||||
{
|
||||
const std::bitset<BEIDOU_DNAV_SUBFRAME_DATA_BITS> subframe_bits(subframe);
|
||||
@ -757,85 +652,85 @@ Beidou_Dnav_Ephemeris Beidou_Dnav_Navigation_Message::get_ephemeris() const
|
||||
std::bitset<BEIDOU_DNAV_SUBFRAME_DATA_BITS> subframe_bits;
|
||||
|
||||
// Order as given by eph_t in rtklib
|
||||
eph.i_satellite_PRN = i_satellite_PRN;
|
||||
eph.PRN = i_satellite_PRN;
|
||||
eph.d_AODC = d_AODC;
|
||||
eph.d_AODE = d_AODE;
|
||||
eph.i_SV_accuracy = i_SV_accuracy;
|
||||
eph.i_SV_health = i_SV_health;
|
||||
eph.i_BEIDOU_week = i_BEIDOU_week;
|
||||
eph.SV_accuracy = i_SV_accuracy;
|
||||
eph.SV_health = i_SV_health;
|
||||
eph.WN = i_BEIDOU_week;
|
||||
eph.i_sig_type = i_signal_type;
|
||||
eph.i_nav_type = 2;
|
||||
|
||||
eph.d_TOW = d_SOW;
|
||||
eph.d_Toe = d_Toe;
|
||||
eph.d_Toc = d_Toc;
|
||||
eph.tow = d_SOW;
|
||||
eph.toe = d_Toe;
|
||||
eph.toc = d_Toc;
|
||||
|
||||
eph.d_sqrt_A = d_sqrt_A;
|
||||
eph.d_eccentricity = static_cast<double>((d_eccentricity_msb + d_eccentricity_lsb)) * D1_E_LSB;
|
||||
eph.sqrtA = d_sqrt_A;
|
||||
eph.ecc = static_cast<double>((d_eccentricity_msb + d_eccentricity_lsb)) * D1_E_LSB;
|
||||
subframe_bits = std::bitset<BEIDOU_DNAV_SUBFRAME_DATA_BITS>(d_i_0_msb_bits + d_i_0_lsb_bits);
|
||||
eph.d_i_0 = static_cast<double>(read_navigation_signed(subframe_bits, D2_I0)) * D1_I0_LSB;
|
||||
eph.d_OMEGA0 = d_OMEGA0;
|
||||
eph.i_0 = static_cast<double>(read_navigation_signed(subframe_bits, D2_I0)) * D1_I0_LSB;
|
||||
eph.OMEGA_0 = d_OMEGA0;
|
||||
subframe_bits = std::bitset<BEIDOU_DNAV_SUBFRAME_DATA_BITS>(d_OMEGA_msb_bits + d_OMEGA_lsb_bits);
|
||||
eph.d_OMEGA = static_cast<double>(read_navigation_signed(subframe_bits, D2_OMEGA)) * D1_OMEGA_LSB;
|
||||
eph.d_M_0 = d_M_0;
|
||||
eph.d_Delta_n = d_Delta_n;
|
||||
eph.omega = static_cast<double>(read_navigation_signed(subframe_bits, D2_OMEGA)) * D1_OMEGA_LSB;
|
||||
eph.M_0 = d_M_0;
|
||||
eph.delta_n = d_Delta_n;
|
||||
|
||||
subframe_bits = std::bitset<BEIDOU_DNAV_SUBFRAME_DATA_BITS>(d_OMEGA_DOT_msb_bits + d_OMEGA_DOT_lsb_bits);
|
||||
eph.d_OMEGA_DOT = static_cast<double>(read_navigation_signed(subframe_bits, D2_OMEGA_DOT)) * D1_OMEGA_DOT_LSB;
|
||||
eph.d_IDOT = d_IDOT;
|
||||
eph.OMEGAdot = static_cast<double>(read_navigation_signed(subframe_bits, D2_OMEGA_DOT)) * D1_OMEGA_DOT_LSB;
|
||||
eph.idot = d_IDOT;
|
||||
|
||||
eph.d_Crc = d_Crc;
|
||||
eph.d_Crs = d_Crs;
|
||||
eph.Crc = d_Crc;
|
||||
eph.Crs = d_Crs;
|
||||
subframe_bits = std::bitset<BEIDOU_DNAV_SUBFRAME_DATA_BITS>(d_Cuc_msb_bits + d_Cuc_lsb_bits);
|
||||
eph.d_Cuc = static_cast<double>(read_navigation_signed(subframe_bits, D2_CUC)) * D1_CUC_LSB;
|
||||
eph.d_Cus = d_Cus;
|
||||
eph.Cuc = static_cast<double>(read_navigation_signed(subframe_bits, D2_CUC)) * D1_CUC_LSB;
|
||||
eph.Cus = d_Cus;
|
||||
subframe_bits = std::bitset<BEIDOU_DNAV_SUBFRAME_DATA_BITS>(d_Cic_msb_bits + d_Cic_lsb_bits);
|
||||
eph.d_Cic = static_cast<double>(read_navigation_signed(subframe_bits, D2_CIC)) * D1_CIC_LSB;
|
||||
eph.d_Cis = d_Cis;
|
||||
eph.Cic = static_cast<double>(read_navigation_signed(subframe_bits, D2_CIC)) * D1_CIC_LSB;
|
||||
eph.Cis = d_Cis;
|
||||
|
||||
eph.d_A_f0 = d_A_f0;
|
||||
eph.af0 = d_A_f0;
|
||||
subframe_bits = std::bitset<BEIDOU_DNAV_SUBFRAME_DATA_BITS>(d_A_f1_msb_bits + d_A_f1_lsb_bits);
|
||||
eph.d_A_f1 = static_cast<double>(read_navigation_signed(subframe_bits, D2_A1)) * D1_A1_LSB;
|
||||
eph.d_A_f2 = d_A_f2;
|
||||
eph.af1 = static_cast<double>(read_navigation_signed(subframe_bits, D2_A1)) * D1_A1_LSB;
|
||||
eph.af2 = d_A_f2;
|
||||
|
||||
eph.d_TGD1 = d_TGD1;
|
||||
eph.d_TGD2 = d_TGD2;
|
||||
}
|
||||
else
|
||||
{
|
||||
eph.i_satellite_PRN = i_satellite_PRN;
|
||||
eph.PRN = i_satellite_PRN;
|
||||
eph.d_AODC = d_AODC;
|
||||
eph.d_AODE = d_AODE;
|
||||
eph.i_SV_accuracy = i_SV_accuracy;
|
||||
eph.i_SV_health = i_SV_health;
|
||||
eph.i_BEIDOU_week = i_BEIDOU_week;
|
||||
eph.SV_accuracy = i_SV_accuracy;
|
||||
eph.SV_health = i_SV_health;
|
||||
eph.WN = i_BEIDOU_week;
|
||||
eph.i_sig_type = i_signal_type;
|
||||
eph.i_nav_type = 1; // MEO/IGSO
|
||||
|
||||
eph.d_TOW = d_SOW;
|
||||
eph.d_Toe = ((d_Toe_sf2 + d_Toe_sf3) * D1_TOE_LSB);
|
||||
eph.d_Toc = d_Toc;
|
||||
eph.tow = d_SOW;
|
||||
eph.toe = ((d_Toe_sf2 + d_Toe_sf3) * D1_TOE_LSB);
|
||||
eph.toc = d_Toc;
|
||||
|
||||
eph.d_sqrt_A = d_sqrt_A;
|
||||
eph.d_eccentricity = d_eccentricity;
|
||||
eph.d_i_0 = d_i_0;
|
||||
eph.d_OMEGA0 = d_OMEGA0;
|
||||
eph.d_OMEGA = d_OMEGA;
|
||||
eph.d_M_0 = d_M_0;
|
||||
eph.d_Delta_n = d_Delta_n;
|
||||
eph.d_OMEGA_DOT = d_OMEGA_DOT;
|
||||
eph.d_IDOT = d_IDOT;
|
||||
eph.sqrtA = d_sqrt_A;
|
||||
eph.ecc = d_eccentricity;
|
||||
eph.i_0 = d_i_0;
|
||||
eph.OMEGA_0 = d_OMEGA0;
|
||||
eph.omega = d_OMEGA;
|
||||
eph.M_0 = d_M_0;
|
||||
eph.delta_n = d_Delta_n;
|
||||
eph.OMEGAdot = d_OMEGA_DOT;
|
||||
eph.idot = d_IDOT;
|
||||
|
||||
eph.d_Crc = d_Crc;
|
||||
eph.d_Crs = d_Crs;
|
||||
eph.d_Cuc = d_Cuc;
|
||||
eph.d_Cus = d_Cus;
|
||||
eph.d_Cic = d_Cic;
|
||||
eph.d_Cis = d_Cis;
|
||||
eph.Crc = d_Crc;
|
||||
eph.Crs = d_Crs;
|
||||
eph.Cuc = d_Cuc;
|
||||
eph.Cus = d_Cus;
|
||||
eph.Cic = d_Cic;
|
||||
eph.Cis = d_Cis;
|
||||
|
||||
eph.d_A_f0 = d_A_f0;
|
||||
eph.d_A_f1 = d_A_f1;
|
||||
eph.d_A_f2 = d_A_f2;
|
||||
eph.af0 = d_A_f0;
|
||||
eph.af1 = d_A_f1;
|
||||
eph.af2 = d_A_f2;
|
||||
|
||||
eph.d_TGD1 = d_TGD1;
|
||||
eph.d_TGD2 = d_TGD2;
|
||||
@ -848,14 +743,14 @@ Beidou_Dnav_Ephemeris Beidou_Dnav_Navigation_Message::get_ephemeris() const
|
||||
Beidou_Dnav_Iono Beidou_Dnav_Navigation_Message::get_iono()
|
||||
{
|
||||
Beidou_Dnav_Iono iono;
|
||||
iono.d_alpha0 = d_alpha0;
|
||||
iono.d_alpha1 = d_alpha1;
|
||||
iono.d_alpha2 = d_alpha2;
|
||||
iono.d_alpha3 = d_alpha3;
|
||||
iono.d_beta0 = d_beta0;
|
||||
iono.d_beta1 = d_beta1;
|
||||
iono.d_beta2 = d_beta2;
|
||||
iono.d_beta3 = d_beta3;
|
||||
iono.alpha0 = d_alpha0;
|
||||
iono.alpha1 = d_alpha1;
|
||||
iono.alpha2 = d_alpha2;
|
||||
iono.alpha3 = d_alpha3;
|
||||
iono.beta0 = d_beta0;
|
||||
iono.beta1 = d_beta1;
|
||||
iono.beta2 = d_beta2;
|
||||
iono.beta3 = d_beta3;
|
||||
iono.valid = flag_iono_valid;
|
||||
// WARNING: We clear flag_utc_model_valid in order to not re-send the same information to the ionospheric parameters queue
|
||||
flag_iono_valid = false;
|
||||
@ -868,19 +763,19 @@ Beidou_Dnav_Utc_Model Beidou_Dnav_Navigation_Message::get_utc_model()
|
||||
Beidou_Dnav_Utc_Model utc_model;
|
||||
utc_model.valid = flag_utc_model_valid;
|
||||
// UTC parameters
|
||||
utc_model.d_A1_UTC = d_A1UTC;
|
||||
utc_model.d_A0_UTC = d_A0UTC;
|
||||
utc_model.i_DeltaT_LS = i_DeltaT_LS;
|
||||
utc_model.i_WN_LSF = i_WN_LSF;
|
||||
utc_model.i_DN = i_DN;
|
||||
utc_model.d_DeltaT_LSF = d_DeltaT_LSF;
|
||||
utc_model.A1_UTC = d_A1UTC;
|
||||
utc_model.A0_UTC = d_A0UTC;
|
||||
utc_model.DeltaT_LS = i_DeltaT_LS;
|
||||
utc_model.WN_LSF = i_WN_LSF;
|
||||
utc_model.DN = i_DN;
|
||||
utc_model.DeltaT_LSF = d_DeltaT_LSF;
|
||||
|
||||
utc_model.d_A0_GPS = d_A0GPS;
|
||||
utc_model.d_A1_GPS = d_A1GPS;
|
||||
utc_model.d_A0_GAL = d_A0GAL;
|
||||
utc_model.d_A1_GAL = d_A1GAL;
|
||||
utc_model.d_A0_GLO = d_A0GLO;
|
||||
utc_model.d_A1_GLO = d_A1GLO;
|
||||
utc_model.A0_GPS = d_A0GPS;
|
||||
utc_model.A1_GPS = d_A1GPS;
|
||||
utc_model.A0_GAL = d_A0GAL;
|
||||
utc_model.A1_GAL = d_A1GAL;
|
||||
utc_model.A0_GLO = d_A0GLO;
|
||||
utc_model.A1_GLO = d_A1GLO;
|
||||
|
||||
// warning: We clear flag_utc_model_valid in order to not re-send the same information to the ionospheric parameters queue
|
||||
flag_utc_model_valid = false;
|
||||
|
@ -76,17 +76,6 @@ public:
|
||||
*/
|
||||
int32_t d2_subframe_decoder(std::string const& subframe);
|
||||
|
||||
/*!
|
||||
* \brief Computes the position of the satellite
|
||||
*/
|
||||
void satellitePosition(double transmitTime);
|
||||
|
||||
/*!
|
||||
* \brief Sets (\a d_satClkCorr) according to the User Algorithm for SV Clock Correction
|
||||
* and returns the corrected clock
|
||||
*/
|
||||
double sv_clock_correction(double transmitTime);
|
||||
|
||||
/*!
|
||||
* \brief Computes the Coordinated Universal Time (UTC) and
|
||||
* returns it in [s]
|
||||
@ -154,14 +143,6 @@ private:
|
||||
bool read_navigation_bool(std::bitset<BEIDOU_DNAV_SUBFRAME_DATA_BITS> bits, const std::vector<std::pair<int32_t, int32_t>>& parameter) const;
|
||||
void print_beidou_word_bytes(uint32_t BEIDOU_word) const;
|
||||
|
||||
/*
|
||||
* Accounts for the beginning or end of week crossover
|
||||
*
|
||||
* \param[in] - time in seconds
|
||||
* \param[out] - corrected time, in seconds
|
||||
*/
|
||||
double check_t(double time);
|
||||
|
||||
// broadcast orbit 1
|
||||
double d_SOW{}; // Time of BeiDou Week of the ephemeris set (taken from subframes SOW) [s]
|
||||
double d_SOW_SF1{}; // Time of BeiDou Week from HOW word of Subframe 1 [s]
|
||||
@ -243,15 +224,6 @@ private:
|
||||
|
||||
std::map<int32_t, std::string> satelliteBlock; // Map that stores to which block the PRN belongs
|
||||
|
||||
// clock terms
|
||||
double d_satClkCorr{}; // GPS clock error
|
||||
double d_dtr{}; // relativistic clock correction term
|
||||
|
||||
// satellite positions
|
||||
double d_satpos_X{}; // Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis.
|
||||
double d_satpos_Y{}; // Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system.
|
||||
double d_satpos_Z{}; // Earth-fixed coordinate z of the satellite [m]. The direction of the IERS (International Earth Rotation and Reference Systems Service) Reference Pole (IRP).
|
||||
|
||||
// satellite identification info
|
||||
int32_t i_signal_type{}; // BDS: data source (0:unknown,1:B1I,2:B1Q,3:B2I,4:B2Q,5:B3I,6:B3Q)
|
||||
uint32_t i_satellite_PRN{};
|
||||
@ -293,11 +265,6 @@ private:
|
||||
int32_t almanac_WN{};
|
||||
double d_toa2{};
|
||||
|
||||
// Satellite velocity
|
||||
double d_satvel_X{}; // Earth-fixed velocity coordinate x of the satellite [m]
|
||||
double d_satvel_Y{}; // Earth-fixed velocity coordinate y of the satellite [m]
|
||||
double d_satvel_Z{}; // Earth-fixed velocity coordinate z of the satellite [m]
|
||||
|
||||
// System flags for data processing
|
||||
bool flag_eph_valid{};
|
||||
bool flag_utc_model_valid{};
|
||||
|
@ -38,50 +38,50 @@ public:
|
||||
Beidou_Dnav_Utc_Model() = default;
|
||||
|
||||
// BeiDou UTC parameters
|
||||
double d_A0_UTC{}; //!< BDT clock bias relative to UTC [s]
|
||||
double d_A1_UTC{}; //!< BDT clock rate relative to UTC [s/s]
|
||||
int i_DeltaT_LS{}; //!< Delta time due to leap seconds before the new leap second effective
|
||||
int i_WN_LSF{}; //!< Week number of the new leap second
|
||||
int i_DN{}; //!< Day number of week of the new leap second
|
||||
double d_DeltaT_LSF{}; //!< Delta time due to leap seconds after the new leap second effective [s]
|
||||
double A0_UTC{}; //!< BDT clock bias relative to UTC [s]
|
||||
double A1_UTC{}; //!< BDT clock rate relative to UTC [s/s]
|
||||
int DeltaT_LS{}; //!< Delta time due to leap seconds before the new leap second effective
|
||||
int WN_LSF{}; //!< Week number of the new leap second
|
||||
int DN{}; //!< Day number of week of the new leap second
|
||||
double DeltaT_LSF{}; //!< Delta time due to leap seconds after the new leap second effective [s]
|
||||
|
||||
// BeiDou to GPS time corrections
|
||||
double d_A0_GPS{}; //!< BDT clock bias relative to GPS time [s]
|
||||
double d_A1_GPS{}; //!< BDT clock rate relative to GPS time [s/s]
|
||||
double A0_GPS{}; //!< BDT clock bias relative to GPS time [s]
|
||||
double A1_GPS{}; //!< BDT clock rate relative to GPS time [s/s]
|
||||
|
||||
// BeiDou to Galileo time corrections
|
||||
double d_A0_GAL{}; //!< BDT clock bias relative to GAL time [s]
|
||||
double d_A1_GAL{}; //!< BDT clock rate relative to GAL time [s/s]
|
||||
double A0_GAL{}; //!< BDT clock bias relative to GAL time [s]
|
||||
double A1_GAL{}; //!< BDT clock rate relative to GAL time [s/s]
|
||||
|
||||
// BeiDou to GLONASS time corrections
|
||||
double d_A0_GLO{}; //!< BDT clock bias relative to GLO time [s]
|
||||
double d_A1_GLO{}; //!< BDT clock rate relative to GLO time [s/s]
|
||||
double A0_GLO{}; //!< BDT clock bias relative to GLO time [s]
|
||||
double A1_GLO{}; //!< BDT clock rate relative to GLO time [s/s]
|
||||
|
||||
bool valid{};
|
||||
|
||||
template <class Archive>
|
||||
/*
|
||||
* \brief Serialize is a boost standard method to be called by the boost XML serialization. Here is used to save the ephemeris data on disk file.
|
||||
* \brief Serialize is a boost standard method to be called by the boost XML
|
||||
* serialization. Here is used to save the ephemeris data on disk file.
|
||||
*/
|
||||
inline void serialize(Archive& archive, const unsigned int version)
|
||||
{
|
||||
using boost::serialization::make_nvp;
|
||||
if (version)
|
||||
{
|
||||
};
|
||||
archive& make_nvp("d_A1", d_A1_UTC);
|
||||
archive& make_nvp("d_A0", d_A0_UTC);
|
||||
archive& make_nvp("i_DeltaT_LS", i_DeltaT_LS);
|
||||
archive& make_nvp("i_WN_LSF", i_WN_LSF);
|
||||
archive& make_nvp("i_DN", i_DN);
|
||||
archive& make_nvp("d_DeltaT_LSF", d_DeltaT_LSF);
|
||||
archive& make_nvp("d_A0_GPS", d_A0_GPS);
|
||||
archive& make_nvp("d_A0_GPS", d_A1_GPS);
|
||||
archive& make_nvp("d_A0_GPS", d_A0_GAL);
|
||||
archive& make_nvp("d_A0_GPS", d_A1_GAL);
|
||||
archive& make_nvp("d_A0_GPS", d_A0_GLO);
|
||||
archive& make_nvp("d_A0_GPS", d_A1_GLO);
|
||||
archive& make_nvp("valid", valid);
|
||||
archive& BOOST_SERIALIZATION_NVP(A1_UTC);
|
||||
archive& BOOST_SERIALIZATION_NVP(A0_UTC);
|
||||
archive& BOOST_SERIALIZATION_NVP(DeltaT_LS);
|
||||
archive& BOOST_SERIALIZATION_NVP(WN_LSF);
|
||||
archive& BOOST_SERIALIZATION_NVP(DN);
|
||||
archive& BOOST_SERIALIZATION_NVP(DeltaT_LSF);
|
||||
archive& BOOST_SERIALIZATION_NVP(A0_GPS);
|
||||
archive& BOOST_SERIALIZATION_NVP(A1_GPS);
|
||||
archive& BOOST_SERIALIZATION_NVP(A0_GAL);
|
||||
archive& BOOST_SERIALIZATION_NVP(A1_GAL);
|
||||
archive& BOOST_SERIALIZATION_NVP(A0_GLO);
|
||||
archive& BOOST_SERIALIZATION_NVP(A1_GLO);
|
||||
archive& BOOST_SERIALIZATION_NVP(valid);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -38,19 +38,19 @@ public:
|
||||
*/
|
||||
Galileo_Almanac() = default;
|
||||
|
||||
uint32_t i_satellite_PRN{}; //!< SV PRN NUMBER
|
||||
int32_t i_Toa{};
|
||||
int32_t i_WNa{};
|
||||
int32_t i_IODa{};
|
||||
double d_Delta_i{}; //!< Inclination at reference time relative to i0 = 56º [semi-circles]
|
||||
double d_M_0{}; //!< Mean Anomaly at Reference Time [semi-circles]
|
||||
double d_e_eccentricity{}; //!< Eccentricity [dimensionless]
|
||||
double d_Delta_sqrt_A{}; //!< Square Root of the Semi-Major Axis [sqrt(m)]
|
||||
double d_OMEGA0{}; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles]
|
||||
double d_OMEGA{}; //!< Argument of Perigee [semi-cicles]
|
||||
double d_OMEGA_DOT{}; //!< Rate of Right Ascension [semi-circles/s]
|
||||
double d_A_f0{}; //!< Coefficient 0 of code phase offset model [s]
|
||||
double d_A_f1{}; //!< Coefficient 1 of code phase offset model [s/s]
|
||||
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{};
|
||||
@ -62,19 +62,19 @@ public:
|
||||
if (version)
|
||||
{
|
||||
};
|
||||
ar& BOOST_SERIALIZATION_NVP(i_satellite_PRN);
|
||||
ar& BOOST_SERIALIZATION_NVP(i_Toa);
|
||||
ar& BOOST_SERIALIZATION_NVP(i_WNa);
|
||||
ar& BOOST_SERIALIZATION_NVP(i_IODa);
|
||||
ar& BOOST_SERIALIZATION_NVP(d_Delta_i);
|
||||
ar& BOOST_SERIALIZATION_NVP(d_M_0);
|
||||
ar& BOOST_SERIALIZATION_NVP(d_e_eccentricity);
|
||||
ar& BOOST_SERIALIZATION_NVP(d_Delta_sqrt_A);
|
||||
ar& BOOST_SERIALIZATION_NVP(d_OMEGA0);
|
||||
ar& BOOST_SERIALIZATION_NVP(d_OMEGA);
|
||||
ar& BOOST_SERIALIZATION_NVP(d_OMEGA_DOT);
|
||||
ar& BOOST_SERIALIZATION_NVP(d_A_f0);
|
||||
ar& BOOST_SERIALIZATION_NVP(d_A_f1);
|
||||
ar& BOOST_SERIALIZATION_NVP(PRN);
|
||||
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(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(E5b_HS);
|
||||
ar& BOOST_SERIALIZATION_NVP(E1B_HS);
|
||||
ar& BOOST_SERIALIZATION_NVP(E5a_HS);
|
||||
|
@ -22,56 +22,56 @@ Galileo_Almanac Galileo_Almanac_Helper::get_almanac(int i) const
|
||||
switch (i)
|
||||
{
|
||||
case 1:
|
||||
galileo_almanac.i_satellite_PRN = this->SVID1_7;
|
||||
galileo_almanac.i_Toa = this->t0a_7;
|
||||
galileo_almanac.i_WNa = this->WN_a_7;
|
||||
galileo_almanac.i_IODa = this->IOD_a_7;
|
||||
galileo_almanac.d_Delta_i = this->delta_i_7;
|
||||
galileo_almanac.d_M_0 = this->M0_7;
|
||||
galileo_almanac.d_e_eccentricity = this->e_7;
|
||||
galileo_almanac.d_Delta_sqrt_A = this->DELTA_A_7;
|
||||
galileo_almanac.d_OMEGA0 = this->Omega0_7;
|
||||
galileo_almanac.d_OMEGA = this->omega_7;
|
||||
galileo_almanac.d_OMEGA_DOT = this->Omega_dot_7;
|
||||
galileo_almanac.d_A_f0 = this->af0_8;
|
||||
galileo_almanac.d_A_f1 = this->af1_8;
|
||||
galileo_almanac.PRN = this->SVID1_7;
|
||||
galileo_almanac.toa = this->t0a_7;
|
||||
galileo_almanac.WNa = this->WN_a_7;
|
||||
galileo_almanac.IODa = this->IOD_a_7;
|
||||
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.OMEGA_0 = this->Omega0_7;
|
||||
galileo_almanac.omega = this->omega_7;
|
||||
galileo_almanac.OMEGAdot = this->Omega_dot_7;
|
||||
galileo_almanac.af0 = this->af0_8;
|
||||
galileo_almanac.af1 = this->af1_8;
|
||||
galileo_almanac.E5b_HS = this->E5b_HS_8;
|
||||
galileo_almanac.E1B_HS = this->E1B_HS_8;
|
||||
galileo_almanac.E5a_HS = this->E5a_HS_8;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
galileo_almanac.i_satellite_PRN = this->SVID2_8;
|
||||
galileo_almanac.i_Toa = this->t0a_9;
|
||||
galileo_almanac.i_WNa = this->WN_a_9;
|
||||
galileo_almanac.i_IODa = this->IOD_a_9;
|
||||
galileo_almanac.d_Delta_i = this->delta_i_8;
|
||||
galileo_almanac.d_M_0 = this->M0_9;
|
||||
galileo_almanac.d_e_eccentricity = this->e_8;
|
||||
galileo_almanac.d_Delta_sqrt_A = this->DELTA_A_8;
|
||||
galileo_almanac.d_OMEGA0 = this->Omega0_8;
|
||||
galileo_almanac.d_OMEGA = this->omega_8;
|
||||
galileo_almanac.d_OMEGA_DOT = this->Omega_dot_8;
|
||||
galileo_almanac.d_A_f0 = this->af0_9;
|
||||
galileo_almanac.d_A_f1 = this->af1_9;
|
||||
galileo_almanac.PRN = this->SVID2_8;
|
||||
galileo_almanac.toa = this->t0a_9;
|
||||
galileo_almanac.WNa = this->WN_a_9;
|
||||
galileo_almanac.IODa = this->IOD_a_9;
|
||||
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.OMEGA_0 = this->Omega0_8;
|
||||
galileo_almanac.omega = this->omega_8;
|
||||
galileo_almanac.OMEGAdot = this->Omega_dot_8;
|
||||
galileo_almanac.af0 = this->af0_9;
|
||||
galileo_almanac.af1 = this->af1_9;
|
||||
galileo_almanac.E1B_HS = this->E1B_HS_9;
|
||||
galileo_almanac.E5a_HS = this->E5a_HS_9;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
galileo_almanac.i_satellite_PRN = this->SVID3_9;
|
||||
galileo_almanac.i_Toa = this->t0a_9;
|
||||
galileo_almanac.i_WNa = this->WN_a_9;
|
||||
galileo_almanac.i_IODa = this->IOD_a_10;
|
||||
galileo_almanac.d_Delta_i = this->delta_i_9;
|
||||
galileo_almanac.d_M_0 = this->M0_10;
|
||||
galileo_almanac.d_e_eccentricity = this->e_9;
|
||||
galileo_almanac.d_Delta_sqrt_A = this->DELTA_A_9;
|
||||
galileo_almanac.d_OMEGA0 = this->Omega0_10;
|
||||
galileo_almanac.d_OMEGA = this->omega_9;
|
||||
galileo_almanac.d_OMEGA_DOT = this->Omega_dot_10;
|
||||
galileo_almanac.d_A_f0 = this->af0_10;
|
||||
galileo_almanac.d_A_f1 = this->af1_10;
|
||||
galileo_almanac.PRN = this->SVID3_9;
|
||||
galileo_almanac.toa = this->t0a_9;
|
||||
galileo_almanac.WNa = this->WN_a_9;
|
||||
galileo_almanac.IODa = this->IOD_a_10;
|
||||
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.OMEGA_0 = this->Omega0_10;
|
||||
galileo_almanac.omega = this->omega_9;
|
||||
galileo_almanac.OMEGAdot = this->Omega_dot_10;
|
||||
galileo_almanac.af0 = this->af0_10;
|
||||
galileo_almanac.af1 = this->af1_10;
|
||||
galileo_almanac.E5b_HS = this->E5b_HS_10;
|
||||
galileo_almanac.E1B_HS = this->E1B_HS_10;
|
||||
galileo_almanac.E5a_HS = this->E5a_HS_10;
|
||||
|
@ -17,216 +17,46 @@
|
||||
*/
|
||||
|
||||
#include "galileo_ephemeris.h"
|
||||
#include "MATH_CONSTANTS.h"
|
||||
#include <cmath>
|
||||
|
||||
|
||||
double Galileo_Ephemeris::Galileo_System_Time(double WN, double TOW)
|
||||
double Galileo_Ephemeris::Galileo_System_Time(double week_number, double TOW)
|
||||
{
|
||||
/* GALILEO SYSTEM TIME, ICD 5.1.2
|
||||
*
|
||||
* input parameter:
|
||||
* WN: The Week Number is an integer counter that gives the sequential week number
|
||||
from the origin of the Galileo time. It covers 4096 weeks (about 78 years).
|
||||
Then the counter is reset to zero to cover additional period modulo 4096
|
||||
|
||||
TOW: The Time of Week is defined as the number of seconds that have occurred since
|
||||
the transition from the previous week. The TOW covers an entire week from 0 to
|
||||
604799 seconds and is reset to zero at the end of each week
|
||||
|
||||
WN and TOW are received in page 5
|
||||
|
||||
output:
|
||||
t: it is the transmitted time in Galileo System Time (expressed in seconds)
|
||||
|
||||
The GST start epoch shall be 00:00 UT on Sunday 22nd August 1999 (midnight between 21st and 22nd August).
|
||||
At the start epoch, GST shall be ahead of UTC by thirteen (13)
|
||||
leap seconds. Since the next leap second was inserted at 01.01.2006, this implies that
|
||||
as of 01.01.2006 GST is ahead of UTC by fourteen (14) leap seconds.
|
||||
|
||||
The epoch denoted in the navigation messages by TOW and WN
|
||||
will be measured relative to the leading edge of the first chip of the
|
||||
first code sequence of the first page symbol. The transmission timing of the navigation
|
||||
message provided through the TOW is synchronised to each satellite’s version of Galileo System Time (GST).
|
||||
*
|
||||
* week_number: The Week Number is an integer counter that gives the
|
||||
* sequential week number from the origin of the Galileo time. It covers
|
||||
* 4096 weeks (about 78 years). Then the counter is reset to zero to cover
|
||||
* additional period modulo 4096
|
||||
*
|
||||
* TOW: The Time of Week is defined as the number of seconds that have
|
||||
* occurred since the transition from the previous week. The TOW covers an
|
||||
* entire week from 0 to 604799 seconds and is reset to zero at the end of
|
||||
* each week
|
||||
*
|
||||
* week_number and TOW are received in page 5
|
||||
*
|
||||
* output:
|
||||
*
|
||||
* t: it is the transmitted time in Galileo System Time (expressed
|
||||
* in seconds)
|
||||
*
|
||||
* The GST start epoch shall be 00:00 UT on Sunday 22nd August 1999
|
||||
* (midnight between 21st and 22nd August). At the start epoch, GST shall be
|
||||
* ahead of UTC by thirteen (13) leap seconds. Since the next leap second
|
||||
* was inserted at 01.01.2006, this implies that as of 01.01.2006 GST is
|
||||
* ahead of UTC by fourteen (14) leap seconds.
|
||||
*
|
||||
* The epoch denoted in the navigation messages by TOW and week_number will
|
||||
* be measured relative to the leading edge of the first chip of the first
|
||||
* code sequence of the first page symbol. The transmission timing of the
|
||||
* navigation message provided through the TOW is synchronised to each
|
||||
* satellite’s version of Galileo System Time (GST).
|
||||
*
|
||||
*/
|
||||
const double sec_in_day = 86400;
|
||||
const double day_in_week = 7;
|
||||
double t = WN * sec_in_day * day_in_week + TOW; // second from the origin of the Galileo time
|
||||
double t = week_number * sec_in_day * day_in_week + TOW; // second from the origin of the Galileo time
|
||||
return t;
|
||||
}
|
||||
|
||||
|
||||
double Galileo_Ephemeris::sv_clock_drift(double transmitTime)
|
||||
{
|
||||
// Satellite Time Correction Algorithm, ICD 5.1.4
|
||||
const double dt = transmitTime - t0c_4;
|
||||
Galileo_satClkDrift = af0_4 + af1_4 * dt + af2_4 * (dt * dt) + sv_clock_relativistic_term(transmitTime); // +Galileo_dtr;
|
||||
return Galileo_satClkDrift;
|
||||
}
|
||||
|
||||
|
||||
// compute the relativistic correction term
|
||||
double Galileo_Ephemeris::sv_clock_relativistic_term(double transmitTime) // Satellite Time Correction Algorithm, ICD 5.1.4
|
||||
{
|
||||
// Restore semi-major axis
|
||||
const double a = A_1 * A_1;
|
||||
|
||||
const double n0 = sqrt(GALILEO_GM / (a * a * a));
|
||||
|
||||
// Time from ephemeris reference epoch
|
||||
// t = WN_5*86400*7 + TOW_5; //WN_5*86400*7 are the second from the origin of the Galileo time
|
||||
const double tk = check_t(transmitTime - static_cast<double>(t0e_1));
|
||||
|
||||
// Corrected mean motion
|
||||
const double n = n0 + delta_n_3;
|
||||
|
||||
// Mean anomaly
|
||||
double M = M0_1 + n * tk;
|
||||
|
||||
// Reduce mean anomaly to between 0 and 2pi
|
||||
M = fmod((M + 2.0 * GNSS_PI), (2.0 * GNSS_PI));
|
||||
|
||||
// Initial guess of eccentric anomaly
|
||||
double E = M;
|
||||
double E_old;
|
||||
double dE;
|
||||
|
||||
// --- Iteratively compute eccentric anomaly ----------------------------
|
||||
for (int32_t ii = 1; ii < 20; ii++)
|
||||
{
|
||||
E_old = E;
|
||||
E = M + e_1 * sin(E);
|
||||
dE = fmod(E - E_old, 2.0 * GNSS_PI);
|
||||
if (fabs(dE) < 1e-12)
|
||||
{
|
||||
// Necessary precision is reached, exit from the loop
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Compute relativistic correction term
|
||||
Galileo_dtr = GALILEO_F * e_1 * A_1 * sin(E);
|
||||
return Galileo_dtr;
|
||||
}
|
||||
|
||||
|
||||
void Galileo_Ephemeris::satellitePosition(double transmitTime)
|
||||
{
|
||||
// when this function in used, the input must be the transmitted time (t) in
|
||||
// seconds computed by Galileo_System_Time (above function)
|
||||
|
||||
// Find Galileo satellite's position ---------------------------------------
|
||||
|
||||
// Restore semi-major axis
|
||||
const double a = A_1 * A_1;
|
||||
|
||||
// Computed mean motion
|
||||
const double n0 = sqrt(GALILEO_GM / (a * a * a));
|
||||
|
||||
// Time from ephemeris reference epoch
|
||||
const double tk = check_t(transmitTime - static_cast<double>(t0e_1));
|
||||
|
||||
// Corrected mean motion
|
||||
const double n = n0 + delta_n_3;
|
||||
|
||||
// Mean anomaly
|
||||
double M = M0_1 + n * tk;
|
||||
|
||||
// Reduce mean anomaly to between 0 and 2pi
|
||||
M = fmod((M + 2.0 * GNSS_PI), (2.0 * GNSS_PI));
|
||||
|
||||
// Initial guess of eccentric anomaly
|
||||
double E = M;
|
||||
double E_old;
|
||||
double dE;
|
||||
|
||||
// --- Iteratively compute eccentric anomaly -------------------------------
|
||||
for (int32_t ii = 1; ii < 20; ii++)
|
||||
{
|
||||
E_old = E;
|
||||
E = M + e_1 * sin(E);
|
||||
dE = fmod(E - E_old, 2.0 * GNSS_PI);
|
||||
if (fabs(dE) < 1e-12)
|
||||
{
|
||||
// Necessary precision is reached, exit from the loop
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
const double sek = sin(E);
|
||||
const double cek = cos(E);
|
||||
const double OneMinusecosE = 1.0 - e_1 * cek;
|
||||
const double sq1e2 = sqrt(1.0 - e_1 * e_1);
|
||||
const double ekdot = n / OneMinusecosE;
|
||||
|
||||
// Compute the true anomaly
|
||||
const double tmp_Y = sq1e2 * sek;
|
||||
const double tmp_X = cek - e_1;
|
||||
const double nu = atan2(tmp_Y, tmp_X);
|
||||
|
||||
// Compute angle phi (argument of Latitude)
|
||||
double phi = nu + omega_2;
|
||||
|
||||
// Reduce phi to between 0 and 2*pi rad
|
||||
phi = fmod((phi), (2.0 * GNSS_PI));
|
||||
const double s2pk = sin(2.0 * phi);
|
||||
const double c2pk = cos(2.0 * phi);
|
||||
const double pkdot = sq1e2 * ekdot / OneMinusecosE;
|
||||
|
||||
// Correct argument of latitude
|
||||
const double u = phi + C_uc_3 * c2pk + C_us_3 * s2pk;
|
||||
const double suk = sin(u);
|
||||
const double cuk = cos(u);
|
||||
const double ukdot = pkdot * (1.0 + 2.0 * (C_us_3 * c2pk - C_uc_3 * s2pk));
|
||||
|
||||
// Correct radius
|
||||
const double r = a * OneMinusecosE + C_rc_3 * c2pk + C_rs_3 * s2pk;
|
||||
const double rkdot = a * e_1 * sek * ekdot + 2.0 * pkdot * (C_rs_3 * c2pk - C_rc_3 * s2pk);
|
||||
|
||||
// Correct inclination
|
||||
const double i = i_0_2 + iDot_2 * tk + C_ic_4 * c2pk + C_is_4 * s2pk;
|
||||
const double sik = sin(i);
|
||||
const double cik = cos(i);
|
||||
const double ikdot = iDot_2 + 2.0 * pkdot * (C_is_4 * c2pk - C_ic_4 * s2pk);
|
||||
|
||||
// Compute the angle between the ascending node and the Greenwich meridian
|
||||
const double Omega_dot = OMEGA_dot_3 - GNSS_OMEGA_EARTH_DOT;
|
||||
double Omega = OMEGA_0_2 + Omega_dot * tk - GNSS_OMEGA_EARTH_DOT * static_cast<double>(t0e_1);
|
||||
|
||||
// Reduce to between 0 and 2*pi rad
|
||||
Omega = fmod((Omega + 2.0 * GNSS_PI), (2.0 * GNSS_PI));
|
||||
const double sok = sin(Omega);
|
||||
const double cok = cos(Omega);
|
||||
|
||||
// --- Compute satellite coordinates in Earth-fixed coordinates
|
||||
const double xprime = r * cuk;
|
||||
const double yprime = r * suk;
|
||||
d_satpos_X = xprime * cok - yprime * cik * sok;
|
||||
d_satpos_Y = xprime * sok + yprime * cik * cok; // ********NOTE: in GALILEO ICD this expression is not correct because it has minus (- sin(u) * r * cos(i) * cos(Omega)) instead of plus
|
||||
d_satpos_Z = yprime * sik;
|
||||
|
||||
// Satellite's velocity. Can be useful for Vector Tracking loops
|
||||
const double xpkdot = rkdot * cuk - yprime * ukdot;
|
||||
const double ypkdot = rkdot * suk + xprime * ukdot;
|
||||
const double tmp = ypkdot * cik - d_satpos_Z * ikdot;
|
||||
|
||||
d_satvel_X = -Omega_dot * d_satpos_Y + xpkdot * cok - tmp * sok;
|
||||
d_satvel_Y = Omega_dot * d_satpos_X + xpkdot * sok + tmp * cok;
|
||||
d_satvel_Z = yprime * cik * ikdot + ypkdot * sik;
|
||||
}
|
||||
|
||||
|
||||
double Galileo_Ephemeris::check_t(double time)
|
||||
{
|
||||
const double half_week = 302400.0; // seconds
|
||||
double corrTime = time;
|
||||
if (time > half_week)
|
||||
{
|
||||
corrTime = time - 2.0 * half_week;
|
||||
}
|
||||
else if (time < -half_week)
|
||||
{
|
||||
corrTime = time + 2.0 * half_week;
|
||||
}
|
||||
return corrTime;
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
#ifndef GNSS_SDR_GALILEO_EPHEMERIS_H
|
||||
#define GNSS_SDR_GALILEO_EPHEMERIS_H
|
||||
|
||||
#include "gnss_ephemeris.h"
|
||||
#include <boost/serialization/nvp.hpp>
|
||||
#include <cstdint>
|
||||
|
||||
@ -29,84 +30,43 @@
|
||||
|
||||
|
||||
/*!
|
||||
* \brief This class is a storage and orbital model functions for the Galileo SV ephemeris data as described in Galileo ICD paragraph 5.1.1
|
||||
* \brief This class is a storage and orbital model functions for the Galileo SV
|
||||
* ephemeris data as described in Galileo ICD paragraph 5.1.1
|
||||
*
|
||||
* (See https://www.gsc-europa.eu/sites/default/files/sites/all/files/Galileo_OS_SIS_ICD_v2.0.pdf )
|
||||
*
|
||||
*/
|
||||
class Galileo_Ephemeris
|
||||
class Galileo_Ephemeris : public Gnss_Ephemeris
|
||||
{
|
||||
public:
|
||||
Galileo_Ephemeris() = default;
|
||||
Galileo_Ephemeris()
|
||||
{
|
||||
this->System = 'E';
|
||||
}
|
||||
|
||||
void satellitePosition(double transmitTime); //!< Computes the ECEF SV coordinates and ECEF velocity
|
||||
double Galileo_System_Time(double WN, double TOW); //!< Galileo System Time (GST), ICD paragraph 5.1.2
|
||||
double sv_clock_drift(double transmitTime); //!< Satellite Time Correction Algorithm, ICD 5.1.4
|
||||
double sv_clock_relativistic_term(double transmitTime); //!< Satellite Time Correction Algorithm, ICD 5.1.4
|
||||
double Galileo_System_Time(double week_number, double TOW); //!< Galileo System Time (GST), ICD paragraph 5.1.2
|
||||
|
||||
/* Galileo ephemeris are 16 parameters and here are reported following the ICD order, paragraph 5.1.1.
|
||||
The number in the name after underscore (_1, _2, _3 and so on) refers to the page were we can find that parameter */
|
||||
int32_t IOD_ephemeris{};
|
||||
int32_t IOD_nav_1{};
|
||||
int32_t SV_ID_PRN_4{};
|
||||
double M0_1{}; //!< Mean anomaly at reference time [semi-circles]
|
||||
double delta_n_3{}; //!< Mean motion difference from computed value [semi-circles/sec]
|
||||
double e_1{}; //!< Eccentricity
|
||||
double A_1{}; //!< Square root of the semi-major axis [meters^1/2]
|
||||
double OMEGA_0_2{}; //!< Longitude of ascending node of orbital plane at weekly epoch [semi-circles]
|
||||
double i_0_2{}; //!< Inclination angle at reference time [semi-circles]
|
||||
double omega_2{}; //!< Argument of perigee [semi-circles]
|
||||
double OMEGA_dot_3{}; //!< Rate of right ascension [semi-circles/sec]
|
||||
double iDot_2{}; //!< Rate of inclination angle [semi-circles/sec]
|
||||
double C_uc_3{}; //!< Amplitude of the cosine harmonic correction term to the argument of latitude [radians]
|
||||
double C_us_3{}; //!< Amplitude of the sine harmonic correction term to the argument of latitude [radians]
|
||||
double C_rc_3{}; //!< Amplitude of the cosine harmonic correction term to the orbit radius [meters]
|
||||
double C_rs_3{}; //!< Amplitude of the sine harmonic correction term to the orbit radius [meters]
|
||||
double C_ic_4{}; //!< Amplitude of the cosine harmonic correction term to the angle of inclination [radians]
|
||||
double C_is_4{}; //!< Amplitude of the sine harmonic correction term to the angle of inclination [radians]
|
||||
int32_t t0e_1{}; //!< Ephemeris reference time [s]
|
||||
|
||||
/* Clock correction parameters */
|
||||
int32_t t0c_4{}; //!< Clock correction data reference Time of Week [sec]
|
||||
double af0_4{}; //!< SV clock bias correction coefficient [s]
|
||||
double af1_4{}; //!< SV clock drift correction coefficient [s/s]
|
||||
double af2_4{}; //!< SV clock drift rate correction coefficient [s/s^2]
|
||||
|
||||
/* GST */
|
||||
// Not belong to ephemeris set (page 1 to 4)
|
||||
int32_t WN_5{}; //!< Week number
|
||||
int32_t TOW_5{}; //!< Time of Week
|
||||
double Galileo_satClkDrift{};
|
||||
double Galileo_dtr{}; //!< relativistic clock correction term
|
||||
int32_t IOD_nav{};
|
||||
|
||||
// SV status
|
||||
int32_t SISA_3{};
|
||||
int32_t E5a_HS{}; //!< E5a Signal Health Status
|
||||
int32_t E5b_HS_5{}; //!< E5b Signal Health Status
|
||||
int32_t E1B_HS_5{}; //!< E1B Signal Health Status
|
||||
bool E5a_DVS{}; //!< E5a Data Validity Status
|
||||
bool E5b_DVS_5{}; //!< E5b Data Validity Status
|
||||
bool E1B_DVS_5{}; //!< E1B Data Validity Status
|
||||
double BGD_E1E5a_5{}; //!< E1-E5a Broadcast Group Delay [s]
|
||||
double BGD_E1E5b_5{}; //!< E1-E5b Broadcast Group Delay [s]
|
||||
|
||||
// satellite positions
|
||||
double d_satpos_X{}; //!< Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis.
|
||||
double d_satpos_Y{}; //!< Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system.
|
||||
double d_satpos_Z{}; //!< Earth-fixed coordinate z of the satellite [m]. The direction of the IERS (International Earth Rotation and Reference Systems Service) Reference Pole (IRP).
|
||||
|
||||
// Satellite velocity
|
||||
double d_satvel_X{}; //!< Earth-fixed velocity coordinate x of the satellite [m]
|
||||
double d_satvel_Y{}; //!< Earth-fixed velocity coordinate y of the satellite [m]
|
||||
double d_satvel_Z{}; //!< Earth-fixed velocity coordinate z of the satellite [m]
|
||||
|
||||
uint32_t i_satellite_PRN{}; //!< SV PRN NUMBER
|
||||
int32_t SISA{}; //!< Signal in space accuracy index
|
||||
int32_t E5a_HS{}; //!< E5a Signal Health Status
|
||||
int32_t E5b_HS{}; //!< E5b Signal Health Status
|
||||
int32_t E1B_HS{}; //!< E1B Signal Health Status
|
||||
bool E5a_DVS{}; //!< E5a Data Validity Status
|
||||
bool E5b_DVS{}; //!< E5b Data Validity Status
|
||||
bool E1B_DVS{}; //!< E1B Data Validity Status
|
||||
double BGD_E1E5a{}; //!< E1-E5a Broadcast Group Delay [s]
|
||||
double BGD_E1E5b{}; //!< E1-E5b Broadcast Group Delay [s]
|
||||
|
||||
bool flag_all_ephemeris{};
|
||||
|
||||
template <class Archive>
|
||||
|
||||
/*!
|
||||
* \brief Serialize is a boost standard method to be called by the boost XML serialization. Here is used to save the ephemeris data on disk file.
|
||||
* \brief Serialize is a boost standard method to be called by the boost XML
|
||||
* serialization. Here is used to save the ephemeris data on disk file.
|
||||
*/
|
||||
inline void serialize(Archive& archive, const uint32_t version)
|
||||
{
|
||||
@ -114,60 +74,45 @@ public:
|
||||
{
|
||||
};
|
||||
|
||||
archive& BOOST_SERIALIZATION_NVP(i_satellite_PRN);
|
||||
|
||||
archive& BOOST_SERIALIZATION_NVP(M0_1);
|
||||
archive& BOOST_SERIALIZATION_NVP(delta_n_3);
|
||||
archive& BOOST_SERIALIZATION_NVP(e_1);
|
||||
archive& BOOST_SERIALIZATION_NVP(A_1);
|
||||
archive& BOOST_SERIALIZATION_NVP(OMEGA_0_2);
|
||||
archive& BOOST_SERIALIZATION_NVP(i_0_2);
|
||||
archive& BOOST_SERIALIZATION_NVP(omega_2);
|
||||
archive& BOOST_SERIALIZATION_NVP(OMEGA_dot_3);
|
||||
archive& BOOST_SERIALIZATION_NVP(iDot_2);
|
||||
archive& BOOST_SERIALIZATION_NVP(C_uc_3);
|
||||
archive& BOOST_SERIALIZATION_NVP(C_us_3);
|
||||
archive& BOOST_SERIALIZATION_NVP(C_rc_3);
|
||||
archive& BOOST_SERIALIZATION_NVP(C_rs_3);
|
||||
archive& BOOST_SERIALIZATION_NVP(C_ic_4);
|
||||
archive& BOOST_SERIALIZATION_NVP(C_is_4);
|
||||
archive& BOOST_SERIALIZATION_NVP(t0e_1);
|
||||
|
||||
archive& BOOST_SERIALIZATION_NVP(t0c_4);
|
||||
archive& BOOST_SERIALIZATION_NVP(af0_4);
|
||||
archive& BOOST_SERIALIZATION_NVP(af1_4);
|
||||
archive& BOOST_SERIALIZATION_NVP(af2_4);
|
||||
|
||||
archive& BOOST_SERIALIZATION_NVP(WN_5);
|
||||
archive& BOOST_SERIALIZATION_NVP(TOW_5);
|
||||
archive& BOOST_SERIALIZATION_NVP(Galileo_satClkDrift);
|
||||
archive& BOOST_SERIALIZATION_NVP(Galileo_dtr);
|
||||
archive& BOOST_SERIALIZATION_NVP(PRN);
|
||||
archive& BOOST_SERIALIZATION_NVP(M_0);
|
||||
archive& BOOST_SERIALIZATION_NVP(delta_n);
|
||||
archive& BOOST_SERIALIZATION_NVP(ecc);
|
||||
archive& BOOST_SERIALIZATION_NVP(sqrtA);
|
||||
archive& BOOST_SERIALIZATION_NVP(OMEGA_0);
|
||||
archive& BOOST_SERIALIZATION_NVP(i_0);
|
||||
archive& BOOST_SERIALIZATION_NVP(omega);
|
||||
archive& BOOST_SERIALIZATION_NVP(OMEGAdot);
|
||||
archive& BOOST_SERIALIZATION_NVP(idot);
|
||||
archive& BOOST_SERIALIZATION_NVP(Cuc);
|
||||
archive& BOOST_SERIALIZATION_NVP(Cus);
|
||||
archive& BOOST_SERIALIZATION_NVP(Crc);
|
||||
archive& BOOST_SERIALIZATION_NVP(Crs);
|
||||
archive& BOOST_SERIALIZATION_NVP(Cic);
|
||||
archive& BOOST_SERIALIZATION_NVP(Cis);
|
||||
archive& BOOST_SERIALIZATION_NVP(toe);
|
||||
archive& BOOST_SERIALIZATION_NVP(toc);
|
||||
archive& BOOST_SERIALIZATION_NVP(af0);
|
||||
archive& BOOST_SERIALIZATION_NVP(af1);
|
||||
archive& BOOST_SERIALIZATION_NVP(af2);
|
||||
archive& BOOST_SERIALIZATION_NVP(WN);
|
||||
archive& BOOST_SERIALIZATION_NVP(tow);
|
||||
archive& BOOST_SERIALIZATION_NVP(satClkDrift);
|
||||
archive& BOOST_SERIALIZATION_NVP(dtr);
|
||||
|
||||
archive& BOOST_SERIALIZATION_NVP(IOD_ephemeris);
|
||||
archive& BOOST_SERIALIZATION_NVP(IOD_nav_1);
|
||||
|
||||
archive& BOOST_SERIALIZATION_NVP(SISA_3);
|
||||
archive& BOOST_SERIALIZATION_NVP(IOD_nav);
|
||||
archive& BOOST_SERIALIZATION_NVP(SISA);
|
||||
archive& BOOST_SERIALIZATION_NVP(E5a_HS);
|
||||
archive& BOOST_SERIALIZATION_NVP(E5b_HS_5);
|
||||
archive& BOOST_SERIALIZATION_NVP(E1B_HS_5);
|
||||
archive& BOOST_SERIALIZATION_NVP(E5b_HS);
|
||||
archive& BOOST_SERIALIZATION_NVP(E1B_HS);
|
||||
archive& BOOST_SERIALIZATION_NVP(E5a_DVS);
|
||||
archive& BOOST_SERIALIZATION_NVP(E5b_DVS_5);
|
||||
archive& BOOST_SERIALIZATION_NVP(E1B_DVS_5);
|
||||
|
||||
archive& BOOST_SERIALIZATION_NVP(BGD_E1E5a_5);
|
||||
archive& BOOST_SERIALIZATION_NVP(BGD_E1E5b_5);
|
||||
|
||||
archive& BOOST_SERIALIZATION_NVP(E5b_DVS);
|
||||
archive& BOOST_SERIALIZATION_NVP(E1B_DVS);
|
||||
archive& BOOST_SERIALIZATION_NVP(BGD_E1E5a);
|
||||
archive& BOOST_SERIALIZATION_NVP(BGD_E1E5b);
|
||||
archive& BOOST_SERIALIZATION_NVP(flag_all_ephemeris);
|
||||
}
|
||||
|
||||
private:
|
||||
/*
|
||||
* Accounts for the beginning or end of week crossover
|
||||
*
|
||||
* \param[in] - time in seconds
|
||||
* \param[out] - corrected time, in seconds
|
||||
*/
|
||||
double check_t(double time);
|
||||
};
|
||||
|
||||
|
||||
|
@ -400,34 +400,33 @@ Galileo_Ephemeris Galileo_Fnav_Message::get_ephemeris() const
|
||||
Galileo_Ephemeris ephemeris;
|
||||
ephemeris.flag_all_ephemeris = flag_all_ephemeris;
|
||||
ephemeris.IOD_ephemeris = IOD_ephemeris;
|
||||
ephemeris.SV_ID_PRN_4 = FNAV_SV_ID_PRN_1;
|
||||
ephemeris.i_satellite_PRN = FNAV_SV_ID_PRN_1;
|
||||
ephemeris.M0_1 = FNAV_M0_2; // Mean anomaly at reference time [semi-circles]
|
||||
ephemeris.delta_n_3 = FNAV_deltan_3; // Mean motion difference from computed value [semi-circles/sec]
|
||||
ephemeris.e_1 = FNAV_e_2; // Eccentricity
|
||||
ephemeris.A_1 = FNAV_a12_2; // Square root of the semi-major axis [meters^1/2]
|
||||
ephemeris.OMEGA_0_2 = FNAV_omega0_2; // Longitude of ascending node of orbital plane at weekly epoch [semi-circles]
|
||||
ephemeris.i_0_2 = FNAV_i0_3; // Inclination angle at reference time [semi-circles]
|
||||
ephemeris.omega_2 = FNAV_w_3; // Argument of perigee [semi-circles]
|
||||
ephemeris.OMEGA_dot_3 = FNAV_omegadot_2; // Rate of right ascension [semi-circles/sec]
|
||||
ephemeris.iDot_2 = FNAV_idot_2; // Rate of inclination angle [semi-circles/sec]
|
||||
ephemeris.C_uc_3 = FNAV_Cuc_3; // Amplitude of the cosine harmonic correction term to the argument of latitude [radians]
|
||||
ephemeris.C_us_3 = FNAV_Cus_3; // Amplitude of the sine harmonic correction term to the argument of latitude [radians]
|
||||
ephemeris.C_rc_3 = FNAV_Crc_3; // Amplitude of the cosine harmonic correction term to the orbit radius [meters]
|
||||
ephemeris.C_rs_3 = FNAV_Crs_3; // Amplitude of the sine harmonic correction term to the orbit radius [meters]
|
||||
ephemeris.C_ic_4 = FNAV_Cic_4; // Amplitude of the cosine harmonic correction term to the angle of inclination [radians]
|
||||
ephemeris.C_is_4 = FNAV_Cis_4; // Amplitude of the sine harmonic correction term to the angle of inclination [radians]
|
||||
ephemeris.t0e_1 = FNAV_t0e_3; // Ephemeris reference time [s]
|
||||
ephemeris.PRN = FNAV_SV_ID_PRN_1;
|
||||
ephemeris.M_0 = FNAV_M0_2; // Mean anomaly at reference time [semi-circles]
|
||||
ephemeris.delta_n = FNAV_deltan_3; // Mean motion difference from computed value [semi-circles/sec]
|
||||
ephemeris.ecc = FNAV_e_2; // Eccentricity
|
||||
ephemeris.sqrtA = FNAV_a12_2; // Square root of the semi-major axis [meters^1/2]
|
||||
ephemeris.OMEGA_0 = FNAV_omega0_2; // Longitude of ascending node of orbital plane at weekly epoch [semi-circles]
|
||||
ephemeris.i_0 = FNAV_i0_3; // Inclination angle at reference time [semi-circles]
|
||||
ephemeris.omega = FNAV_w_3; // Argument of perigee [semi-circles]
|
||||
ephemeris.OMEGAdot = FNAV_omegadot_2; // Rate of right ascension [semi-circles/sec]
|
||||
ephemeris.idot = FNAV_idot_2; // Rate of inclination angle [semi-circles/sec]
|
||||
ephemeris.Cuc = FNAV_Cuc_3; // Amplitude of the cosine harmonic correction term to the argument of latitude [radians]
|
||||
ephemeris.Cus = FNAV_Cus_3; // Amplitude of the sine harmonic correction term to the argument of latitude [radians]
|
||||
ephemeris.Crc = FNAV_Crc_3; // Amplitude of the cosine harmonic correction term to the orbit radius [meters]
|
||||
ephemeris.Crs = FNAV_Crs_3; // Amplitude of the sine harmonic correction term to the orbit radius [meters]
|
||||
ephemeris.Cic = FNAV_Cic_4; // Amplitude of the cosine harmonic correction term to the angle of inclination [radians]
|
||||
ephemeris.Cis = FNAV_Cis_4; // Amplitude of the sine harmonic correction term to the angle of inclination [radians]
|
||||
ephemeris.toe = FNAV_t0e_3; // Ephemeris reference time [s]
|
||||
|
||||
// Clock correction parameters
|
||||
ephemeris.t0c_4 = FNAV_t0c_1; // Clock correction data reference Time of Week [sec]
|
||||
ephemeris.af0_4 = FNAV_af0_1; // SV clock bias correction coefficient [s]
|
||||
ephemeris.af1_4 = FNAV_af1_1; // SV clock drift correction coefficient [s/s]
|
||||
ephemeris.af2_4 = FNAV_af2_1; // SV clock drift rate correction coefficient [s/s^2]
|
||||
ephemeris.toc = FNAV_t0c_1; // Clock correction data reference Time of Week [sec]
|
||||
ephemeris.af0 = FNAV_af0_1; // SV clock bias correction coefficient [s]
|
||||
ephemeris.af1 = FNAV_af1_1; // SV clock drift correction coefficient [s/s]
|
||||
ephemeris.af2 = FNAV_af2_1; // SV clock drift rate correction coefficient [s/s^2]
|
||||
|
||||
// GST
|
||||
ephemeris.WN_5 = FNAV_WN_3; // Week number
|
||||
ephemeris.TOW_5 = FNAV_TOW_3; // Time of Week
|
||||
ephemeris.WN = FNAV_WN_3; // Week number
|
||||
ephemeris.tow = FNAV_TOW_3; // Time of Week
|
||||
|
||||
// Health status
|
||||
ephemeris.E5a_HS = FNAV_E5ahs_1;
|
||||
@ -440,20 +439,20 @@ Galileo_Iono Galileo_Fnav_Message::get_iono() const
|
||||
{
|
||||
Galileo_Iono iono;
|
||||
// Ionospheric correction
|
||||
iono.ai0_5 = FNAV_ai0_1; // Effective Ionisation Level 1st order parameter [sfu]
|
||||
iono.ai1_5 = FNAV_ai1_1; // Effective Ionisation Level 2st order parameter [sfu/degree]
|
||||
iono.ai2_5 = FNAV_ai2_1; // Effective Ionisation Level 3st order parameter [sfu/degree]
|
||||
iono.ai0 = FNAV_ai0_1; // Effective Ionisation Level 1st order parameter [sfu]
|
||||
iono.ai1 = FNAV_ai1_1; // Effective Ionisation Level 2st order parameter [sfu/degree]
|
||||
iono.ai2 = FNAV_ai2_1; // Effective Ionisation Level 3st order parameter [sfu/degree]
|
||||
|
||||
// Ionospheric disturbance flag
|
||||
iono.Region1_flag_5 = FNAV_region1_1; // Ionospheric Disturbance Flag for region 1
|
||||
iono.Region2_flag_5 = FNAV_region2_1; // Ionospheric Disturbance Flag for region 2
|
||||
iono.Region3_flag_5 = FNAV_region3_1; // Ionospheric Disturbance Flag for region 3
|
||||
iono.Region4_flag_5 = FNAV_region4_1; // Ionospheric Disturbance Flag for region 4
|
||||
iono.Region5_flag_5 = FNAV_region5_1; // Ionospheric Disturbance Flag for region 5
|
||||
iono.Region1_flag = FNAV_region1_1; // Ionospheric Disturbance Flag for region 1
|
||||
iono.Region2_flag = FNAV_region2_1; // Ionospheric Disturbance Flag for region 2
|
||||
iono.Region3_flag = FNAV_region3_1; // Ionospheric Disturbance Flag for region 3
|
||||
iono.Region4_flag = FNAV_region4_1; // Ionospheric Disturbance Flag for region 4
|
||||
iono.Region5_flag = FNAV_region5_1; // Ionospheric Disturbance Flag for region 5
|
||||
|
||||
// GST
|
||||
iono.TOW_5 = FNAV_TOW_1;
|
||||
iono.WN_5 = FNAV_WN_1;
|
||||
iono.tow = FNAV_TOW_1;
|
||||
iono.WN = FNAV_WN_1;
|
||||
return iono;
|
||||
}
|
||||
|
||||
@ -462,18 +461,15 @@ Galileo_Utc_Model Galileo_Fnav_Message::get_utc_model() const
|
||||
{
|
||||
Galileo_Utc_Model utc_model;
|
||||
// Word type 6: GST-UTC conversion parameters
|
||||
utc_model.A0_6 = FNAV_A0_4;
|
||||
utc_model.A1_6 = FNAV_A1_4;
|
||||
utc_model.Delta_tLS_6 = FNAV_deltatls_4;
|
||||
utc_model.t0t_6 = FNAV_t0t_4;
|
||||
utc_model.WNot_6 = FNAV_WNot_4;
|
||||
utc_model.WN_LSF_6 = FNAV_WNlsf_4;
|
||||
utc_model.DN_6 = FNAV_DN_4;
|
||||
utc_model.Delta_tLSF_6 = FNAV_deltatlsf_4;
|
||||
utc_model.A0 = FNAV_A0_4;
|
||||
utc_model.A1 = FNAV_A1_4;
|
||||
utc_model.Delta_tLS = FNAV_deltatls_4;
|
||||
utc_model.tot = FNAV_t0t_4;
|
||||
utc_model.WNot = FNAV_WNot_4;
|
||||
utc_model.WN_LSF = FNAV_WNlsf_4;
|
||||
utc_model.DN = FNAV_DN_4;
|
||||
utc_model.Delta_tLSF = FNAV_deltatlsf_4;
|
||||
utc_model.flag_utc_model = flag_utc_model;
|
||||
// GST
|
||||
// utc_model.WN_5 = WN_5; //Week number
|
||||
// utc_model.TOW_5 = WN_5; //Time of Week
|
||||
return utc_model;
|
||||
}
|
||||
|
||||
|
@ -267,45 +267,45 @@ Galileo_Ephemeris Galileo_Inav_Message::get_ephemeris() const
|
||||
Galileo_Ephemeris ephemeris;
|
||||
ephemeris.flag_all_ephemeris = flag_all_ephemeris;
|
||||
ephemeris.IOD_ephemeris = IOD_ephemeris;
|
||||
ephemeris.SV_ID_PRN_4 = SV_ID_PRN_4;
|
||||
ephemeris.i_satellite_PRN = SV_ID_PRN_4;
|
||||
ephemeris.M0_1 = M0_1; // Mean anomaly at reference time [semi-circles]
|
||||
ephemeris.delta_n_3 = delta_n_3; // Mean motion difference from computed value [semi-circles/sec]
|
||||
ephemeris.e_1 = e_1; // Eccentricity
|
||||
ephemeris.A_1 = A_1; // Square root of the semi-major axis [meters^1/2]
|
||||
ephemeris.OMEGA_0_2 = OMEGA_0_2; // Longitude of ascending node of orbital plane at weekly epoch [semi-circles]
|
||||
ephemeris.i_0_2 = i_0_2; // Inclination angle at reference time [semi-circles]
|
||||
ephemeris.omega_2 = omega_2; // Argument of perigee [semi-circles]
|
||||
ephemeris.OMEGA_dot_3 = OMEGA_dot_3; // Rate of right ascension [semi-circles/sec]
|
||||
ephemeris.iDot_2 = iDot_2; // Rate of inclination angle [semi-circles/sec]
|
||||
ephemeris.C_uc_3 = C_uc_3; // Amplitude of the cosine harmonic correction term to the argument of latitude [radians]
|
||||
ephemeris.C_us_3 = C_us_3; // Amplitude of the sine harmonic correction term to the argument of latitude [radians]
|
||||
ephemeris.C_rc_3 = C_rc_3; // Amplitude of the cosine harmonic correction term to the orbit radius [meters]
|
||||
ephemeris.C_rs_3 = C_rs_3; // Amplitude of the sine harmonic correction term to the orbit radius [meters]
|
||||
ephemeris.C_ic_4 = C_ic_4; // Amplitude of the cosine harmonic correction term to the angle of inclination [radians]
|
||||
ephemeris.C_is_4 = C_is_4; // Amplitude of the sine harmonic correction term to the angle of inclination [radians]
|
||||
ephemeris.t0e_1 = t0e_1; // Ephemeris reference time [s]
|
||||
ephemeris.IOD_nav = IOD_nav_1;
|
||||
ephemeris.PRN = SV_ID_PRN_4;
|
||||
ephemeris.M_0 = M0_1; // Mean anomaly at reference time [semi-circles]
|
||||
ephemeris.delta_n = delta_n_3; // Mean motion difference from computed value [semi-circles/sec]
|
||||
ephemeris.ecc = e_1; // Eccentricity
|
||||
ephemeris.sqrtA = A_1; // Square root of the semi-major axis [meters^1/2]
|
||||
ephemeris.OMEGA_0 = OMEGA_0_2; // Longitude of ascending node of orbital plane at weekly epoch [semi-circles]
|
||||
ephemeris.i_0 = i_0_2; // Inclination angle at reference time [semi-circles]
|
||||
ephemeris.omega = omega_2; // Argument of perigee [semi-circles]
|
||||
ephemeris.OMEGAdot = OMEGA_dot_3; // Rate of right ascension [semi-circles/sec]
|
||||
ephemeris.idot = iDot_2; // Rate of inclination angle [semi-circles/sec]
|
||||
ephemeris.Cuc = C_uc_3; // Amplitude of the cosine harmonic correction term to the argument of latitude [radians]
|
||||
ephemeris.Cus = C_us_3; // Amplitude of the sine harmonic correction term to the argument of latitude [radians]
|
||||
ephemeris.Crc = C_rc_3; // Amplitude of the cosine harmonic correction term to the orbit radius [meters]
|
||||
ephemeris.Crs = C_rs_3; // Amplitude of the sine harmonic correction term to the orbit radius [meters]
|
||||
ephemeris.Cic = C_ic_4; // Amplitude of the cosine harmonic correction term to the angle of inclination [radians]
|
||||
ephemeris.Cis = C_is_4; // Amplitude of the sine harmonic correction term to the angle of inclination [radians]
|
||||
ephemeris.toe = t0e_1; // Ephemeris reference time [s]
|
||||
|
||||
// Clock correction parameters
|
||||
ephemeris.t0c_4 = t0c_4; // Clock correction data reference Time of Week [sec]
|
||||
ephemeris.af0_4 = af0_4; // SV clock bias correction coefficient [s]
|
||||
ephemeris.af1_4 = af1_4; // SV clock drift correction coefficient [s/s]
|
||||
ephemeris.af2_4 = af2_4; // SV clock drift rate correction coefficient [s/s^2]
|
||||
ephemeris.toc = t0c_4; // Clock correction data reference Time of Week [sec]
|
||||
ephemeris.af0 = af0_4; // SV clock bias correction coefficient [s]
|
||||
ephemeris.af1 = af1_4; // SV clock drift correction coefficient [s/s]
|
||||
ephemeris.af2 = af2_4; // SV clock drift rate correction coefficient [s/s^2]
|
||||
|
||||
// GST
|
||||
ephemeris.WN_5 = WN_5; // Week number
|
||||
ephemeris.TOW_5 = TOW_5; // Time of Week
|
||||
ephemeris.WN = WN_5; // Week number
|
||||
ephemeris.tow = TOW_5; // Time of Week
|
||||
|
||||
ephemeris.SISA_3 = SISA_3;
|
||||
ephemeris.E5b_HS_5 = E5b_HS_5; // E5b Signal Health Status
|
||||
ephemeris.E1B_HS_5 = E1B_HS_5; // E1B Signal Health Status
|
||||
ephemeris.E5b_DVS_5 = E5b_DVS_5; // E5b Data Validity Status
|
||||
ephemeris.E1B_DVS_5 = E1B_DVS_5; // E1B Data Validity Status
|
||||
ephemeris.SISA = SISA_3;
|
||||
ephemeris.E5b_HS = E5b_HS_5; // E5b Signal Health Status
|
||||
ephemeris.E1B_HS = E1B_HS_5; // E1B Signal Health Status
|
||||
ephemeris.E5b_DVS = E5b_DVS_5; // E5b Data Validity Status
|
||||
ephemeris.E1B_DVS = E1B_DVS_5; // E1B Data Validity Status
|
||||
|
||||
ephemeris.BGD_E1E5a_5 = BGD_E1E5a_5; // E1-E5a Broadcast Group Delay [s]
|
||||
ephemeris.BGD_E1E5b_5 = BGD_E1E5b_5; // E1-E5b Broadcast Group Delay [s]
|
||||
ephemeris.BGD_E1E5a = BGD_E1E5a_5; // E1-E5a Broadcast Group Delay [s]
|
||||
ephemeris.BGD_E1E5b = BGD_E1E5b_5; // E1-E5b Broadcast Group Delay [s]
|
||||
|
||||
ephemeris.Galileo_satClkDrift = Galileo_satClkDrift;
|
||||
ephemeris.satClkDrift = Galileo_satClkDrift;
|
||||
|
||||
return ephemeris;
|
||||
}
|
||||
@ -315,21 +315,21 @@ Galileo_Iono Galileo_Inav_Message::get_iono() const
|
||||
{
|
||||
Galileo_Iono iono;
|
||||
// Ionospheric correction
|
||||
iono.ai0_5 = ai0_5; // Effective Ionisation Level 1st order parameter [sfu]
|
||||
iono.ai1_5 = ai1_5; // Effective Ionisation Level 2st order parameter [sfu/degree]
|
||||
iono.ai2_5 = ai2_5; // Effective Ionisation Level 3st order parameter [sfu/degree]
|
||||
iono.ai0 = ai0_5; // Effective Ionisation Level 1st order parameter [sfu]
|
||||
iono.ai1 = ai1_5; // Effective Ionisation Level 2st order parameter [sfu/degree]
|
||||
iono.ai2 = ai2_5; // Effective Ionisation Level 3st order parameter [sfu/degree]
|
||||
|
||||
// GST
|
||||
// This is the ONLY page containing the Week Number (WN)
|
||||
iono.TOW_5 = TOW_5;
|
||||
iono.WN_5 = WN_5;
|
||||
iono.tow = TOW_5;
|
||||
iono.WN = WN_5;
|
||||
|
||||
// Ionospheric disturbance flag
|
||||
iono.Region1_flag_5 = Region1_flag_5; // Ionospheric Disturbance Flag for region 1
|
||||
iono.Region2_flag_5 = Region2_flag_5; // Ionospheric Disturbance Flag for region 2
|
||||
iono.Region3_flag_5 = Region3_flag_5; // Ionospheric Disturbance Flag for region 3
|
||||
iono.Region4_flag_5 = Region4_flag_5; // Ionospheric Disturbance Flag for region 4
|
||||
iono.Region5_flag_5 = Region5_flag_5; // Ionospheric Disturbance Flag for region 5
|
||||
iono.Region1_flag = Region1_flag_5; // Ionospheric Disturbance Flag for region 1
|
||||
iono.Region2_flag = Region2_flag_5; // Ionospheric Disturbance Flag for region 2
|
||||
iono.Region3_flag = Region3_flag_5; // Ionospheric Disturbance Flag for region 3
|
||||
iono.Region4_flag = Region4_flag_5; // Ionospheric Disturbance Flag for region 4
|
||||
iono.Region5_flag = Region5_flag_5; // Ionospheric Disturbance Flag for region 5
|
||||
|
||||
return iono;
|
||||
}
|
||||
@ -339,20 +339,20 @@ Galileo_Utc_Model Galileo_Inav_Message::get_utc_model() const
|
||||
{
|
||||
Galileo_Utc_Model utc_model;
|
||||
// Word type 6: GST-UTC conversion parameters
|
||||
utc_model.A0_6 = A0_6;
|
||||
utc_model.A1_6 = A1_6;
|
||||
utc_model.Delta_tLS_6 = Delta_tLS_6;
|
||||
utc_model.t0t_6 = t0t_6;
|
||||
utc_model.WNot_6 = WNot_6;
|
||||
utc_model.WN_LSF_6 = WN_LSF_6;
|
||||
utc_model.DN_6 = DN_6;
|
||||
utc_model.Delta_tLSF_6 = Delta_tLSF_6;
|
||||
utc_model.A0 = A0_6;
|
||||
utc_model.A1 = A1_6;
|
||||
utc_model.Delta_tLS = Delta_tLS_6;
|
||||
utc_model.tot = t0t_6;
|
||||
utc_model.WNot = WNot_6;
|
||||
utc_model.WN_LSF = WN_LSF_6;
|
||||
utc_model.DN = DN_6;
|
||||
utc_model.Delta_tLSF = Delta_tLSF_6;
|
||||
utc_model.flag_utc_model = flag_utc_model;
|
||||
// GPS to Galileo GST conversion parameters
|
||||
utc_model.A_0G_10 = A_0G_10;
|
||||
utc_model.A_1G_10 = A_1G_10;
|
||||
utc_model.t_0G_10 = t_0G_10;
|
||||
utc_model.WN_0G_10 = WN_0G_10;
|
||||
utc_model.A_0G = A_0G_10;
|
||||
utc_model.A_1G = A_1G_10;
|
||||
utc_model.t_0G = t_0G_10;
|
||||
utc_model.WN_0G = WN_0G_10;
|
||||
return utc_model;
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,8 @@
|
||||
|
||||
|
||||
/*!
|
||||
* \brief This class is a storage for the GALILEO IONOSPHERIC data as described in Galileo ICD paragraph 5.1.6
|
||||
* \brief This class is a storage for the GALILEO IONOSPHERIC data as described
|
||||
* in Galileo ICD paragraph 5.1.6
|
||||
*
|
||||
* See https://www.gsc-europa.eu/sites/default/files/sites/all/files/Galileo_OS_SIS_ICD_v2.0.pdf
|
||||
*/
|
||||
@ -42,20 +43,20 @@ public:
|
||||
Galileo_Iono() = default;
|
||||
|
||||
// Ionospheric correction
|
||||
double ai0_5{}; //!< Effective Ionisation Level 1st order parameter [sfu]
|
||||
double ai1_5{}; //!< Effective Ionisation Level 2st order parameter [sfu/degree]
|
||||
double ai2_5{}; //!< Effective Ionisation Level 3st order parameter [sfu/degree]
|
||||
double ai0{}; //!< Effective Ionisation Level 1st order parameter [sfu]
|
||||
double ai1{}; //!< Effective Ionisation Level 2st order parameter [sfu/degree]
|
||||
double ai2{}; //!< Effective Ionisation Level 3st order parameter [sfu/degree]
|
||||
|
||||
// from page 5 (UTC) to have a timestamp
|
||||
int32_t TOW_5{}; //!< UTC data reference Time of Week [s]
|
||||
int32_t WN_5{}; //!< UTC data reference Week number [week]
|
||||
int32_t tow{}; //!< UTC data reference Time of Week [s]
|
||||
int32_t WN{}; //!< UTC data reference Week number [week]
|
||||
|
||||
// Ionospheric disturbance flag
|
||||
bool Region1_flag_5{}; //!< Ionospheric Disturbance Flag for region 1
|
||||
bool Region2_flag_5{}; //!< Ionospheric Disturbance Flag for region 2
|
||||
bool Region3_flag_5{}; //!< Ionospheric Disturbance Flag for region 3
|
||||
bool Region4_flag_5{}; //!< Ionospheric Disturbance Flag for region 4
|
||||
bool Region5_flag_5{}; //!< Ionospheric Disturbance Flag for region 5
|
||||
bool Region1_flag{}; //!< Ionospheric Disturbance Flag for region 1
|
||||
bool Region2_flag{}; //!< Ionospheric Disturbance Flag for region 2
|
||||
bool Region3_flag{}; //!< Ionospheric Disturbance Flag for region 3
|
||||
bool Region4_flag{}; //!< Ionospheric Disturbance Flag for region 4
|
||||
bool Region5_flag{}; //!< Ionospheric Disturbance Flag for region 5
|
||||
|
||||
template <class Archive>
|
||||
|
||||
@ -65,20 +66,19 @@ public:
|
||||
*/
|
||||
inline void serialize(Archive& archive, const unsigned int version)
|
||||
{
|
||||
using boost::serialization::make_nvp;
|
||||
if (version)
|
||||
{
|
||||
};
|
||||
archive& make_nvp("ai0_5", ai0_5);
|
||||
archive& make_nvp("ai1_5", ai1_5);
|
||||
archive& make_nvp("ai2_5", ai2_5);
|
||||
archive& make_nvp("TOW_5", TOW_5);
|
||||
archive& make_nvp("WN_5", WN_5);
|
||||
archive& make_nvp("Region1_flag_5", Region1_flag_5);
|
||||
archive& make_nvp("Region2_flag_5", Region2_flag_5);
|
||||
archive& make_nvp("Region3_flag_5", Region3_flag_5);
|
||||
archive& make_nvp("Region4_flag_5", Region4_flag_5);
|
||||
archive& make_nvp("Region5_flag_5", Region5_flag_5);
|
||||
archive& BOOST_SERIALIZATION_NVP(ai0);
|
||||
archive& BOOST_SERIALIZATION_NVP(ai1);
|
||||
archive& BOOST_SERIALIZATION_NVP(ai2);
|
||||
archive& BOOST_SERIALIZATION_NVP(tow);
|
||||
archive& BOOST_SERIALIZATION_NVP(WN);
|
||||
archive& BOOST_SERIALIZATION_NVP(Region1_flag);
|
||||
archive& BOOST_SERIALIZATION_NVP(Region2_flag);
|
||||
archive& BOOST_SERIALIZATION_NVP(Region3_flag);
|
||||
archive& BOOST_SERIALIZATION_NVP(Region4_flag);
|
||||
archive& BOOST_SERIALIZATION_NVP(Region5_flag);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -24,12 +24,12 @@ double Galileo_Utc_Model::GST_to_UTC_time(double t_e, int32_t WN) const
|
||||
double t_Utc_daytime;
|
||||
double Delta_t_Utc = 0;
|
||||
// Determine if the effectivity time of the leap second event is in the past
|
||||
const int32_t weeksToLeapSecondEvent = WN_LSF_6 - (WN % 256);
|
||||
const int32_t weeksToLeapSecondEvent = WN_LSF - (WN % 256);
|
||||
|
||||
if ((weeksToLeapSecondEvent) >= 0) // is not in the past
|
||||
{
|
||||
// Detect if the effectivity time and user's time is within six hours = 6 * 60 *60 = 21600 s
|
||||
const int secondOfLeapSecondEvent = DN_6 * 24 * 60 * 60;
|
||||
const int secondOfLeapSecondEvent = DN * 24 * 60 * 60;
|
||||
if (std::abs(t_e - secondOfLeapSecondEvent) > 21600)
|
||||
{
|
||||
/* 5.1.7a GST->UTC case a
|
||||
@ -39,7 +39,7 @@ double Galileo_Utc_Model::GST_to_UTC_time(double t_e, int32_t WN) const
|
||||
* to the effective time and ends at six hours after the effective time,
|
||||
* the GST/Utc relationship is given by
|
||||
*/
|
||||
Delta_t_Utc = Delta_tLS_6 + A0_6 + A1_6 * (t_e - t0t_6 + 604800 * static_cast<double>((WN % 256) - WNot_6));
|
||||
Delta_t_Utc = Delta_tLS + A0 + A1 * (t_e - tot + 604800 * static_cast<double>((WN % 256) - WNot));
|
||||
t_Utc_daytime = fmod(t_e - Delta_t_Utc, 86400);
|
||||
}
|
||||
else
|
||||
@ -49,9 +49,9 @@ double Galileo_Utc_Model::GST_to_UTC_time(double t_e, int32_t WN) const
|
||||
* prior to the leap second adjustment to six hours after the adjustment time,
|
||||
* the effective time is computed according to the following equations:
|
||||
*/
|
||||
Delta_t_Utc = Delta_tLS_6 + A0_6 + A1_6 * (t_e - t0t_6 + 604800 * static_cast<double>((WN % 256) - WNot_6));
|
||||
Delta_t_Utc = Delta_tLS + A0 + A1 * (t_e - tot + 604800 * static_cast<double>((WN % 256) - WNot));
|
||||
const double W = fmod(t_e - Delta_t_Utc - 43200, 86400) + 43200;
|
||||
t_Utc_daytime = fmod(W, 86400 + Delta_tLSF_6 - Delta_tLS_6);
|
||||
t_Utc_daytime = fmod(W, 86400 + Delta_tLSF - Delta_tLS);
|
||||
// implement something to handle a leap second event!
|
||||
}
|
||||
}
|
||||
@ -64,7 +64,7 @@ double Galileo_Utc_Model::GST_to_UTC_time(double t_e, int32_t WN) const
|
||||
* ends six hours after the adjustment time, the effective time is computed according to
|
||||
* the following equation:
|
||||
*/
|
||||
Delta_t_Utc = Delta_tLSF_6 + A0_6 + A1_6 * (t_e - t0t_6 + 604800 * static_cast<double>((WN % 256) - WNot_6));
|
||||
Delta_t_Utc = Delta_tLSF + A0 + A1 * (t_e - tot + 604800 * static_cast<double>((WN % 256) - WNot));
|
||||
t_Utc_daytime = fmod(t_e - Delta_t_Utc, 86400);
|
||||
}
|
||||
|
||||
|
@ -41,24 +41,24 @@ public:
|
||||
*/
|
||||
Galileo_Utc_Model() = default;
|
||||
|
||||
// double TOW_6;
|
||||
// double TOW;
|
||||
double GST_to_UTC_time(double t_e, int32_t WN) const; //!< GST-UTC Conversion Algorithm and Parameters
|
||||
|
||||
// Word type 6: GST-UTC conversion parameters
|
||||
double A0_6{};
|
||||
double A1_6{};
|
||||
int32_t Delta_tLS_6{};
|
||||
int32_t t0t_6{}; //!< UTC data reference Time of Week [s]
|
||||
int32_t WNot_6{}; //!< UTC data reference Week number [week]
|
||||
int32_t WN_LSF_6{};
|
||||
int32_t DN_6{};
|
||||
int32_t Delta_tLSF_6{};
|
||||
double A0{};
|
||||
double A1{};
|
||||
int32_t Delta_tLS{};
|
||||
int32_t tot{}; //!< UTC data reference Time of Week [s]
|
||||
int32_t WNot{}; //!< UTC data reference Week number [week]
|
||||
int32_t WN_LSF{};
|
||||
int32_t DN{};
|
||||
int32_t Delta_tLSF{};
|
||||
|
||||
// GPS to Galileo GST conversion parameters
|
||||
double A_0G_10{};
|
||||
double A_1G_10{};
|
||||
int32_t t_0G_10{};
|
||||
int32_t WN_0G_10{};
|
||||
double A_0G{};
|
||||
double A_1G{};
|
||||
int32_t t_0G{};
|
||||
int32_t WN_0G{};
|
||||
|
||||
bool flag_utc_model{};
|
||||
|
||||
@ -70,19 +70,18 @@ public:
|
||||
*/
|
||||
inline void serialize(Archive& archive, const unsigned int version)
|
||||
{
|
||||
using boost::serialization::make_nvp;
|
||||
if (version)
|
||||
{
|
||||
};
|
||||
archive& make_nvp("A0_6", A0_6);
|
||||
archive& make_nvp("A1_6", A1_6);
|
||||
archive& make_nvp("Delta_tLS_6", Delta_tLS_6);
|
||||
archive& make_nvp("t0t_6", t0t_6);
|
||||
archive& make_nvp("WNot_6", WNot_6);
|
||||
archive& make_nvp("WN_LSF_6", WN_LSF_6);
|
||||
archive& make_nvp("DN_6", DN_6);
|
||||
archive& make_nvp("Delta_tLSF_6", Delta_tLSF_6);
|
||||
archive& make_nvp("flag_utc_model", flag_utc_model);
|
||||
archive& BOOST_SERIALIZATION_NVP(A0);
|
||||
archive& BOOST_SERIALIZATION_NVP(A1);
|
||||
archive& BOOST_SERIALIZATION_NVP(Delta_tLS);
|
||||
archive& BOOST_SERIALIZATION_NVP(tot);
|
||||
archive& BOOST_SERIALIZATION_NVP(WNot);
|
||||
archive& BOOST_SERIALIZATION_NVP(WN_LSF);
|
||||
archive& BOOST_SERIALIZATION_NVP(DN);
|
||||
archive& BOOST_SERIALIZATION_NVP(Delta_tLSF);
|
||||
archive& BOOST_SERIALIZATION_NVP(flag_utc_model);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -59,37 +59,37 @@ public:
|
||||
|
||||
// Satellite Identification Information
|
||||
int32_t i_satellite_freq_channel{}; //!< SV Frequency Channel Number
|
||||
uint32_t i_satellite_PRN{}; //!< SV PRN Number, equivalent to slot number for compatibility with GPS
|
||||
uint32_t PRN{}; //!< SV PRN Number, equivalent to slot number for compatibility with GPS
|
||||
uint32_t i_satellite_slot_number{}; //!< SV Slot Number
|
||||
|
||||
template <class Archive>
|
||||
/*!
|
||||
* \brief Serialize is a boost standard method to be called by the boost XML serialization. Here is used to save the almanac data on disk file.
|
||||
* \brief Serialize is a boost standard method to be called by the boost XML
|
||||
* serialization. Here is used to save the almanac data on disk file.
|
||||
*/
|
||||
void serialize(Archive& archive, const uint32_t version)
|
||||
{
|
||||
using boost::serialization::make_nvp;
|
||||
if (version)
|
||||
{
|
||||
};
|
||||
|
||||
archive& make_nvp("i_satellite_freq_channel", i_satellite_freq_channel);
|
||||
archive& make_nvp("i_satellite_PRN", i_satellite_PRN);
|
||||
archive& make_nvp("i_satellite_slot_number", i_satellite_slot_number);
|
||||
archive& make_nvp("d_n_A", d_n_A);
|
||||
archive& make_nvp("d_H_n_A", d_H_n_A);
|
||||
archive& make_nvp("d_lambda_n_A", d_lambda_n_A);
|
||||
archive& make_nvp("d_t_lambda_n_A", d_t_lambda_n_A);
|
||||
archive& make_nvp("d_Delta_i_n_A", d_Delta_i_n_A);
|
||||
archive& make_nvp("d_Delta_T_n_A", d_Delta_T_n_A);
|
||||
archive& make_nvp("d_Delta_T_n_A_dot", d_Delta_T_n_A_dot);
|
||||
archive& make_nvp("d_epsilon_n_A", d_epsilon_n_A);
|
||||
archive& make_nvp("d_omega_n_A", d_omega_n_A);
|
||||
archive& make_nvp("d_M_n_A", d_M_n_A);
|
||||
archive& make_nvp("d_KP", d_KP);
|
||||
archive& make_nvp("d_tau_n_A", d_tau_n_A);
|
||||
archive& make_nvp("d_C_n", d_C_n);
|
||||
archive& make_nvp("d_l_n", d_l_n);
|
||||
archive& BOOST_SERIALIZATION_NVP(i_satellite_freq_channel);
|
||||
archive& BOOST_SERIALIZATION_NVP(PRN);
|
||||
archive& BOOST_SERIALIZATION_NVP(i_satellite_slot_number);
|
||||
archive& BOOST_SERIALIZATION_NVP(d_n_A);
|
||||
archive& BOOST_SERIALIZATION_NVP(d_H_n_A);
|
||||
archive& BOOST_SERIALIZATION_NVP(d_lambda_n_A);
|
||||
archive& BOOST_SERIALIZATION_NVP(d_t_lambda_n_A);
|
||||
archive& BOOST_SERIALIZATION_NVP(d_Delta_i_n_A);
|
||||
archive& BOOST_SERIALIZATION_NVP(d_Delta_T_n_A);
|
||||
archive& BOOST_SERIALIZATION_NVP(d_Delta_T_n_A_dot);
|
||||
archive& BOOST_SERIALIZATION_NVP(d_epsilon_n_A);
|
||||
archive& BOOST_SERIALIZATION_NVP(d_omega_n_A);
|
||||
archive& BOOST_SERIALIZATION_NVP(d_M_n_A);
|
||||
archive& BOOST_SERIALIZATION_NVP(d_KP);
|
||||
archive& BOOST_SERIALIZATION_NVP(d_tau_n_A);
|
||||
archive& BOOST_SERIALIZATION_NVP(d_C_n);
|
||||
archive& BOOST_SERIALIZATION_NVP(d_l_n);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -77,7 +77,7 @@ public:
|
||||
// Immediate deliverables of ephemeris information
|
||||
// Satellite Identification Information
|
||||
int32_t i_satellite_freq_channel{}; //!< SV Frequency Channel Number
|
||||
uint32_t i_satellite_PRN{}; //!< SV PRN Number, equivalent to slot number for compatibility with GPS
|
||||
uint32_t PRN{}; //!< SV PRN Number, equivalent to slot number for compatibility with GPS
|
||||
uint32_t i_satellite_slot_number{}; //!< SV Slot Number
|
||||
double d_yr = 1972.0; //!< Current year
|
||||
double d_satClkDrift{}; //!< GLONASS clock error
|
||||
@ -123,46 +123,46 @@ public:
|
||||
template <class Archive>
|
||||
|
||||
/*!
|
||||
* \brief Serialize is a boost standard method to be called by the boost XML serialization. Here is used to save the ephemeris data on disk file.
|
||||
* \brief Serialize is a boost standard method to be called by the boost XML
|
||||
* serialization. Here is used to save the ephemeris data on disk file.
|
||||
*/
|
||||
void serialize(Archive& archive, const uint32_t version)
|
||||
{
|
||||
using boost::serialization::make_nvp;
|
||||
if (version)
|
||||
{
|
||||
};
|
||||
|
||||
archive& make_nvp("i_satellite_freq_channel", i_satellite_freq_channel); //!< SV PRN frequency channel number
|
||||
archive& make_nvp("i_satellite_PRN", i_satellite_PRN);
|
||||
archive& make_nvp("i_satellite_slot_number", i_satellite_slot_number);
|
||||
archive& make_nvp("d_m", d_m); //!< String number within frame [dimensionless]
|
||||
archive& make_nvp("d_t_k", d_t_k); //!< Time referenced to the beginning of the frame within the current day [hours, minutes, seconds]
|
||||
archive& make_nvp("d_t_b", d_t_b); //!< Index of a time interval within current day according to UTC(SU) + 03 hours 00 min. [minutes]
|
||||
archive& make_nvp("d_M", d_M); //!< Type of satellite transmitting navigation signal [dimensionless]
|
||||
archive& make_nvp("d_gamma_n", d_gamma_n); //!< Relative deviation of predicted carrier frequency value of n- satellite from nominal value at the instant tb [dimensionless]
|
||||
archive& make_nvp("d_tau_n", d_tau_n); //!< Correction to the nth satellite time (tn) relative to GLONASS time (te)
|
||||
archive& make_nvp("d_Xn", d_Xn); //!< Earth-fixed coordinate x of the satellite in PZ-90.02 coordinate system [km].
|
||||
archive& make_nvp("d_Yn", d_Yn); //!< Earth-fixed coordinate y of the satellite in PZ-90.02 coordinate system [km]
|
||||
archive& make_nvp("d_Zn", d_Zn); //!< Earth-fixed coordinate z of the satellite in PZ-90.02 coordinate system [km]
|
||||
archive& make_nvp("d_VXn", d_VXn); //!< Earth-fixed velocity coordinate x of the satellite in PZ-90.02 coordinate system [km/s]
|
||||
archive& make_nvp("d_VYn", d_VYn); //!< Earth-fixed velocity coordinate y of the satellite in PZ-90.02 coordinate system [km/s]
|
||||
archive& make_nvp("d_VZn", d_VZn); //!< Earth-fixed velocity coordinate z of the satellite in PZ-90.02 coordinate system [km/s]
|
||||
archive& make_nvp("d_AXn", d_AXn); //!< Earth-fixed acceleration coordinate x of the satellite in PZ-90.02 coordinate system [km/s^2]
|
||||
archive& make_nvp("d_AYn", d_AYn); //!< Earth-fixed acceleration coordinate y of the satellite in PZ-90.02 coordinate system [km/s^2]
|
||||
archive& make_nvp("d_AZn", d_AZn); //!< Earth-fixed acceleration coordinate z of the satellite in PZ-90.02 coordinate system [km/s^2]
|
||||
archive& make_nvp("d_B_n", d_B_n); //!< Health flag [dimensionless]
|
||||
archive& make_nvp("d_P", d_P); //!< Technological parameter of control segment, indication the satellite operation mode in respect of time parameters [dimensionless]
|
||||
archive& make_nvp("d_N_T", d_N_T); //!< Current date, calendar number of day within four-year interval starting from the 1-st of January in a leap year [days]
|
||||
archive& make_nvp("d_F_T", d_F_T); //!< Parameter that provides the predicted satellite user range accuracy at time tb [dimensionless]
|
||||
archive& make_nvp("d_n", d_n); //!< Index of the satellite transmitting given navigation signal. It corresponds to a slot number within GLONASS constellation
|
||||
archive& make_nvp("d_Delta_tau_n", d_Delta_tau_n); //!< Time difference between navigation RF signal transmitted in L2 sub- band and aviation RF signal transmitted in L1 sub-band by nth satellite. [dimensionless]
|
||||
archive& make_nvp("d_E_n", d_E_n); //!< Characterises "age" of a current information [days]
|
||||
archive& make_nvp("d_P_1", d_P_1); //!< Flag of the immediate data updating.
|
||||
archive& make_nvp("d_P_2", d_P_2); //!< Flag of oddness ("1") or evenness ("0") of the value of (tb) [dimensionless]
|
||||
archive& make_nvp("d_P_3", d_P_3); //!< Flag indicating a number of satellites for which almanac is transmitted within given frame: "1" corresponds to 5 satellites and "0" corresponds to 4 satellites [dimensionless]
|
||||
archive& make_nvp("d_P_4", d_P_4); //!< Flag to show that ephemeris parameters are present. "1" indicates that updated ephemeris or frequency/time parameters have been uploaded by the control segment [dimensionless]
|
||||
archive& make_nvp("d_l3rd_n", d_l3rd_n); //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is helthy, ln = 1 indicates malfunction of this nth satellite [dimensionless]
|
||||
archive& make_nvp("d_l5th_n", d_l5th_n); //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is helthy, ln = 1 indicates malfunction of this nth satellite [dimensionless]
|
||||
archive& BOOST_SERIALIZATION_NVP(i_satellite_freq_channel); //!< SV PRN frequency channel number
|
||||
archive& BOOST_SERIALIZATION_NVP(PRN);
|
||||
archive& BOOST_SERIALIZATION_NVP(i_satellite_slot_number);
|
||||
archive& BOOST_SERIALIZATION_NVP(d_m); //!< String number within frame [dimensionless]
|
||||
archive& BOOST_SERIALIZATION_NVP(d_t_k); //!< Time referenced to the beginning of the frame within the current day [hours, minutes, seconds]
|
||||
archive& BOOST_SERIALIZATION_NVP(d_t_b); //!< Index of a time interval within current day according to UTC(SU) + 03 hours 00 min. [minutes]
|
||||
archive& BOOST_SERIALIZATION_NVP(d_M); //!< Type of satellite transmitting navigation signal [dimensionless]
|
||||
archive& BOOST_SERIALIZATION_NVP(d_gamma_n); //!< Relative deviation of predicted carrier frequency value of n- satellite from nominal value at the instant tb [dimensionless]
|
||||
archive& BOOST_SERIALIZATION_NVP(d_tau_n); //!< Correction to the nth satellite time (tn) relative to GLONASS time (te)
|
||||
archive& BOOST_SERIALIZATION_NVP(d_Xn); //!< Earth-fixed coordinate x of the satellite in PZ-90.02 coordinate system [km].
|
||||
archive& BOOST_SERIALIZATION_NVP(d_Yn); //!< Earth-fixed coordinate y of the satellite in PZ-90.02 coordinate system [km]
|
||||
archive& BOOST_SERIALIZATION_NVP(d_Zn); //!< Earth-fixed coordinate z of the satellite in PZ-90.02 coordinate system [km]
|
||||
archive& BOOST_SERIALIZATION_NVP(d_VXn); //!< Earth-fixed velocity coordinate x of the satellite in PZ-90.02 coordinate system [km/s]
|
||||
archive& BOOST_SERIALIZATION_NVP(d_VYn); //!< Earth-fixed velocity coordinate y of the satellite in PZ-90.02 coordinate system [km/s]
|
||||
archive& BOOST_SERIALIZATION_NVP(d_VZn); //!< Earth-fixed velocity coordinate z of the satellite in PZ-90.02 coordinate system [km/s]
|
||||
archive& BOOST_SERIALIZATION_NVP(d_AXn); //!< Earth-fixed acceleration coordinate x of the satellite in PZ-90.02 coordinate system [km/s^2]
|
||||
archive& BOOST_SERIALIZATION_NVP(d_AYn); //!< Earth-fixed acceleration coordinate y of the satellite in PZ-90.02 coordinate system [km/s^2]
|
||||
archive& BOOST_SERIALIZATION_NVP(d_AZn); //!< Earth-fixed acceleration coordinate z of the satellite in PZ-90.02 coordinate system [km/s^2]
|
||||
archive& BOOST_SERIALIZATION_NVP(d_B_n); //!< Health flag [dimensionless]
|
||||
archive& BOOST_SERIALIZATION_NVP(d_P); //!< Technological parameter of control segment, indication the satellite operation mode in respect of time parameters [dimensionless]
|
||||
archive& BOOST_SERIALIZATION_NVP(d_N_T); //!< Current date, calendar number of day within four-year interval starting from the 1-st of January in a leap year [days]
|
||||
archive& BOOST_SERIALIZATION_NVP(d_F_T); //!< Parameter that provides the predicted satellite user range accuracy at time tb [dimensionless]
|
||||
archive& BOOST_SERIALIZATION_NVP(d_n); //!< Index of the satellite transmitting given navigation signal. It corresponds to a slot number within GLONASS constellation
|
||||
archive& BOOST_SERIALIZATION_NVP(d_Delta_tau_n); //!< Time difference between navigation RF signal transmitted in L2 sub- band and aviation RF signal transmitted in L1 sub-band by nth satellite. [dimensionless]
|
||||
archive& BOOST_SERIALIZATION_NVP(d_E_n); //!< Characterises "age" of a current information [days]
|
||||
archive& BOOST_SERIALIZATION_NVP(d_P_1); //!< Flag of the immediate data updating.
|
||||
archive& BOOST_SERIALIZATION_NVP(d_P_2); //!< Flag of oddness ("1") or evenness ("0") of the value of (tb) [dimensionless]
|
||||
archive& BOOST_SERIALIZATION_NVP(d_P_3); //!< Flag indicating a number of satellites for which almanac is transmitted within given frame: "1" corresponds to 5 satellites and "0" corresponds to 4 satellites [dimensionless]
|
||||
archive& BOOST_SERIALIZATION_NVP(d_P_4); //!< Flag to show that ephemeris parameters are present. "1" indicates that updated ephemeris or frequency/time parameters have been uploaded by the control segment [dimensionless]
|
||||
archive& BOOST_SERIALIZATION_NVP(d_l3rd_n); //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is helthy, ln = 1 indicates malfunction of this nth satellite [dimensionless]
|
||||
archive& BOOST_SERIALIZATION_NVP(d_l5th_n); //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is helthy, ln = 1 indicates malfunction of this nth satellite [dimensionless]
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -314,7 +314,7 @@ int32_t Glonass_Gnav_Navigation_Message::string_decoder(const std::string& frame
|
||||
// Fill in ephemeris deliverables in the code
|
||||
flag_update_slot_number = true;
|
||||
gnav_ephemeris.i_satellite_slot_number = static_cast<uint32_t>(gnav_ephemeris.d_n);
|
||||
gnav_ephemeris.i_satellite_PRN = static_cast<uint32_t>(gnav_ephemeris.d_n);
|
||||
gnav_ephemeris.PRN = static_cast<uint32_t>(gnav_ephemeris.d_n);
|
||||
|
||||
flag_ephemeris_str_4 = true;
|
||||
}
|
||||
@ -408,7 +408,7 @@ int32_t Glonass_Gnav_Navigation_Message::string_decoder(const std::string& frame
|
||||
gnav_almanac[i_alm_satellite_slot_number - 1].i_satellite_freq_channel = gnav_almanac[i_alm_satellite_slot_number - 1].d_H_n_A - 32.0;
|
||||
}
|
||||
gnav_almanac[i_alm_satellite_slot_number - 1].i_satellite_slot_number = gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A;
|
||||
gnav_almanac[i_alm_satellite_slot_number - 1].i_satellite_PRN = gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A;
|
||||
gnav_almanac[i_alm_satellite_slot_number - 1].PRN = gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A;
|
||||
|
||||
if (i_alm_satellite_slot_number == gnav_ephemeris.i_satellite_slot_number)
|
||||
{
|
||||
@ -458,7 +458,7 @@ int32_t Glonass_Gnav_Navigation_Message::string_decoder(const std::string& frame
|
||||
gnav_almanac[i_alm_satellite_slot_number - 1].i_satellite_freq_channel = gnav_almanac[i_alm_satellite_slot_number - 1].d_H_n_A - 32.0;
|
||||
}
|
||||
gnav_almanac[i_alm_satellite_slot_number - 1].i_satellite_slot_number = gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A;
|
||||
gnav_almanac[i_alm_satellite_slot_number - 1].i_satellite_PRN = gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A;
|
||||
gnav_almanac[i_alm_satellite_slot_number - 1].PRN = gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A;
|
||||
|
||||
flag_almanac_str_9 = true;
|
||||
}
|
||||
@ -503,7 +503,7 @@ int32_t Glonass_Gnav_Navigation_Message::string_decoder(const std::string& frame
|
||||
gnav_almanac[i_alm_satellite_slot_number - 1].i_satellite_freq_channel = gnav_almanac[i_alm_satellite_slot_number - 1].d_H_n_A - 32.0;
|
||||
}
|
||||
gnav_almanac[i_alm_satellite_slot_number - 1].i_satellite_slot_number = gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A;
|
||||
gnav_almanac[i_alm_satellite_slot_number - 1].i_satellite_PRN = gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A;
|
||||
gnav_almanac[i_alm_satellite_slot_number - 1].PRN = gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A;
|
||||
|
||||
flag_almanac_str_11 = true;
|
||||
}
|
||||
@ -547,7 +547,7 @@ int32_t Glonass_Gnav_Navigation_Message::string_decoder(const std::string& frame
|
||||
gnav_almanac[i_alm_satellite_slot_number - 1].i_satellite_freq_channel = gnav_almanac[i_alm_satellite_slot_number - 1].d_H_n_A - 32.0;
|
||||
}
|
||||
gnav_almanac[i_alm_satellite_slot_number - 1].i_satellite_slot_number = gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A;
|
||||
gnav_almanac[i_alm_satellite_slot_number - 1].i_satellite_PRN = gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A;
|
||||
gnav_almanac[i_alm_satellite_slot_number - 1].PRN = gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A;
|
||||
|
||||
flag_almanac_str_13 = true;
|
||||
}
|
||||
@ -598,7 +598,7 @@ int32_t Glonass_Gnav_Navigation_Message::string_decoder(const std::string& frame
|
||||
gnav_almanac[i_alm_satellite_slot_number - 1].i_satellite_freq_channel = gnav_almanac[i_alm_satellite_slot_number - 1].d_H_n_A - 32.0;
|
||||
}
|
||||
gnav_almanac[i_alm_satellite_slot_number - 1].i_satellite_slot_number = gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A;
|
||||
gnav_almanac[i_alm_satellite_slot_number - 1].i_satellite_PRN = gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A;
|
||||
gnav_almanac[i_alm_satellite_slot_number - 1].PRN = gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A;
|
||||
|
||||
flag_almanac_str_15 = true;
|
||||
}
|
||||
|
@ -59,21 +59,21 @@ public:
|
||||
|
||||
template <class Archive>
|
||||
/*!
|
||||
* \brief Serialize is a boost standard method to be called by the boost XML serialization. Here is used to save the almanac data on disk file.
|
||||
* \brief Serialize is a boost standard method to be called by the boost XML
|
||||
* serialization. Here is used to save the almanac data on disk file.
|
||||
*/
|
||||
void serialize(Archive& archive, const uint32_t version)
|
||||
{
|
||||
using boost::serialization::make_nvp;
|
||||
if (version)
|
||||
{
|
||||
};
|
||||
archive& make_nvp("valid", valid);
|
||||
archive& make_nvp("d_tau_c", d_tau_c);
|
||||
archive& make_nvp("d_tau_gps", d_tau_gps);
|
||||
archive& make_nvp("d_N_4", d_N_4);
|
||||
archive& make_nvp("d_N_A", d_N_A);
|
||||
archive& make_nvp("d_B1", d_B1);
|
||||
archive& make_nvp("d_B2", d_B2);
|
||||
archive& BOOST_SERIALIZATION_NVP(valid);
|
||||
archive& BOOST_SERIALIZATION_NVP(d_tau_c);
|
||||
archive& BOOST_SERIALIZATION_NVP(d_tau_gps);
|
||||
archive& BOOST_SERIALIZATION_NVP(d_N_4);
|
||||
archive& BOOST_SERIALIZATION_NVP(d_N_A);
|
||||
archive& BOOST_SERIALIZATION_NVP(d_B1);
|
||||
archive& BOOST_SERIALIZATION_NVP(d_B2);
|
||||
}
|
||||
};
|
||||
|
||||
|
253
src/core/system_parameters/gnss_ephemeris.cc
Normal file
253
src/core/system_parameters/gnss_ephemeris.cc
Normal file
@ -0,0 +1,253 @@
|
||||
/*!
|
||||
* \file gnss_ephemeris.cc
|
||||
* \brief Base class for GNSS Ephemeris
|
||||
* \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
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "gnss_ephemeris.h"
|
||||
#include "MATH_CONSTANTS.h"
|
||||
#include <cmath>
|
||||
|
||||
|
||||
void Gnss_Ephemeris::satellitePosition(double transmitTime)
|
||||
{
|
||||
// Restore semi-major axis
|
||||
const double a = this->sqrtA * this->sqrtA;
|
||||
|
||||
// Computed mean motion
|
||||
double n0;
|
||||
if (this->System == 'E')
|
||||
{
|
||||
n0 = sqrt(GALILEO_GM / (a * a * a));
|
||||
}
|
||||
else if (this->System == 'B')
|
||||
{
|
||||
n0 = sqrt(BEIDOU_GM / (a * a * a));
|
||||
}
|
||||
else
|
||||
{
|
||||
n0 = sqrt(GPS_GM / (a * a * a));
|
||||
}
|
||||
|
||||
// Time from ephemeris reference epoch
|
||||
double tk = check_t(transmitTime - static_cast<double>(this->toe));
|
||||
|
||||
// Corrected mean motion
|
||||
const double n = n0 + this->delta_n;
|
||||
|
||||
// Mean anomaly
|
||||
double M = this->M_0 + n * tk;
|
||||
|
||||
// Reduce mean anomaly to between 0 and 2pi
|
||||
M = fmod((M + 2.0 * GNSS_PI), (2.0 * GNSS_PI));
|
||||
|
||||
// Initial guess of eccentric anomaly
|
||||
double E = M;
|
||||
double E_old;
|
||||
double dE;
|
||||
|
||||
// --- Iteratively compute eccentric anomaly -------------------------------
|
||||
for (int32_t ii = 1; ii < 20; ii++)
|
||||
{
|
||||
E_old = E;
|
||||
E = M + this->ecc * sin(E);
|
||||
dE = fmod(E - E_old, 2.0 * GNSS_PI);
|
||||
if (fabs(dE) < 1e-12)
|
||||
{
|
||||
// Necessary precision is reached, exit from the loop
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
const double sek = sin(E);
|
||||
const double cek = cos(E);
|
||||
const double OneMinusecosE = 1.0 - this->ecc * cek;
|
||||
const double sq1e2 = sqrt(1.0 - this->ecc * this->ecc);
|
||||
const double ekdot = n / OneMinusecosE;
|
||||
|
||||
// Compute the true anomaly
|
||||
const double tmp_Y = sq1e2 * sek;
|
||||
const double tmp_X = cek - this->ecc;
|
||||
const double nu = atan2(tmp_Y, tmp_X);
|
||||
|
||||
// Compute angle phi (argument of Latitude)
|
||||
double phi = nu + this->omega;
|
||||
|
||||
// Reduce phi to between 0 and 2*pi rad
|
||||
phi = fmod((phi), (2.0 * GNSS_PI));
|
||||
const double s2pk = sin(2.0 * phi);
|
||||
const double c2pk = cos(2.0 * phi);
|
||||
const double pkdot = sq1e2 * ekdot / OneMinusecosE;
|
||||
|
||||
// Correct argument of latitude
|
||||
const double u = phi + this->Cuc * c2pk + this->Cus * s2pk;
|
||||
const double suk = sin(u);
|
||||
const double cuk = cos(u);
|
||||
const double ukdot = pkdot * (1.0 + 2.0 * (this->Cus * c2pk - this->Cuc * s2pk));
|
||||
|
||||
// Correct radius
|
||||
const double r = a * OneMinusecosE + this->Crc * c2pk + this->Crs * s2pk;
|
||||
const double rkdot = a * this->ecc * sek * ekdot + 2.0 * pkdot * (this->Crs * c2pk - this->Crc * s2pk);
|
||||
|
||||
// Correct inclination
|
||||
const double i = this->i_0 + this->idot * tk + this->Cic * c2pk + this->Cis * s2pk;
|
||||
const double sik = sin(i);
|
||||
const double cik = cos(i);
|
||||
const double ikdot = this->idot + 2.0 * pkdot * (this->Cis * c2pk - this->Cic * s2pk);
|
||||
|
||||
// Compute the angle between the ascending node and the Greenwich meridian
|
||||
double Omega;
|
||||
double Omega_dot;
|
||||
if (this->System == 'B')
|
||||
{
|
||||
Omega_dot = this->OMEGAdot - BEIDOU_OMEGA_EARTH_DOT;
|
||||
Omega = this->OMEGA_0 + Omega_dot * tk - BEIDOU_OMEGA_EARTH_DOT * static_cast<double>(this->toe);
|
||||
}
|
||||
else
|
||||
{
|
||||
Omega_dot = this->OMEGAdot - GNSS_OMEGA_EARTH_DOT;
|
||||
Omega = this->OMEGA_0 + Omega_dot * tk - GNSS_OMEGA_EARTH_DOT * static_cast<double>(this->toe);
|
||||
}
|
||||
|
||||
// Reduce to between 0 and 2*pi rad
|
||||
Omega = fmod((Omega + 2.0 * GNSS_PI), (2.0 * GNSS_PI));
|
||||
const double sok = sin(Omega);
|
||||
const double cok = cos(Omega);
|
||||
|
||||
// --- Compute satellite coordinates in Earth-fixed coordinates
|
||||
const double xprime = r * cuk;
|
||||
const double yprime = r * suk;
|
||||
this->satpos_X = xprime * cok - yprime * cik * sok;
|
||||
this->satpos_Y = xprime * sok + yprime * cik * cok; // ********NOTE: in GALILEO ICD this expression is not correct because it has minus (- sin(u) * r * cos(i) * cos(Omega)) instead of plus
|
||||
this->satpos_Z = yprime * sik;
|
||||
|
||||
// Satellite's velocity. Can be useful for Vector Tracking loops
|
||||
const double xpkdot = rkdot * cuk - yprime * ukdot;
|
||||
const double ypkdot = rkdot * suk + xprime * ukdot;
|
||||
const double tmp = ypkdot * cik - this->satpos_Z * ikdot;
|
||||
|
||||
this->satvel_X = -Omega_dot * this->satpos_Y + xpkdot * cok - tmp * sok;
|
||||
this->satvel_Y = Omega_dot * this->satpos_X + xpkdot * sok + tmp * cok;
|
||||
this->satvel_Z = yprime * cik * ikdot + ypkdot * sik;
|
||||
|
||||
// Time from ephemeris reference clock
|
||||
tk = check_t(transmitTime - this->toc);
|
||||
|
||||
this->dtr = this->af0 + this->af1 * tk + this->af2 * tk * tk;
|
||||
|
||||
if (this->System == 'E')
|
||||
{
|
||||
this->dtr -= 2.0 * sqrt(GALILEO_GM * a) * this->ecc * sek / (SPEED_OF_LIGHT_M_S * SPEED_OF_LIGHT_M_S);
|
||||
}
|
||||
else if (this->System == 'B')
|
||||
{
|
||||
this->dtr -= 2.0 * sqrt(BEIDOU_GM * a) * this->ecc * sek / (SPEED_OF_LIGHT_M_S * SPEED_OF_LIGHT_M_S);
|
||||
}
|
||||
else
|
||||
{
|
||||
this->dtr -= 2.0 * sqrt(GPS_GM * a) * this->ecc * sek / (SPEED_OF_LIGHT_M_S * SPEED_OF_LIGHT_M_S);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
double Gnss_Ephemeris::sv_clock_drift(double transmitTime)
|
||||
{
|
||||
const double dt = check_t(transmitTime - this->toc);
|
||||
this->dtr = sv_clock_relativistic_term(transmitTime);
|
||||
this->satClkDrift = this->af0 + this->af1 * dt + this->af2 * (dt * dt) + this->dtr;
|
||||
return this->satClkDrift;
|
||||
}
|
||||
|
||||
|
||||
double Gnss_Ephemeris::sv_clock_relativistic_term(double transmitTime) const
|
||||
{
|
||||
// Restore semi-major axis
|
||||
const double a = this->sqrtA * this->sqrtA;
|
||||
|
||||
// Time from ephemeris reference epoch
|
||||
const double tk = check_t(transmitTime - this->toe);
|
||||
|
||||
// Computed mean motion
|
||||
double n0;
|
||||
if (this->System == 'E')
|
||||
{
|
||||
n0 = sqrt(GALILEO_GM / (a * a * a));
|
||||
}
|
||||
if (this->System == 'E')
|
||||
{
|
||||
n0 = sqrt(BEIDOU_GM / (a * a * a));
|
||||
}
|
||||
else
|
||||
{
|
||||
n0 = sqrt(GPS_GM / (a * a * a));
|
||||
}
|
||||
// Corrected mean motion
|
||||
const double n = n0 + this->delta_n;
|
||||
|
||||
// Mean anomaly
|
||||
const double M = this->M_0 + n * tk;
|
||||
|
||||
// Reduce mean anomaly to between 0 and 2pi
|
||||
// M = fmod((M + 2.0 * GNSS_PI), (2.0 * GNSS_PI));
|
||||
|
||||
// Initial guess of eccentric anomaly
|
||||
double E = M;
|
||||
double E_old;
|
||||
double dE;
|
||||
// --- Iteratively compute eccentric anomaly ----------------------------
|
||||
for (int32_t ii = 1; ii < 20; ii++)
|
||||
{
|
||||
E_old = E;
|
||||
E = M + this->ecc * sin(E);
|
||||
dE = fmod(E - E_old, 2.0 * GNSS_PI);
|
||||
if (fabs(dE) < 1e-12)
|
||||
{
|
||||
// Necessary precision is reached, exit from the loop
|
||||
break;
|
||||
}
|
||||
}
|
||||
const double sek = sin(E);
|
||||
|
||||
// Compute relativistic correction term
|
||||
double dtr_;
|
||||
if (this->System == 'E')
|
||||
{
|
||||
dtr_ = GALILEO_F * this->ecc * this->sqrtA * sek;
|
||||
}
|
||||
if (this->System == 'B')
|
||||
{
|
||||
dtr_ = BEIDOU_F * this->ecc * this->sqrtA * sek;
|
||||
}
|
||||
else
|
||||
{
|
||||
dtr_ = GPS_F * this->ecc * this->sqrtA * sek;
|
||||
}
|
||||
return dtr_;
|
||||
}
|
||||
|
||||
|
||||
double Gnss_Ephemeris::check_t(double time) const
|
||||
{
|
||||
const double half_week = 302400.0; // seconds
|
||||
double corrTime = time;
|
||||
if (time > half_week)
|
||||
{
|
||||
corrTime = time - 2.0 * half_week;
|
||||
}
|
||||
else if (time < -half_week)
|
||||
{
|
||||
corrTime = time + 2.0 * half_week;
|
||||
}
|
||||
return corrTime;
|
||||
}
|
90
src/core/system_parameters/gnss_ephemeris.h
Normal file
90
src/core/system_parameters/gnss_ephemeris.h
Normal file
@ -0,0 +1,90 @@
|
||||
/*!
|
||||
* \file gnss_ephemeris.h
|
||||
* \brief Base class for GNSS Ephemeris
|
||||
* \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_EPHEMERIS_H
|
||||
#define GNSS_SDR_GNSS_EPHEMERIS_H
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
/*!
|
||||
* \brief Base class for GNSS ephemeris storage
|
||||
*/
|
||||
class Gnss_Ephemeris
|
||||
{
|
||||
public:
|
||||
Gnss_Ephemeris() = default;
|
||||
|
||||
/*!
|
||||
* \brief Sets (\a satClkDrift) and (\a dtr), and returns the clock drift in
|
||||
* seconds according to the User Algorithm for SV Clock Correction
|
||||
* (IS-GPS-200L, 20.3.3.3.3.1, and Galileo OS SIS ICD, 5.1.4).
|
||||
*/
|
||||
double sv_clock_drift(double transmitTime);
|
||||
|
||||
void satellitePosition(double transmitTime); //!< Computes the ECEF SV coordinates and ECEF velocity
|
||||
|
||||
uint32_t PRN{}; //!< SV ID
|
||||
double M_0{}; //!< Mean anomaly at reference time [semi-circles]
|
||||
double delta_n{}; //!< Mean motion difference from computed value [semi-circles/sec]
|
||||
double ecc{}; //!< Eccentricity
|
||||
double sqrtA{}; //!< Square root of the semi-major axis [meters^1/2]
|
||||
double OMEGA_0{}; //!< Longitude of ascending node of orbital plane at weekly epoch [semi-circles]
|
||||
double i_0{}; //!< Inclination angle at reference time [semi-circles]
|
||||
double omega{}; //!< Argument of perigee [semi-circles]
|
||||
double OMEGAdot{}; //!< Rate of right ascension [semi-circles/sec]
|
||||
double idot{}; //!< Rate of inclination angle [semi-circles/sec]
|
||||
double Cuc{}; //!< Amplitude of the cosine harmonic correction term to the argument of latitude [radians]
|
||||
double Cus{}; //!< Amplitude of the sine harmonic correction term to the argument of latitude [radians]
|
||||
double Crc{}; //!< Amplitude of the cosine harmonic correction term to the orbit radius [meters]
|
||||
double Crs{}; //!< Amplitude of the sine harmonic correction term to the orbit radius [meters]
|
||||
double Cic{}; //!< Amplitude of the cosine harmonic correction term to the angle of inclination [radians]
|
||||
double Cis{}; //!< Amplitude of the sine harmonic correction term to the angle of inclination [radians]
|
||||
int32_t toe{}; //!< Ephemeris reference time [s]
|
||||
|
||||
// Clock correction parameters
|
||||
int32_t toc{}; //!< Clock correction data reference Time of Week [sec]
|
||||
double af0{}; //!< SV clock bias correction coefficient [s]
|
||||
double af1{}; //!< SV clock drift correction coefficient [s/s]
|
||||
double af2{}; //!< SV clock drift rate correction coefficient [s/s^2]
|
||||
|
||||
double satClkDrift{}; //!< SV clock drift
|
||||
double dtr{}; //!< Relativistic clock correction term
|
||||
|
||||
// Time
|
||||
int32_t WN{}; //!< Week number
|
||||
int32_t tow{}; //!< Time of Week
|
||||
|
||||
// satellite positions
|
||||
double satpos_X{}; //!< Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis.
|
||||
double satpos_Y{}; //!< Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system.
|
||||
double satpos_Z{}; //!< Earth-fixed coordinate z of the satellite [m]. The direction of the IERS (International Earth Rotation and Reference Systems Service) Reference Pole (IRP).
|
||||
|
||||
// Satellite velocity
|
||||
double satvel_X{}; //!< Earth-fixed velocity coordinate x of the satellite [m]
|
||||
double satvel_Y{}; //!< Earth-fixed velocity coordinate y of the satellite [m]
|
||||
double satvel_Z{}; //!< Earth-fixed velocity coordinate z of the satellite [m]
|
||||
|
||||
protected:
|
||||
char System{}; //!< Character ID of the GNSS system. 'G': GPS. 'E': Galileo. 'B': BeiDou
|
||||
|
||||
private:
|
||||
double check_t(double time) const;
|
||||
double sv_clock_relativistic_term(double transmitTime) const;
|
||||
};
|
||||
|
||||
#endif // GNSS_SDR_GNSS_EPHEMERIS_H
|
@ -42,10 +42,10 @@ public:
|
||||
*/
|
||||
Gps_Acq_Assist() = default;
|
||||
|
||||
uint32_t i_satellite_PRN{}; //!< SV PRN NUMBER
|
||||
double d_TOW{}; //!< Time Of Week assigned to the acquisition data
|
||||
double d_Doppler0{}; //!< Doppler (0 order term) [Hz]
|
||||
double d_Doppler1{}; //!< Doppler (1 order term) [Hz]
|
||||
uint32_t PRN{}; //!< SV PRN NUMBER
|
||||
double tow{}; //!< Time Of Week assigned to the acquisition data
|
||||
double Doppler0{}; //!< Doppler (0 order term) [Hz]
|
||||
double Doppler1{}; //!< Doppler (1 order term) [Hz]
|
||||
double dopplerUncertainty{}; //!< Doppler Uncertainty [Hz]
|
||||
double Code_Phase{}; //!< Code phase [chips]
|
||||
double Code_Phase_int{}; //!< Integer Code Phase [1 C/A code period]
|
||||
|
@ -40,20 +40,20 @@ public:
|
||||
*/
|
||||
Gps_Almanac() = default;
|
||||
|
||||
uint32_t i_satellite_PRN{}; //!< SV PRN NUMBER
|
||||
double d_Delta_i{}; //!< Inclination Angle at Reference Time (relative to i_0 = 0.30 semi-circles)
|
||||
int32_t i_Toa{}; //!< Almanac data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200L) [s]
|
||||
int32_t i_WNa{}; //!< Almanac week number
|
||||
double d_M_0{}; //!< Mean Anomaly at Reference Time [semi-circles]
|
||||
double d_e_eccentricity{}; //!< Eccentricity [dimensionless]
|
||||
double d_sqrt_A{}; //!< Square Root of the Semi-Major Axis [sqrt(m)]
|
||||
double d_OMEGA0{}; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles]
|
||||
double d_OMEGA{}; //!< Argument of Perigee [semi-cicles]
|
||||
double d_OMEGA_DOT{}; //!< Rate of Right Ascension [semi-circles/s]
|
||||
int32_t i_SV_health{}; //!< SV Health
|
||||
int32_t i_AS_status{}; //!< Anti-Spoofing Flags and SV Configuration
|
||||
double d_A_f0{}; //!< Coefficient 0 of code phase offset model [s]
|
||||
double d_A_f1{}; //!< Coefficient 1 of code phase offset model [s/s]
|
||||
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>
|
||||
|
||||
@ -62,20 +62,20 @@ public:
|
||||
if (version)
|
||||
{
|
||||
};
|
||||
ar& BOOST_SERIALIZATION_NVP(i_satellite_PRN);
|
||||
ar& BOOST_SERIALIZATION_NVP(d_Delta_i);
|
||||
ar& BOOST_SERIALIZATION_NVP(i_Toa);
|
||||
ar& BOOST_SERIALIZATION_NVP(i_WNa);
|
||||
ar& BOOST_SERIALIZATION_NVP(d_M_0);
|
||||
ar& BOOST_SERIALIZATION_NVP(d_e_eccentricity);
|
||||
ar& BOOST_SERIALIZATION_NVP(d_sqrt_A);
|
||||
ar& BOOST_SERIALIZATION_NVP(d_OMEGA0);
|
||||
ar& BOOST_SERIALIZATION_NVP(d_OMEGA);
|
||||
ar& BOOST_SERIALIZATION_NVP(d_OMEGA_DOT);
|
||||
ar& BOOST_SERIALIZATION_NVP(i_SV_health);
|
||||
ar& BOOST_SERIALIZATION_NVP(i_AS_status);
|
||||
ar& BOOST_SERIALIZATION_NVP(d_A_f0);
|
||||
ar& BOOST_SERIALIZATION_NVP(d_A_f1);
|
||||
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(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);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -1,218 +0,0 @@
|
||||
/*!
|
||||
* \file gps_cnav_ephemeris.cc
|
||||
* \brief Interface of a GPS CNAV EPHEMERIS storage and orbital model functions
|
||||
*
|
||||
* See https://www.gps.gov/technical/icwg/IS-GPS-200L.pdf Appendix III
|
||||
* \author Javier Arribas, 2015. jarribas(at)cttc.es
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "gps_cnav_ephemeris.h"
|
||||
#include "MATH_CONSTANTS.h" // for GNSS_PI, SPEED_OF_LIGHT_M_S, F, GPS_GM
|
||||
#include <cmath>
|
||||
|
||||
|
||||
double Gps_CNAV_Ephemeris::check_t(double time)
|
||||
{
|
||||
const double half_week = 302400.0; // seconds
|
||||
double corrTime = time;
|
||||
if (time > half_week)
|
||||
{
|
||||
corrTime = time - 2.0 * half_week;
|
||||
}
|
||||
else if (time < -half_week)
|
||||
{
|
||||
corrTime = time + 2.0 * half_week;
|
||||
}
|
||||
return corrTime;
|
||||
}
|
||||
|
||||
|
||||
// 20.3.3.3.3.1 User Algorithm for SV Clock Correction.
|
||||
double Gps_CNAV_Ephemeris::sv_clock_drift(double transmitTime)
|
||||
{
|
||||
const double dt = check_t(transmitTime - d_Toc);
|
||||
d_satClkDrift = d_A_f0 + d_A_f1 * dt + d_A_f2 * (dt * dt) + sv_clock_relativistic_term(transmitTime);
|
||||
|
||||
// Correct satellite group delay
|
||||
d_satClkDrift -= d_TGD;
|
||||
|
||||
return d_satClkDrift;
|
||||
}
|
||||
|
||||
|
||||
// compute the relativistic correction term
|
||||
double Gps_CNAV_Ephemeris::sv_clock_relativistic_term(double transmitTime)
|
||||
{
|
||||
const double A_REF = 26559710.0; // See IS-GPS-200L, pp. 161
|
||||
const double d_sqrt_A = sqrt(A_REF + d_DELTA_A);
|
||||
|
||||
// Restore semi-major axis
|
||||
const double a = d_sqrt_A * d_sqrt_A;
|
||||
|
||||
// Time from ephemeris reference epoch
|
||||
const double tk = check_t(transmitTime - d_Toe1);
|
||||
|
||||
// Computed mean motion
|
||||
const double n0 = sqrt(GPS_GM / (a * a * a));
|
||||
|
||||
// Corrected mean motion
|
||||
const double n = n0 + d_Delta_n;
|
||||
|
||||
// Mean anomaly
|
||||
const double M = d_M_0 + n * tk;
|
||||
|
||||
// Reduce mean anomaly to between 0 and 2pi
|
||||
// M = fmod((M + 2.0 * GNSS_PI), (2.0 * GNSS_PI));
|
||||
|
||||
// Initial guess of eccentric anomaly
|
||||
double E = M;
|
||||
double E_old;
|
||||
double dE;
|
||||
|
||||
// --- Iteratively compute eccentric anomaly -------------------------------
|
||||
for (int32_t ii = 1; ii < 20; ii++)
|
||||
{
|
||||
E_old = E;
|
||||
E = M + d_e_eccentricity * sin(E);
|
||||
dE = fmod(E - E_old, 2.0 * GNSS_PI);
|
||||
if (fabs(dE) < 1e-12)
|
||||
{
|
||||
// Necessary precision is reached, exit from the loop
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Compute relativistic correction term
|
||||
d_dtr = GPS_F * d_e_eccentricity * d_sqrt_A * sin(E);
|
||||
return d_dtr;
|
||||
}
|
||||
|
||||
|
||||
double Gps_CNAV_Ephemeris::satellitePosition(double transmitTime)
|
||||
{
|
||||
const double A_REF = 26559710.0; // See IS-GPS-200L, pp. 161
|
||||
const double OMEGA_DOT_REF = -2.6e-9; // semicircles / s, see IS-GPS-200L pp. 160
|
||||
|
||||
const double d_sqrt_A = sqrt(A_REF + d_DELTA_A);
|
||||
|
||||
// Find satellite's position -----------------------------------------------
|
||||
|
||||
// Restore semi-major axis
|
||||
const double a = d_sqrt_A * d_sqrt_A;
|
||||
|
||||
// Time from ephemeris reference epoch
|
||||
double tk = check_t(transmitTime - d_Toe1);
|
||||
|
||||
// Computed mean motion
|
||||
const double n0 = sqrt(GPS_GM / (a * a * a));
|
||||
|
||||
// Mean motion difference from computed value
|
||||
const double delta_n_a = d_Delta_n + 0.5 * d_DELTA_DOT_N * tk;
|
||||
|
||||
// Corrected mean motion
|
||||
const double n = n0 + delta_n_a;
|
||||
|
||||
// Mean anomaly
|
||||
const double M = d_M_0 + n * tk;
|
||||
|
||||
// Reduce mean anomaly to between 0 and 2pi
|
||||
// M = fmod((M + 2 * GNSS_PI), (2 * GNSS_PI));
|
||||
|
||||
// Initial guess of eccentric anomaly
|
||||
double E = M;
|
||||
double E_old;
|
||||
double dE;
|
||||
// --- Iteratively compute eccentric anomaly -------------------------------
|
||||
for (int32_t ii = 1; ii < 20; ii++)
|
||||
{
|
||||
E_old = E;
|
||||
E = M + d_e_eccentricity * sin(E);
|
||||
dE = fmod(E - E_old, 2 * GNSS_PI);
|
||||
if (fabs(dE) < 1e-12)
|
||||
{
|
||||
// Necessary precision is reached, exit from the loop
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
const double sek = sin(E);
|
||||
const double cek = cos(E);
|
||||
const double OneMinusecosE = 1.0 - d_e_eccentricity * cek;
|
||||
const double ekdot = n / OneMinusecosE;
|
||||
|
||||
// Compute the true anomaly
|
||||
const double sq1e2 = sqrt(1.0 - d_e_eccentricity * d_e_eccentricity);
|
||||
const double tmp_Y = sq1e2 * sek;
|
||||
const double tmp_X = cek - d_e_eccentricity;
|
||||
const double nu = atan2(tmp_Y, tmp_X);
|
||||
|
||||
// Compute angle phi (argument of Latitude)
|
||||
const double phi = nu + d_OMEGA;
|
||||
double pkdot = sq1e2 * ekdot / OneMinusecosE;
|
||||
|
||||
// Reduce phi to between 0 and 2*pi rad
|
||||
// phi = fmod((phi), (2.0 * GNSS_PI));
|
||||
const double s2pk = sin(2.0 * phi);
|
||||
const double c2pk = cos(2.0 * phi);
|
||||
|
||||
// Correct argument of latitude
|
||||
const double u = phi + d_Cuc * c2pk + d_Cus * s2pk;
|
||||
const double cuk = cos(u);
|
||||
const double suk = sin(u);
|
||||
const double ukdot = pkdot * (1.0 + 2.0 * (d_Cus * c2pk - d_Cuc * s2pk));
|
||||
|
||||
// Correct radius
|
||||
const double r = a * (1.0 - d_e_eccentricity * cek) + d_Crc * c2pk + d_Crs * s2pk;
|
||||
|
||||
const double rkdot = a * d_e_eccentricity * sek * ekdot + 2.0 * pkdot * (d_Crs * c2pk - d_Crc * s2pk);
|
||||
|
||||
// Correct inclination
|
||||
const double i = d_i_0 + d_IDOT * tk + d_Cic * c2pk + d_Cis * s2pk;
|
||||
const double sik = sin(i);
|
||||
const double cik = cos(i);
|
||||
const double ikdot = d_IDOT + 2.0 * pkdot * (d_Cis * c2pk - d_Cic * s2pk);
|
||||
|
||||
// Compute the angle between the ascending node and the Greenwich meridian
|
||||
const double d_OMEGA_DOT = OMEGA_DOT_REF * GNSS_PI + d_DELTA_OMEGA_DOT;
|
||||
const double Omega = d_OMEGA0 + (d_OMEGA_DOT - GNSS_OMEGA_EARTH_DOT) * tk - GNSS_OMEGA_EARTH_DOT * d_Toe1;
|
||||
const double sok = sin(Omega);
|
||||
const double cok = cos(Omega);
|
||||
|
||||
// Compute satellite coordinates in Earth-fixed coordinates
|
||||
const double xprime = r * cuk;
|
||||
const double yprime = r * suk;
|
||||
d_satpos_X = xprime * cok - yprime * cik * sok;
|
||||
d_satpos_Y = xprime * sok + yprime * cik * cok;
|
||||
d_satpos_Z = yprime * sik;
|
||||
|
||||
// Satellite's velocity. Can be useful for Vector Tracking loops
|
||||
const double Omega_dot = d_OMEGA_DOT - GNSS_OMEGA_EARTH_DOT;
|
||||
|
||||
const double xpkdot = rkdot * cuk - yprime * ukdot;
|
||||
const double ypkdot = rkdot * suk + xprime * ukdot;
|
||||
const double tmp = ypkdot * cik - d_satpos_Z * ikdot;
|
||||
|
||||
d_satvel_X = -Omega_dot * d_satpos_Y + xpkdot * cok - tmp * sok;
|
||||
d_satvel_Y = Omega_dot * d_satpos_X + xpkdot * sok + tmp * cok;
|
||||
d_satvel_Z = yprime * cik * ikdot + ypkdot * sik;
|
||||
|
||||
// Time from ephemeris reference clock
|
||||
tk = check_t(transmitTime - d_Toc);
|
||||
|
||||
double dtr_s = d_A_f0 + d_A_f1 * tk + d_A_f2 * tk * tk;
|
||||
|
||||
/* relativity correction */
|
||||
dtr_s -= 2.0 * sqrt(GPS_GM * a) * d_e_eccentricity * sek / (SPEED_OF_LIGHT_M_S * SPEED_OF_LIGHT_M_S);
|
||||
|
||||
return dtr_s;
|
||||
}
|
@ -18,6 +18,7 @@
|
||||
#ifndef GNSS_SDR_GPS_CNAV_EPHEMERIS_H
|
||||
#define GNSS_SDR_GPS_CNAV_EPHEMERIS_H
|
||||
|
||||
#include "gnss_ephemeris.h"
|
||||
#include <boost/serialization/nvp.hpp>
|
||||
#include <cstdint>
|
||||
|
||||
@ -28,115 +29,66 @@
|
||||
|
||||
|
||||
/*!
|
||||
* \brief This class is a storage and orbital model functions for the GPS SV ephemeris data as described in IS-GPS-200L
|
||||
* \brief This is a storage class for the GPS CNAV ephemeris data as described
|
||||
* in IS-GPS-200L
|
||||
*
|
||||
* See https://www.gps.gov/technical/icwg/IS-GPS-200L.pdf Appendix III
|
||||
*/
|
||||
class Gps_CNAV_Ephemeris
|
||||
class Gps_CNAV_Ephemeris : public Gnss_Ephemeris
|
||||
{
|
||||
public:
|
||||
/*!
|
||||
* Default constructor
|
||||
* Constructor
|
||||
*/
|
||||
Gps_CNAV_Ephemeris() = default;
|
||||
Gps_CNAV_Ephemeris()
|
||||
{
|
||||
this->System = 'G';
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Compute the ECEF SV coordinates and ECEF velocity
|
||||
* Implementation of Table 20-IV (IS-GPS-200L)
|
||||
*/
|
||||
double satellitePosition(double transmitTime);
|
||||
double deltaA{}; //!< Semi-major axis difference at reference time
|
||||
double Adot{}; //!< Change rate in semi-major axis
|
||||
double delta_ndot{}; //!< Rate of mean motion difference from computed value
|
||||
double delta_OMEGAdot{}; //!< Rate of Right Ascension difference [semi-circles/s]
|
||||
int32_t toe1{}; //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200L) [s]
|
||||
int32_t toe2{}; //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200L) [s]
|
||||
int32_t signal_health{}; //!< Signal health (L1/L2/L5)
|
||||
int32_t top{}; //!< Data predict time of week
|
||||
int32_t URA{}; //!< ED Accuracy Index
|
||||
|
||||
/*!
|
||||
* \brief Sets (\a d_satClkDrift)and returns the clock drift in seconds according to the User Algorithm for SV Clock Correction
|
||||
* (IS-GPS-200L, 20.3.3.3.3.1)
|
||||
*/
|
||||
double sv_clock_drift(double transmitTime);
|
||||
|
||||
/*!
|
||||
* \brief Sets (\a d_dtr) and returns the clock relativistic correction term in seconds according to the User Algorithm for SV Clock Correction
|
||||
* (IS-GPS-200L, 20.3.3.3.3.1)
|
||||
*/
|
||||
double sv_clock_relativistic_term(double transmitTime);
|
||||
|
||||
uint32_t i_satellite_PRN{}; // SV PRN NUMBER
|
||||
|
||||
// Message Types 10 and 11 Parameters (1 of 2)
|
||||
int32_t i_GPS_week{}; //!< GPS week number, aka WN [week]
|
||||
int32_t i_URA{}; //!< ED Accuracy Index
|
||||
int32_t i_signal_health{}; //!< Signal health (L1/L2/L5)
|
||||
int32_t d_Top{}; //!< Data predict time of week
|
||||
double d_DELTA_A{}; //!< Semi-major axis difference at reference time
|
||||
double d_A_DOT{}; //!< Change rate in semi-major axis
|
||||
double d_Delta_n{}; //!< Mean Motion Difference From Computed Value [semi-circles/s]
|
||||
double d_DELTA_DOT_N{}; //!< Rate of mean motion difference from computed value
|
||||
double d_M_0{}; //!< Mean Anomaly at Reference Time [semi-circles]
|
||||
double d_e_eccentricity{}; //!< Eccentricity
|
||||
double d_OMEGA{}; //!< Argument of Perigee [semi-cicles]
|
||||
double d_OMEGA0{}; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-cicles]
|
||||
int32_t d_Toe1{}; //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200L) [s]
|
||||
int32_t d_Toe2{}; //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200L) [s]
|
||||
double d_DELTA_OMEGA_DOT{}; //!< Rate of Right Ascension difference [semi-circles/s]
|
||||
double d_i_0{}; //!< Inclination Angle at Reference Time [semi-circles]
|
||||
double d_IDOT{}; //!< Rate of Inclination Angle [semi-circles/s]
|
||||
double d_Cis{}; //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad]
|
||||
double d_Cic{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad]
|
||||
double d_Crs{}; //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m]
|
||||
double d_Crc{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius [m]
|
||||
double d_Cus{}; //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad]
|
||||
double d_Cuc{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad]
|
||||
|
||||
// Clock Correction and Accuracy Parameters
|
||||
int32_t d_Toc{}; //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200L) [s]
|
||||
double d_A_f0{}; //!< Coefficient 0 of code phase offset model [s]
|
||||
double d_A_f1{}; //!< Coefficient 1 of code phase offset model [s/s]
|
||||
double d_A_f2{}; //!< Coefficient 2 of code phase offset model [s/s^2]
|
||||
|
||||
double d_URA0{}; //!< NED Accuracy Index
|
||||
double d_URA1{}; //!< NED Accuracy Change Index
|
||||
double d_URA2{}; //!< NED Accuracy Change Rate Index
|
||||
double URA0{}; //!< NED Accuracy Index
|
||||
double URA1{}; //!< NED Accuracy Change Index
|
||||
double URA2{}; //!< NED Accuracy Change Rate Index
|
||||
|
||||
// Group Delay Differential Parameters
|
||||
double d_TGD{}; //!< Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s]
|
||||
double d_ISCL1{};
|
||||
double d_ISCL2{};
|
||||
double d_ISCL5I{};
|
||||
double d_ISCL5Q{};
|
||||
|
||||
int32_t d_TOW{}; //!< Time of GPS Week of the ephemeris set (taken from subframes TOW) [s]
|
||||
|
||||
// clock terms derived from ephemeris data
|
||||
double d_satClkDrift{}; //!< GPS clock error
|
||||
double d_dtr{}; //!< relativistic clock correction term
|
||||
|
||||
// satellite positions
|
||||
double d_satpos_X{}; //!< Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis.
|
||||
double d_satpos_Y{}; //!< Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system.
|
||||
double d_satpos_Z{}; //!< Earth-fixed coordinate z of the satellite [m]. The direction of the IERS (International Earth Rotation and Reference Systems Service) Reference Pole (IRP).
|
||||
|
||||
// Satellite velocity
|
||||
double d_satvel_X{}; //!< Earth-fixed velocity coordinate x of the satellite [m]
|
||||
double d_satvel_Y{}; //!< Earth-fixed velocity coordinate y of the satellite [m]
|
||||
double d_satvel_Z{}; //!< Earth-fixed velocity coordinate z of the satellite [m]
|
||||
double TGD{}; //!< Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s]
|
||||
double ISCL1{};
|
||||
double ISCL2{};
|
||||
double ISCL5I{};
|
||||
double ISCL5Q{};
|
||||
|
||||
/*! \brief If true, enhanced level of integrity assurance.
|
||||
*
|
||||
* If false, indicates that the conveying signal is provided with the legacy level of integrity assurance.
|
||||
* That is, the probability that the instantaneous URE of the conveying signal exceeds 4.42 times the upper bound
|
||||
* value of the current broadcast URA index, for more than 5.2 seconds, without an accompanying alert, is less
|
||||
* than 1E-5 per hour. If true, indicates that the conveying signal is provided with an enhanced level of
|
||||
* integrity assurance. That is, the probability that the instantaneous URE of the conveying signal exceeds 5.73
|
||||
* times the upper bound value of the current broadcast URA index, for more than 5.2 seconds, without an
|
||||
* accompanying alert, is less than 1E-8 per hour.
|
||||
* If false, indicates that the conveying signal is provided with the
|
||||
* legacy level of integrity assurance. That is, the probability that the
|
||||
* instantaneous URE of the conveying signal exceeds 4.42 times the upper
|
||||
* bound value of the current broadcast URA index, for more than 5.2
|
||||
* seconds, without an accompanying alert, is less than 1E-5 per hour. If
|
||||
* true, indicates that the conveying signal is provided with an enhanced
|
||||
* level of integrity assurance. That is, the probability that the
|
||||
* instantaneous URE of the conveying signal exceeds 5.73 times the upper
|
||||
* bound value of the current broadcast URA index, for more than 5.2
|
||||
* seconds, without an accompanying alert, is less than 1E-8 per hour.
|
||||
*/
|
||||
bool b_integrity_status_flag{};
|
||||
bool b_l2c_phasing_flag{};
|
||||
bool b_alert_flag{}; //!< If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk.
|
||||
bool b_antispoofing_flag{}; //!< If true, the AntiSpoofing mode is ON in that SV
|
||||
bool b_alert_flag{}; //!< If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk.
|
||||
bool b_antispoofing_flag{}; //!< If true, the AntiSpoofing mode is ON in that SV
|
||||
|
||||
template <class Archive>
|
||||
|
||||
/*!
|
||||
* \brief Serialize is a boost standard method to be called by the boost XML serialization. Here is used to save the ephemeris data on disk file.
|
||||
* \brief Serialize is a boost standard method to be called by the boost XML
|
||||
* serialization. Here is used to save the ephemeris data on disk file.
|
||||
*/
|
||||
inline void serialize(Archive& archive, const uint32_t version)
|
||||
{
|
||||
@ -145,44 +97,46 @@ public:
|
||||
{
|
||||
};
|
||||
|
||||
archive& make_nvp("i_satellite_PRN", i_satellite_PRN); // SV PRN NUMBER
|
||||
archive& make_nvp("d_TOW", d_TOW); //!< Time of GPS Week of the ephemeris set (taken from subframes TOW) [s]
|
||||
archive& make_nvp("d_Crs", d_Crs); //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m]
|
||||
archive& make_nvp("d_M_0", d_M_0); //!< Mean Anomaly at Reference Time [semi-circles]
|
||||
archive& make_nvp("d_Cuc", d_Cuc); //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad]
|
||||
archive& make_nvp("d_e_eccentricity", d_e_eccentricity); //!< Eccentricity [dimensionless]
|
||||
archive& make_nvp("d_Cus", d_Cus); //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad]
|
||||
archive& make_nvp("d_Toe1", d_Toe1); //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200L) [s]
|
||||
archive& make_nvp("d_Toe2", d_Toe2); //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200L) [s]
|
||||
archive& make_nvp("d_Toc", d_Toc); //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200L) [s]
|
||||
archive& make_nvp("d_Cic", d_Cic); //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad]
|
||||
archive& make_nvp("d_OMEGA0", d_OMEGA0); //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles]
|
||||
archive& make_nvp("d_Cis", d_Cis); //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad]
|
||||
archive& make_nvp("d_i_0", d_i_0); //!< Inclination Angle at Reference Time [semi-circles]
|
||||
archive& make_nvp("d_Crc", d_Crc); //!< Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius [m]
|
||||
archive& make_nvp("d_OMEGA", d_OMEGA); //!< Argument of Perigee [semi-cicles]
|
||||
archive& make_nvp("d_IDOT", d_IDOT); //!< Rate of Inclination Angle [semi-circles/s]
|
||||
archive& make_nvp("i_GPS_week", i_GPS_week); //!< GPS week number, aka WN [week]
|
||||
archive& make_nvp("d_TGD", d_TGD); //!< Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s]
|
||||
archive& make_nvp("d_ISCL1", d_ISCL1); //!< Estimated Group Delay Differential: L1P(Y)-L1C/A correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s]
|
||||
archive& make_nvp("d_ISCL2", d_ISCL2); //!< Estimated Group Delay Differential: L1P(Y)-L2C correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s]
|
||||
archive& make_nvp("d_ISCL5I", d_ISCL5I); //!< Estimated Group Delay Differential: L1P(Y)-L5i correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s]
|
||||
archive& make_nvp("d_ISCL5Q", d_ISCL5Q); //!< Estimated Group Delay Differential: L1P(Y)-L5q correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s]
|
||||
archive& BOOST_SERIALIZATION_NVP(PRN);
|
||||
archive& BOOST_SERIALIZATION_NVP(M_0);
|
||||
archive& BOOST_SERIALIZATION_NVP(delta_n);
|
||||
archive& BOOST_SERIALIZATION_NVP(ecc);
|
||||
archive& BOOST_SERIALIZATION_NVP(sqrtA);
|
||||
archive& BOOST_SERIALIZATION_NVP(OMEGA_0);
|
||||
archive& BOOST_SERIALIZATION_NVP(i_0);
|
||||
archive& BOOST_SERIALIZATION_NVP(omega);
|
||||
archive& BOOST_SERIALIZATION_NVP(OMEGAdot);
|
||||
archive& BOOST_SERIALIZATION_NVP(idot);
|
||||
archive& BOOST_SERIALIZATION_NVP(Cuc);
|
||||
archive& BOOST_SERIALIZATION_NVP(Cus);
|
||||
archive& BOOST_SERIALIZATION_NVP(Crc);
|
||||
archive& BOOST_SERIALIZATION_NVP(Crs);
|
||||
archive& BOOST_SERIALIZATION_NVP(Cic);
|
||||
archive& BOOST_SERIALIZATION_NVP(Cis);
|
||||
archive& BOOST_SERIALIZATION_NVP(toe);
|
||||
archive& BOOST_SERIALIZATION_NVP(toc);
|
||||
archive& BOOST_SERIALIZATION_NVP(af0);
|
||||
archive& BOOST_SERIALIZATION_NVP(af1);
|
||||
archive& BOOST_SERIALIZATION_NVP(af2);
|
||||
archive& BOOST_SERIALIZATION_NVP(WN);
|
||||
archive& BOOST_SERIALIZATION_NVP(tow);
|
||||
archive& BOOST_SERIALIZATION_NVP(satClkDrift);
|
||||
archive& BOOST_SERIALIZATION_NVP(dtr);
|
||||
|
||||
archive& make_nvp("d_DELTA_A", d_DELTA_A); //!< Semi-major axis difference at reference time [m]
|
||||
archive& make_nvp("d_A_DOT", d_A_DOT); //!< Change rate in semi-major axis [m/s]
|
||||
archive& make_nvp("d_DELTA_OMEGA_DOT", d_DELTA_OMEGA_DOT); //!< Rate of Right Ascension difference [semi-circles/s]
|
||||
archive& make_nvp("d_A_f0", d_A_f0); //!< Coefficient 0 of code phase offset model [s]
|
||||
archive& make_nvp("d_A_f1", d_A_f1); //!< Coefficient 1 of code phase offset model [s/s]
|
||||
archive& make_nvp("d_A_f2", d_A_f2); //!< Coefficient 2 of code phase offset model [s/s^2]
|
||||
|
||||
archive& make_nvp("b_integrity_status_flag", b_integrity_status_flag);
|
||||
archive& make_nvp("b_alert_flag", b_alert_flag); //!< If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk.
|
||||
archive& make_nvp("b_antispoofing_flag", b_antispoofing_flag); //!< If true, the AntiSpoofing mode is ON in that SV
|
||||
archive& BOOST_SERIALIZATION_NVP(toe1);
|
||||
archive& BOOST_SERIALIZATION_NVP(toe2);
|
||||
archive& BOOST_SERIALIZATION_NVP(TGD);
|
||||
archive& BOOST_SERIALIZATION_NVP(ISCL1);
|
||||
archive& BOOST_SERIALIZATION_NVP(ISCL2);
|
||||
archive& BOOST_SERIALIZATION_NVP(ISCL5I);
|
||||
archive& BOOST_SERIALIZATION_NVP(ISCL5Q);
|
||||
archive& BOOST_SERIALIZATION_NVP(deltaA);
|
||||
archive& BOOST_SERIALIZATION_NVP(Adot);
|
||||
archive& BOOST_SERIALIZATION_NVP(delta_OMEGAdot);
|
||||
archive& BOOST_SERIALIZATION_NVP(b_integrity_status_flag);
|
||||
archive& BOOST_SERIALIZATION_NVP(b_alert_flag);
|
||||
archive& BOOST_SERIALIZATION_NVP(b_antispoofing_flag);
|
||||
}
|
||||
|
||||
private:
|
||||
double check_t(double time);
|
||||
};
|
||||
|
||||
|
||||
|
@ -38,35 +38,35 @@ public:
|
||||
Gps_CNAV_Iono() = default; //!< Default constructor
|
||||
|
||||
// Ionospheric parameters
|
||||
double d_alpha0{}; //!< Coefficient 0 of a cubic equation representing the amplitude of the vertical delay [s]
|
||||
double d_alpha1{}; //!< Coefficient 1 of a cubic equation representing the amplitude of the vertical delay [s/semi-circle]
|
||||
double d_alpha2{}; //!< Coefficient 2 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^2]
|
||||
double d_alpha3{}; //!< Coefficient 3 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^3]
|
||||
double d_beta0{}; //!< Coefficient 0 of a cubic equation representing the period of the model [s]
|
||||
double d_beta1{}; //!< Coefficient 1 of a cubic equation representing the period of the model [s/semi-circle]
|
||||
double d_beta2{}; //!< Coefficient 2 of a cubic equation representing the period of the model [s(semi-circle)^2]
|
||||
double d_beta3{}; //!< Coefficient 3 of a cubic equation representing the period of the model [s(semi-circle)^3]
|
||||
bool valid{}; //!< Valid flag
|
||||
double alpha0{}; //!< Coefficient 0 of a cubic equation representing the amplitude of the vertical delay [s]
|
||||
double alpha1{}; //!< Coefficient 1 of a cubic equation representing the amplitude of the vertical delay [s/semi-circle]
|
||||
double alpha2{}; //!< Coefficient 2 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^2]
|
||||
double alpha3{}; //!< Coefficient 3 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^3]
|
||||
double beta0{}; //!< Coefficient 0 of a cubic equation representing the period of the model [s]
|
||||
double beta1{}; //!< Coefficient 1 of a cubic equation representing the period of the model [s/semi-circle]
|
||||
double beta2{}; //!< Coefficient 2 of a cubic equation representing the period of the model [s(semi-circle)^2]
|
||||
double beta3{}; //!< Coefficient 3 of a cubic equation representing the period of the model [s(semi-circle)^3]
|
||||
bool valid{}; //!< Valid flag
|
||||
|
||||
template <class Archive>
|
||||
|
||||
/*!
|
||||
* \brief Serialize is a boost standard method to be called by the boost XML serialization. Here is used to save the ephemeris data on disk file.
|
||||
* \brief Serialize is a boost standard method to be called by the boost XML
|
||||
* serialization. Here is used to save the ephemeris data on disk file.
|
||||
*/
|
||||
inline void serialize(Archive& archive, const unsigned int version) const
|
||||
{
|
||||
using boost::serialization::make_nvp;
|
||||
if (version)
|
||||
{
|
||||
};
|
||||
archive& make_nvp("d_alpha0", d_alpha0);
|
||||
archive& make_nvp("d_alpha1", d_alpha1);
|
||||
archive& make_nvp("d_alpha2", d_alpha2);
|
||||
archive& make_nvp("d_alpha3", d_alpha3);
|
||||
archive& make_nvp("d_beta0", d_beta0);
|
||||
archive& make_nvp("d_beta1", d_beta1);
|
||||
archive& make_nvp("d_beta2", d_beta2);
|
||||
archive& make_nvp("d_beta3", d_beta3);
|
||||
archive& BOOST_SERIALIZATION_NVP(alpha0);
|
||||
archive& BOOST_SERIALIZATION_NVP(alpha1);
|
||||
archive& BOOST_SERIALIZATION_NVP(alpha2);
|
||||
archive& BOOST_SERIALIZATION_NVP(alpha3);
|
||||
archive& BOOST_SERIALIZATION_NVP(beta0);
|
||||
archive& BOOST_SERIALIZATION_NVP(beta1);
|
||||
archive& BOOST_SERIALIZATION_NVP(beta2);
|
||||
archive& BOOST_SERIALIZATION_NVP(beta3);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -106,41 +106,43 @@ void Gps_CNAV_Navigation_Message::decode_page(std::bitset<GPS_CNAV_DATA_PAGE_BIT
|
||||
|
||||
// common to all messages
|
||||
const auto PRN = static_cast<int32_t>(read_navigation_unsigned(data_bits, CNAV_PRN));
|
||||
ephemeris_record.i_satellite_PRN = PRN;
|
||||
ephemeris_record.PRN = PRN;
|
||||
|
||||
d_TOW = static_cast<int32_t>(read_navigation_unsigned(data_bits, CNAV_TOW));
|
||||
d_TOW *= CNAV_TOW_LSB;
|
||||
ephemeris_record.d_TOW = d_TOW;
|
||||
ephemeris_record.tow = d_TOW;
|
||||
|
||||
alert_flag = static_cast<bool>(read_navigation_bool(data_bits, CNAV_ALERT_FLAG));
|
||||
ephemeris_record.b_alert_flag = alert_flag;
|
||||
|
||||
page_type = static_cast<int32_t>(read_navigation_unsigned(data_bits, CNAV_MSG_TYPE));
|
||||
|
||||
|
||||
switch (page_type)
|
||||
{
|
||||
case 10: // Ephemeris 1/2
|
||||
ephemeris_record.i_GPS_week = static_cast<int32_t>(read_navigation_unsigned(data_bits, CNAV_WN));
|
||||
ephemeris_record.i_signal_health = static_cast<int32_t>(read_navigation_unsigned(data_bits, CNAV_HEALTH));
|
||||
ephemeris_record.d_Top = static_cast<int32_t>(read_navigation_unsigned(data_bits, CNAV_TOP1));
|
||||
ephemeris_record.d_Top *= CNAV_TOP1_LSB;
|
||||
ephemeris_record.d_URA0 = static_cast<double>(read_navigation_signed(data_bits, CNAV_URA));
|
||||
ephemeris_record.d_Toe1 = static_cast<int32_t>(read_navigation_unsigned(data_bits, CNAV_TOE1));
|
||||
ephemeris_record.d_Toe1 *= CNAV_TOE1_LSB;
|
||||
ephemeris_record.d_DELTA_A = static_cast<double>(read_navigation_signed(data_bits, CNAV_DELTA_A));
|
||||
ephemeris_record.d_DELTA_A *= CNAV_DELTA_A_LSB;
|
||||
ephemeris_record.d_A_DOT = static_cast<double>(read_navigation_signed(data_bits, CNAV_A_DOT));
|
||||
ephemeris_record.d_A_DOT *= CNAV_A_DOT_LSB;
|
||||
ephemeris_record.d_Delta_n = static_cast<double>(read_navigation_signed(data_bits, CNAV_DELTA_N0));
|
||||
ephemeris_record.d_Delta_n *= CNAV_DELTA_N0_LSB;
|
||||
ephemeris_record.d_DELTA_DOT_N = static_cast<double>(read_navigation_signed(data_bits, CNAV_DELTA_N0_DOT));
|
||||
ephemeris_record.d_DELTA_DOT_N *= CNAV_DELTA_N0_DOT_LSB;
|
||||
ephemeris_record.d_M_0 = static_cast<double>(read_navigation_signed(data_bits, CNAV_M0));
|
||||
ephemeris_record.d_M_0 *= CNAV_M0_LSB;
|
||||
ephemeris_record.d_e_eccentricity = static_cast<double>(read_navigation_unsigned(data_bits, CNAV_E_ECCENTRICITY));
|
||||
ephemeris_record.d_e_eccentricity *= CNAV_E_ECCENTRICITY_LSB;
|
||||
ephemeris_record.d_OMEGA = static_cast<double>(read_navigation_signed(data_bits, CNAV_OMEGA));
|
||||
ephemeris_record.d_OMEGA *= CNAV_OMEGA_LSB;
|
||||
ephemeris_record.WN = static_cast<int32_t>(read_navigation_unsigned(data_bits, CNAV_WN));
|
||||
ephemeris_record.signal_health = static_cast<int32_t>(read_navigation_unsigned(data_bits, CNAV_HEALTH));
|
||||
ephemeris_record.top = static_cast<int32_t>(read_navigation_unsigned(data_bits, CNAV_TOP1));
|
||||
ephemeris_record.top *= CNAV_TOP1_LSB;
|
||||
ephemeris_record.URA0 = static_cast<double>(read_navigation_signed(data_bits, CNAV_URA));
|
||||
ephemeris_record.toe1 = static_cast<int32_t>(read_navigation_unsigned(data_bits, CNAV_TOE1));
|
||||
ephemeris_record.toe1 *= CNAV_TOE1_LSB;
|
||||
ephemeris_record.deltaA = static_cast<double>(read_navigation_signed(data_bits, CNAV_DELTA_A));
|
||||
ephemeris_record.deltaA *= CNAV_DELTA_A_LSB;
|
||||
ephemeris_record.Adot = static_cast<double>(read_navigation_signed(data_bits, CNAV_A_DOT));
|
||||
ephemeris_record.Adot *= CNAV_A_DOT_LSB;
|
||||
ephemeris_record.sqrtA = sqrt(CNAV_A_REF + ephemeris_record.deltaA);
|
||||
ephemeris_record.delta_n = static_cast<double>(read_navigation_signed(data_bits, CNAV_DELTA_N0));
|
||||
ephemeris_record.delta_n *= CNAV_DELTA_N0_LSB;
|
||||
ephemeris_record.delta_ndot = static_cast<double>(read_navigation_signed(data_bits, CNAV_DELTA_N0_DOT));
|
||||
ephemeris_record.delta_ndot *= CNAV_DELTA_N0_DOT_LSB;
|
||||
ephemeris_record.M_0 = static_cast<double>(read_navigation_signed(data_bits, CNAV_M0));
|
||||
ephemeris_record.M_0 *= CNAV_M0_LSB;
|
||||
ephemeris_record.ecc = static_cast<double>(read_navigation_unsigned(data_bits, CNAV_E_ECCENTRICITY));
|
||||
ephemeris_record.ecc *= CNAV_E_ECCENTRICITY_LSB;
|
||||
ephemeris_record.omega = static_cast<double>(read_navigation_signed(data_bits, CNAV_OMEGA));
|
||||
ephemeris_record.omega *= CNAV_OMEGA_LSB;
|
||||
|
||||
ephemeris_record.b_integrity_status_flag = static_cast<bool>(read_navigation_bool(data_bits, CNAV_INTEGRITY_FLAG));
|
||||
ephemeris_record.b_l2c_phasing_flag = static_cast<bool>(read_navigation_bool(data_bits, CNAV_L2_PHASING_FLAG));
|
||||
@ -148,135 +150,136 @@ void Gps_CNAV_Navigation_Message::decode_page(std::bitset<GPS_CNAV_DATA_PAGE_BIT
|
||||
b_flag_ephemeris_1 = true;
|
||||
break;
|
||||
case 11: // Ephemeris 2/2
|
||||
ephemeris_record.d_Toe2 = static_cast<int32_t>(read_navigation_unsigned(data_bits, CNAV_TOE2));
|
||||
ephemeris_record.d_Toe2 *= CNAV_TOE2_LSB;
|
||||
ephemeris_record.d_OMEGA0 = static_cast<double>(read_navigation_signed(data_bits, CNAV_OMEGA0));
|
||||
ephemeris_record.d_OMEGA0 *= CNAV_OMEGA0_LSB;
|
||||
ephemeris_record.d_DELTA_OMEGA_DOT = static_cast<double>(read_navigation_signed(data_bits, CNAV_DELTA_OMEGA_DOT));
|
||||
ephemeris_record.d_DELTA_OMEGA_DOT *= CNAV_DELTA_OMEGA_DOT_LSB;
|
||||
ephemeris_record.d_i_0 = static_cast<double>(read_navigation_signed(data_bits, CNAV_I0));
|
||||
ephemeris_record.d_i_0 *= CNAV_I0_LSB;
|
||||
ephemeris_record.d_IDOT = static_cast<double>(read_navigation_signed(data_bits, CNAV_I0_DOT));
|
||||
ephemeris_record.d_IDOT *= CNAV_I0_DOT_LSB;
|
||||
ephemeris_record.d_Cis = static_cast<double>(read_navigation_signed(data_bits, CNAV_CIS));
|
||||
ephemeris_record.d_Cis *= CNAV_CIS_LSB;
|
||||
ephemeris_record.d_Cic = static_cast<double>(read_navigation_signed(data_bits, CNAV_CIC));
|
||||
ephemeris_record.d_Cic *= CNAV_CIC_LSB;
|
||||
ephemeris_record.d_Crs = static_cast<double>(read_navigation_signed(data_bits, CNAV_CRS));
|
||||
ephemeris_record.d_Crs *= CNAV_CRS_LSB;
|
||||
ephemeris_record.d_Crc = static_cast<double>(read_navigation_signed(data_bits, CNAV_CRC));
|
||||
ephemeris_record.d_Crc *= CNAV_CRC_LSB;
|
||||
ephemeris_record.d_Cus = static_cast<double>(read_navigation_signed(data_bits, CNAV_CUS));
|
||||
ephemeris_record.d_Cus *= CNAV_CUS_LSB;
|
||||
ephemeris_record.d_Cuc = static_cast<double>(read_navigation_signed(data_bits, CNAV_CUC));
|
||||
ephemeris_record.d_Cuc *= CNAV_CUC_LSB;
|
||||
ephemeris_record.toe2 = static_cast<int32_t>(read_navigation_unsigned(data_bits, CNAV_TOE2));
|
||||
ephemeris_record.toe2 *= CNAV_TOE2_LSB;
|
||||
ephemeris_record.OMEGA_0 = static_cast<double>(read_navigation_signed(data_bits, CNAV_OMEGA0));
|
||||
ephemeris_record.OMEGA_0 *= CNAV_OMEGA0_LSB;
|
||||
ephemeris_record.delta_OMEGAdot = static_cast<double>(read_navigation_signed(data_bits, CNAV_DELTA_OMEGA_DOT));
|
||||
ephemeris_record.delta_OMEGAdot *= CNAV_DELTA_OMEGA_DOT_LSB;
|
||||
ephemeris_record.OMEGAdot = CNAV_OMEGA_DOT_REF * GNSS_PI + ephemeris_record.delta_OMEGAdot;
|
||||
ephemeris_record.i_0 = static_cast<double>(read_navigation_signed(data_bits, CNAV_I0));
|
||||
ephemeris_record.i_0 *= CNAV_I0_LSB;
|
||||
ephemeris_record.idot = static_cast<double>(read_navigation_signed(data_bits, CNAV_I0_DOT));
|
||||
ephemeris_record.idot *= CNAV_I0_DOT_LSB;
|
||||
ephemeris_record.Cis = static_cast<double>(read_navigation_signed(data_bits, CNAV_CIS));
|
||||
ephemeris_record.Cis *= CNAV_CIS_LSB;
|
||||
ephemeris_record.Cic = static_cast<double>(read_navigation_signed(data_bits, CNAV_CIC));
|
||||
ephemeris_record.Cic *= CNAV_CIC_LSB;
|
||||
ephemeris_record.Crs = static_cast<double>(read_navigation_signed(data_bits, CNAV_CRS));
|
||||
ephemeris_record.Crs *= CNAV_CRS_LSB;
|
||||
ephemeris_record.Crc = static_cast<double>(read_navigation_signed(data_bits, CNAV_CRC));
|
||||
ephemeris_record.Crc *= CNAV_CRC_LSB;
|
||||
ephemeris_record.Cus = static_cast<double>(read_navigation_signed(data_bits, CNAV_CUS));
|
||||
ephemeris_record.Cus *= CNAV_CUS_LSB;
|
||||
ephemeris_record.Cuc = static_cast<double>(read_navigation_signed(data_bits, CNAV_CUC));
|
||||
ephemeris_record.Cuc *= CNAV_CUC_LSB;
|
||||
b_flag_ephemeris_2 = true;
|
||||
break;
|
||||
case 30: // (CLOCK, IONO, GRUP DELAY)
|
||||
// clock
|
||||
ephemeris_record.d_Toc = static_cast<int32_t>(read_navigation_unsigned(data_bits, CNAV_TOC));
|
||||
ephemeris_record.d_Toc *= CNAV_TOC_LSB;
|
||||
ephemeris_record.d_URA0 = static_cast<double>(read_navigation_signed(data_bits, CNAV_URA_NED0));
|
||||
ephemeris_record.d_URA1 = static_cast<double>(read_navigation_unsigned(data_bits, CNAV_URA_NED1));
|
||||
ephemeris_record.d_URA2 = static_cast<double>(read_navigation_unsigned(data_bits, CNAV_URA_NED2));
|
||||
ephemeris_record.d_A_f0 = static_cast<double>(read_navigation_signed(data_bits, CNAV_AF0));
|
||||
ephemeris_record.d_A_f0 *= CNAV_AF0_LSB;
|
||||
ephemeris_record.d_A_f1 = static_cast<double>(read_navigation_signed(data_bits, CNAV_AF1));
|
||||
ephemeris_record.d_A_f1 *= CNAV_AF1_LSB;
|
||||
ephemeris_record.d_A_f2 = static_cast<double>(read_navigation_signed(data_bits, CNAV_AF2));
|
||||
ephemeris_record.d_A_f2 *= CNAV_AF2_LSB;
|
||||
ephemeris_record.toc = static_cast<int32_t>(read_navigation_unsigned(data_bits, CNAV_TOC));
|
||||
ephemeris_record.toc *= CNAV_TOC_LSB;
|
||||
ephemeris_record.URA0 = static_cast<double>(read_navigation_signed(data_bits, CNAV_URA_NED0));
|
||||
ephemeris_record.URA1 = static_cast<double>(read_navigation_unsigned(data_bits, CNAV_URA_NED1));
|
||||
ephemeris_record.URA2 = static_cast<double>(read_navigation_unsigned(data_bits, CNAV_URA_NED2));
|
||||
ephemeris_record.af0 = static_cast<double>(read_navigation_signed(data_bits, CNAV_AF0));
|
||||
ephemeris_record.af0 *= CNAV_AF0_LSB;
|
||||
ephemeris_record.af1 = static_cast<double>(read_navigation_signed(data_bits, CNAV_AF1));
|
||||
ephemeris_record.af1 *= CNAV_AF1_LSB;
|
||||
ephemeris_record.af2 = static_cast<double>(read_navigation_signed(data_bits, CNAV_AF2));
|
||||
ephemeris_record.af2 *= CNAV_AF2_LSB;
|
||||
// group delays
|
||||
// Check if the grup delay values are not available. See IS-GPS-200, Table 30-IV.
|
||||
// Bit string "1000000000000" is -4096 in 2 complement
|
||||
ephemeris_record.d_TGD = static_cast<double>(read_navigation_signed(data_bits, CNAV_TGD));
|
||||
if (ephemeris_record.d_TGD < -4095.9)
|
||||
ephemeris_record.TGD = static_cast<double>(read_navigation_signed(data_bits, CNAV_TGD));
|
||||
if (ephemeris_record.TGD < -4095.9)
|
||||
{
|
||||
ephemeris_record.d_TGD = 0.0;
|
||||
ephemeris_record.TGD = 0.0;
|
||||
}
|
||||
ephemeris_record.d_TGD *= CNAV_TGD_LSB;
|
||||
ephemeris_record.TGD *= CNAV_TGD_LSB;
|
||||
|
||||
ephemeris_record.d_ISCL1 = static_cast<double>(read_navigation_signed(data_bits, CNAV_ISCL1));
|
||||
if (ephemeris_record.d_ISCL1 < -4095.9)
|
||||
ephemeris_record.ISCL1 = static_cast<double>(read_navigation_signed(data_bits, CNAV_ISCL1));
|
||||
if (ephemeris_record.ISCL1 < -4095.9)
|
||||
{
|
||||
ephemeris_record.d_ISCL1 = 0.0;
|
||||
ephemeris_record.ISCL1 = 0.0;
|
||||
}
|
||||
ephemeris_record.d_ISCL1 *= CNAV_ISCL1_LSB;
|
||||
ephemeris_record.ISCL1 *= CNAV_ISCL1_LSB;
|
||||
|
||||
ephemeris_record.d_ISCL2 = static_cast<double>(read_navigation_signed(data_bits, CNAV_ISCL2));
|
||||
if (ephemeris_record.d_ISCL2 < -4095.9)
|
||||
ephemeris_record.ISCL2 = static_cast<double>(read_navigation_signed(data_bits, CNAV_ISCL2));
|
||||
if (ephemeris_record.ISCL2 < -4095.9)
|
||||
{
|
||||
ephemeris_record.d_ISCL2 = 0.0;
|
||||
ephemeris_record.ISCL2 = 0.0;
|
||||
}
|
||||
ephemeris_record.d_ISCL2 *= CNAV_ISCL2_LSB;
|
||||
ephemeris_record.ISCL2 *= CNAV_ISCL2_LSB;
|
||||
|
||||
ephemeris_record.d_ISCL5I = static_cast<double>(read_navigation_signed(data_bits, CNAV_ISCL5I));
|
||||
if (ephemeris_record.d_ISCL5I < -4095.9)
|
||||
ephemeris_record.ISCL5I = static_cast<double>(read_navigation_signed(data_bits, CNAV_ISCL5I));
|
||||
if (ephemeris_record.ISCL5I < -4095.9)
|
||||
{
|
||||
ephemeris_record.d_ISCL5I = 0.0;
|
||||
ephemeris_record.ISCL5I = 0.0;
|
||||
}
|
||||
ephemeris_record.d_ISCL5I *= CNAV_ISCL5I_LSB;
|
||||
ephemeris_record.ISCL5I *= CNAV_ISCL5I_LSB;
|
||||
|
||||
ephemeris_record.d_ISCL5Q = static_cast<double>(read_navigation_signed(data_bits, CNAV_ISCL5Q));
|
||||
if (ephemeris_record.d_ISCL5Q < -4095.9)
|
||||
ephemeris_record.ISCL5Q = static_cast<double>(read_navigation_signed(data_bits, CNAV_ISCL5Q));
|
||||
if (ephemeris_record.ISCL5Q < -4095.9)
|
||||
{
|
||||
ephemeris_record.d_ISCL5Q = 0.0;
|
||||
ephemeris_record.ISCL5Q = 0.0;
|
||||
}
|
||||
ephemeris_record.d_ISCL5Q *= CNAV_ISCL5Q_LSB;
|
||||
ephemeris_record.ISCL5Q *= CNAV_ISCL5Q_LSB;
|
||||
// iono
|
||||
iono_record.d_alpha0 = static_cast<double>(read_navigation_signed(data_bits, CNAV_ALPHA0));
|
||||
iono_record.d_alpha0 = iono_record.d_alpha0 * CNAV_ALPHA0_LSB;
|
||||
iono_record.d_alpha1 = static_cast<double>(read_navigation_signed(data_bits, CNAV_ALPHA1));
|
||||
iono_record.d_alpha1 = iono_record.d_alpha1 * CNAV_ALPHA1_LSB;
|
||||
iono_record.d_alpha2 = static_cast<double>(read_navigation_signed(data_bits, CNAV_ALPHA2));
|
||||
iono_record.d_alpha2 = iono_record.d_alpha2 * CNAV_ALPHA2_LSB;
|
||||
iono_record.d_alpha3 = static_cast<double>(read_navigation_signed(data_bits, CNAV_ALPHA3));
|
||||
iono_record.d_alpha3 = iono_record.d_alpha3 * CNAV_ALPHA3_LSB;
|
||||
iono_record.d_beta0 = static_cast<double>(read_navigation_signed(data_bits, CNAV_BETA0));
|
||||
iono_record.d_beta0 = iono_record.d_beta0 * CNAV_BETA0_LSB;
|
||||
iono_record.d_beta1 = static_cast<double>(read_navigation_signed(data_bits, CNAV_BETA1));
|
||||
iono_record.d_beta1 = iono_record.d_beta1 * CNAV_BETA1_LSB;
|
||||
iono_record.d_beta2 = static_cast<double>(read_navigation_signed(data_bits, CNAV_BETA2));
|
||||
iono_record.d_beta2 = iono_record.d_beta2 * CNAV_BETA2_LSB;
|
||||
iono_record.d_beta3 = static_cast<double>(read_navigation_signed(data_bits, CNAV_BETA3));
|
||||
iono_record.d_beta3 = iono_record.d_beta3 * CNAV_BETA3_LSB;
|
||||
iono_record.alpha0 = static_cast<double>(read_navigation_signed(data_bits, CNAV_ALPHA0));
|
||||
iono_record.alpha0 = iono_record.alpha0 * CNAV_ALPHA0_LSB;
|
||||
iono_record.alpha1 = static_cast<double>(read_navigation_signed(data_bits, CNAV_ALPHA1));
|
||||
iono_record.alpha1 = iono_record.alpha1 * CNAV_ALPHA1_LSB;
|
||||
iono_record.alpha2 = static_cast<double>(read_navigation_signed(data_bits, CNAV_ALPHA2));
|
||||
iono_record.alpha2 = iono_record.alpha2 * CNAV_ALPHA2_LSB;
|
||||
iono_record.alpha3 = static_cast<double>(read_navigation_signed(data_bits, CNAV_ALPHA3));
|
||||
iono_record.alpha3 = iono_record.alpha3 * CNAV_ALPHA3_LSB;
|
||||
iono_record.beta0 = static_cast<double>(read_navigation_signed(data_bits, CNAV_BETA0));
|
||||
iono_record.beta0 = iono_record.beta0 * CNAV_BETA0_LSB;
|
||||
iono_record.beta1 = static_cast<double>(read_navigation_signed(data_bits, CNAV_BETA1));
|
||||
iono_record.beta1 = iono_record.beta1 * CNAV_BETA1_LSB;
|
||||
iono_record.beta2 = static_cast<double>(read_navigation_signed(data_bits, CNAV_BETA2));
|
||||
iono_record.beta2 = iono_record.beta2 * CNAV_BETA2_LSB;
|
||||
iono_record.beta3 = static_cast<double>(read_navigation_signed(data_bits, CNAV_BETA3));
|
||||
iono_record.beta3 = iono_record.beta3 * CNAV_BETA3_LSB;
|
||||
b_flag_iono_valid = true;
|
||||
break;
|
||||
case 33: // (CLOCK & UTC)
|
||||
ephemeris_record.d_Top = static_cast<int32_t>(read_navigation_unsigned(data_bits, CNAV_TOP1));
|
||||
ephemeris_record.d_Top = ephemeris_record.d_Top * CNAV_TOP1_LSB;
|
||||
ephemeris_record.d_Toc = static_cast<int32_t>(read_navigation_unsigned(data_bits, CNAV_TOC));
|
||||
ephemeris_record.d_Toc = ephemeris_record.d_Toc * CNAV_TOC_LSB;
|
||||
ephemeris_record.d_A_f0 = static_cast<double>(read_navigation_signed(data_bits, CNAV_AF0));
|
||||
ephemeris_record.d_A_f0 = ephemeris_record.d_A_f0 * CNAV_AF0_LSB;
|
||||
ephemeris_record.d_A_f1 = static_cast<double>(read_navigation_signed(data_bits, CNAV_AF1));
|
||||
ephemeris_record.d_A_f1 = ephemeris_record.d_A_f1 * CNAV_AF1_LSB;
|
||||
ephemeris_record.d_A_f2 = static_cast<double>(read_navigation_signed(data_bits, CNAV_AF2));
|
||||
ephemeris_record.d_A_f2 = ephemeris_record.d_A_f2 * CNAV_AF2_LSB;
|
||||
ephemeris_record.top = static_cast<int32_t>(read_navigation_unsigned(data_bits, CNAV_TOP1));
|
||||
ephemeris_record.top = ephemeris_record.top * CNAV_TOP1_LSB;
|
||||
ephemeris_record.toc = static_cast<int32_t>(read_navigation_unsigned(data_bits, CNAV_TOC));
|
||||
ephemeris_record.toc = ephemeris_record.toc * CNAV_TOC_LSB;
|
||||
ephemeris_record.af0 = static_cast<double>(read_navigation_signed(data_bits, CNAV_AF0));
|
||||
ephemeris_record.af0 = ephemeris_record.af0 * CNAV_AF0_LSB;
|
||||
ephemeris_record.af1 = static_cast<double>(read_navigation_signed(data_bits, CNAV_AF1));
|
||||
ephemeris_record.af1 = ephemeris_record.af1 * CNAV_AF1_LSB;
|
||||
ephemeris_record.af2 = static_cast<double>(read_navigation_signed(data_bits, CNAV_AF2));
|
||||
ephemeris_record.af2 = ephemeris_record.af2 * CNAV_AF2_LSB;
|
||||
|
||||
utc_model_record.d_A0 = static_cast<double>(read_navigation_signed(data_bits, CNAV_A0));
|
||||
utc_model_record.d_A0 = utc_model_record.d_A0 * CNAV_A0_LSB;
|
||||
utc_model_record.d_A1 = static_cast<double>(read_navigation_signed(data_bits, CNAV_A1));
|
||||
utc_model_record.d_A1 = utc_model_record.d_A1 * CNAV_A1_LSB;
|
||||
utc_model_record.d_A2 = static_cast<double>(read_navigation_signed(data_bits, CNAV_A2));
|
||||
utc_model_record.d_A2 = utc_model_record.d_A2 * CNAV_A2_LSB;
|
||||
utc_model_record.A0 = static_cast<double>(read_navigation_signed(data_bits, CNAV_A0));
|
||||
utc_model_record.A0 = utc_model_record.A0 * CNAV_A0_LSB;
|
||||
utc_model_record.A1 = static_cast<double>(read_navigation_signed(data_bits, CNAV_A1));
|
||||
utc_model_record.A1 = utc_model_record.A1 * CNAV_A1_LSB;
|
||||
utc_model_record.A2 = static_cast<double>(read_navigation_signed(data_bits, CNAV_A2));
|
||||
utc_model_record.A2 = utc_model_record.A2 * CNAV_A2_LSB;
|
||||
|
||||
utc_model_record.d_DeltaT_LS = static_cast<int32_t>(read_navigation_signed(data_bits, CNAV_DELTA_TLS));
|
||||
utc_model_record.d_DeltaT_LS = utc_model_record.d_DeltaT_LS * CNAV_DELTA_TLS_LSB;
|
||||
utc_model_record.DeltaT_LS = static_cast<int32_t>(read_navigation_signed(data_bits, CNAV_DELTA_TLS));
|
||||
utc_model_record.DeltaT_LS = utc_model_record.DeltaT_LS * CNAV_DELTA_TLS_LSB;
|
||||
|
||||
utc_model_record.d_t_OT = static_cast<int32_t>(read_navigation_signed(data_bits, CNAV_TOT));
|
||||
utc_model_record.d_t_OT = utc_model_record.d_t_OT * CNAV_TOT_LSB;
|
||||
utc_model_record.tot = static_cast<int32_t>(read_navigation_signed(data_bits, CNAV_TOT));
|
||||
utc_model_record.tot = utc_model_record.tot * CNAV_TOT_LSB;
|
||||
|
||||
utc_model_record.i_WN_T = static_cast<int32_t>(read_navigation_signed(data_bits, CNAV_WN_OT));
|
||||
utc_model_record.i_WN_T = utc_model_record.i_WN_T * CNAV_WN_OT_LSB;
|
||||
utc_model_record.WN_T = static_cast<int32_t>(read_navigation_signed(data_bits, CNAV_WN_OT));
|
||||
utc_model_record.WN_T = utc_model_record.WN_T * CNAV_WN_OT_LSB;
|
||||
|
||||
utc_model_record.i_WN_LSF = static_cast<int32_t>(read_navigation_signed(data_bits, CNAV_WN_LSF));
|
||||
utc_model_record.i_WN_LSF = utc_model_record.i_WN_LSF * CNAV_WN_LSF_LSB;
|
||||
utc_model_record.WN_LSF = static_cast<int32_t>(read_navigation_signed(data_bits, CNAV_WN_LSF));
|
||||
utc_model_record.WN_LSF = utc_model_record.WN_LSF * CNAV_WN_LSF_LSB;
|
||||
|
||||
utc_model_record.i_DN = static_cast<int32_t>(read_navigation_signed(data_bits, CNAV_DN));
|
||||
utc_model_record.i_DN = utc_model_record.i_DN * CNAV_DN_LSB;
|
||||
utc_model_record.DN = static_cast<int32_t>(read_navigation_signed(data_bits, CNAV_DN));
|
||||
utc_model_record.DN = utc_model_record.DN * CNAV_DN_LSB;
|
||||
|
||||
utc_model_record.d_DeltaT_LSF = static_cast<int32_t>(read_navigation_signed(data_bits, CNAV_DELTA_TLSF));
|
||||
utc_model_record.d_DeltaT_LSF = utc_model_record.d_DeltaT_LSF * CNAV_DELTA_TLSF_LSB;
|
||||
utc_model_record.DeltaT_LSF = static_cast<int32_t>(read_navigation_signed(data_bits, CNAV_DELTA_TLSF));
|
||||
utc_model_record.DeltaT_LSF = utc_model_record.DeltaT_LSF * CNAV_DELTA_TLSF_LSB;
|
||||
b_flag_utc_valid = true;
|
||||
break;
|
||||
default:
|
||||
@ -289,7 +292,7 @@ bool Gps_CNAV_Navigation_Message::have_new_ephemeris() // Check if we have a ne
|
||||
{
|
||||
if (b_flag_ephemeris_1 == true and b_flag_ephemeris_2 == true)
|
||||
{
|
||||
if (ephemeris_record.d_Toe1 == ephemeris_record.d_Toe2) // and ephemeris_record.d_Toe1==ephemeris_record.d_Toc)
|
||||
if (ephemeris_record.toe1 == ephemeris_record.toe2) // and ephemeris_record.toe1==ephemeris_record.d_Toc)
|
||||
{
|
||||
// if all ephemeris pages have the same TOE, then they belong to the same block
|
||||
// std::cout << "Ephemeris (1, 2) have been received and belong to the same batch\n";
|
||||
|
@ -41,36 +41,36 @@ public:
|
||||
Gps_CNAV_Utc_Model() = default;
|
||||
|
||||
// UTC parameters
|
||||
double d_A2{}; //!< 2nd order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200L) [s/s]
|
||||
double d_A1{}; //!< 1st order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200L) [s/s]
|
||||
double d_A0{}; //!< Constant of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200L) [s]
|
||||
int32_t d_t_OT{}; //!< Reference time for UTC data (reference 20.3.4.5 and 20.3.3.5.2.4 IS-GPS-200L) [s]
|
||||
int32_t i_WN_T{}; //!< UTC reference week number [weeks]
|
||||
int32_t d_DeltaT_LS{}; //!< delta time due to leap seconds [s]. Number of leap seconds since 6-Jan-1980 as transmitted by the GPS almanac.
|
||||
int32_t i_WN_LSF{}; //!< Week number at the end of which the leap second becomes effective [weeks]
|
||||
int32_t i_DN{}; //!< Day number (DN) at the end of which the leap second becomes effective [days]
|
||||
int32_t d_DeltaT_LSF{}; //!< Scheduled future or recent past (relative to NAV message upload) value of the delta time due to leap seconds [s]
|
||||
double A2{}; //!< 2nd order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200L) [s/s]
|
||||
double A1{}; //!< 1st order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200L) [s/s]
|
||||
double A0{}; //!< Constant of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200L) [s]
|
||||
int32_t tot{}; //!< Reference time for UTC data (reference 20.3.4.5 and 20.3.3.5.2.4 IS-GPS-200L) [s]
|
||||
int32_t WN_T{}; //!< UTC reference week number [weeks]
|
||||
int32_t DeltaT_LS{}; //!< Delta time due to leap seconds [s]. Number of leap seconds since 6-Jan-1980 as transmitted by the GPS almanac.
|
||||
int32_t WN_LSF{}; //!< Week number at the end of which the leap second becomes effective [weeks]
|
||||
int32_t DN{}; //!< Day number (DN) at the end of which the leap second becomes effective [days]
|
||||
int32_t DeltaT_LSF{}; //!< Scheduled future or recent past (relative to NAV message upload) value of the delta time due to leap seconds [s]
|
||||
bool valid{};
|
||||
|
||||
template <class Archive>
|
||||
/*
|
||||
* \brief Serialize is a boost standard method to be called by the boost XML serialization. Here is used to save the ephemeris data on disk file.
|
||||
* \brief Serialize is a boost standard method to be called by the boost XML
|
||||
* serialization. Here is used to save the ephemeris data on disk file.
|
||||
*/
|
||||
inline void serialize(Archive& archive, const uint32_t version)
|
||||
{
|
||||
using boost::serialization::make_nvp;
|
||||
if (version)
|
||||
{
|
||||
};
|
||||
archive& make_nvp("d_A1", d_A1);
|
||||
archive& make_nvp("d_A0", d_A0);
|
||||
archive& make_nvp("d_t_OT", d_t_OT);
|
||||
archive& make_nvp("i_WN_T", i_WN_T);
|
||||
archive& make_nvp("d_DeltaT_LS", d_DeltaT_LS);
|
||||
archive& make_nvp("i_WN_LSF", i_WN_LSF);
|
||||
archive& make_nvp("i_DN", i_DN);
|
||||
archive& make_nvp("d_DeltaT_LSF", d_DeltaT_LSF);
|
||||
archive& make_nvp("valid", valid);
|
||||
archive& BOOST_SERIALIZATION_NVP(A1);
|
||||
archive& BOOST_SERIALIZATION_NVP(A0);
|
||||
archive& BOOST_SERIALIZATION_NVP(tot);
|
||||
archive& BOOST_SERIALIZATION_NVP(WN_T);
|
||||
archive& BOOST_SERIALIZATION_NVP(DeltaT_LS);
|
||||
archive& BOOST_SERIALIZATION_NVP(WN_LSF);
|
||||
archive& BOOST_SERIALIZATION_NVP(DN);
|
||||
archive& BOOST_SERIALIZATION_NVP(DeltaT_LSF);
|
||||
archive& BOOST_SERIALIZATION_NVP(valid);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -17,9 +17,8 @@
|
||||
*/
|
||||
|
||||
#include "gps_ephemeris.h"
|
||||
#include "GPS_L1_CA.h"
|
||||
#include "gnss_satellite.h"
|
||||
#include <cmath>
|
||||
#include <string>
|
||||
|
||||
|
||||
Gps_Ephemeris::Gps_Ephemeris()
|
||||
@ -30,195 +29,5 @@ Gps_Ephemeris::Gps_Ephemeris()
|
||||
{
|
||||
satelliteBlock[i] = gnss_sat.what_block(_system, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
double Gps_Ephemeris::check_t(double time)
|
||||
{
|
||||
const double half_week = 302400.0; // seconds
|
||||
double corrTime = time;
|
||||
if (time > half_week)
|
||||
{
|
||||
corrTime = time - 2.0 * half_week;
|
||||
}
|
||||
else if (time < -half_week)
|
||||
{
|
||||
corrTime = time + 2.0 * half_week;
|
||||
}
|
||||
return corrTime;
|
||||
}
|
||||
|
||||
|
||||
// 20.3.3.3.3.1 User Algorithm for SV Clock Correction.
|
||||
double Gps_Ephemeris::sv_clock_drift(double transmitTime)
|
||||
{
|
||||
// double dt;
|
||||
// dt = check_t(transmitTime - d_Toc);
|
||||
//
|
||||
// for (int32_t i = 0; i < 2; i++)
|
||||
// {
|
||||
// dt -= d_A_f0 + d_A_f1 * dt + d_A_f2 * (dt * dt);
|
||||
// }
|
||||
// d_satClkDrift = d_A_f0 + d_A_f1 * dt + d_A_f2 * (dt * dt);
|
||||
|
||||
const double dt = check_t(transmitTime - d_Toc);
|
||||
d_satClkDrift = d_A_f0 + d_A_f1 * dt + d_A_f2 * (dt * dt) + sv_clock_relativistic_term(transmitTime);
|
||||
// Correct satellite group delay
|
||||
d_satClkDrift -= d_TGD;
|
||||
|
||||
return d_satClkDrift;
|
||||
}
|
||||
|
||||
|
||||
// compute the relativistic correction term
|
||||
double Gps_Ephemeris::sv_clock_relativistic_term(double transmitTime)
|
||||
{
|
||||
// Restore semi-major axis
|
||||
const double a = d_sqrt_A * d_sqrt_A;
|
||||
|
||||
// Time from ephemeris reference epoch
|
||||
const double tk = check_t(transmitTime - d_Toe);
|
||||
|
||||
// Computed mean motion
|
||||
const double n0 = sqrt(GPS_GM / (a * a * a));
|
||||
|
||||
// Corrected mean motion
|
||||
const double n = n0 + d_Delta_n;
|
||||
|
||||
// Mean anomaly
|
||||
const double M = d_M_0 + n * tk;
|
||||
|
||||
// Reduce mean anomaly to between 0 and 2pi
|
||||
// M = fmod((M + 2.0 * GNSS_PI), (2.0 * GNSS_PI));
|
||||
|
||||
// Initial guess of eccentric anomaly
|
||||
double E = M;
|
||||
double E_old;
|
||||
double dE;
|
||||
// --- Iteratively compute eccentric anomaly ----------------------------
|
||||
for (int32_t ii = 1; ii < 20; ii++)
|
||||
{
|
||||
E_old = E;
|
||||
E = M + d_e_eccentricity * sin(E);
|
||||
dE = fmod(E - E_old, 2.0 * GNSS_PI);
|
||||
if (fabs(dE) < 1e-12)
|
||||
{
|
||||
// Necessary precision is reached, exit from the loop
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Compute relativistic correction term
|
||||
d_dtr = GPS_F * d_e_eccentricity * d_sqrt_A * sin(E);
|
||||
return d_dtr;
|
||||
}
|
||||
|
||||
|
||||
double Gps_Ephemeris::satellitePosition(double transmitTime)
|
||||
{
|
||||
// Find satellite's position -----------------------------------------------
|
||||
// Restore semi-major axis
|
||||
const double a = d_sqrt_A * d_sqrt_A;
|
||||
|
||||
// Time from ephemeris reference epoch
|
||||
double tk = check_t(transmitTime - d_Toe);
|
||||
|
||||
// Computed mean motion
|
||||
const double n0 = sqrt(GPS_GM / (a * a * a));
|
||||
|
||||
// Corrected mean motion
|
||||
const double n = n0 + d_Delta_n;
|
||||
|
||||
// Mean anomaly
|
||||
const double M = d_M_0 + n * tk;
|
||||
|
||||
// Reduce mean anomaly to between 0 and 2pi
|
||||
// M = fmod((M + 2.0 * GNSS_PI), (2.0 * GNSS_PI));
|
||||
|
||||
// Initial guess of eccentric anomaly
|
||||
double E = M;
|
||||
double E_old;
|
||||
double dE;
|
||||
// --- Iteratively compute eccentric anomaly -------------------------------
|
||||
for (int32_t ii = 1; ii < 20; ii++)
|
||||
{
|
||||
E_old = E;
|
||||
E = M + d_e_eccentricity * sin(E);
|
||||
dE = fmod(E - E_old, 2.0 * GNSS_PI);
|
||||
if (fabs(dE) < 1e-12)
|
||||
{
|
||||
// Necessary precision is reached, exit from the loop
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
const double sek = sin(E);
|
||||
const double cek = cos(E);
|
||||
const double OneMinusecosE = 1.0 - d_e_eccentricity * cek;
|
||||
const double ekdot = n / OneMinusecosE;
|
||||
|
||||
// Compute the true anomaly
|
||||
const double sq1e2 = sqrt(1.0 - d_e_eccentricity * d_e_eccentricity);
|
||||
const double tmp_Y = sq1e2 * sek;
|
||||
const double tmp_X = cek - d_e_eccentricity;
|
||||
const double nu = atan2(tmp_Y, tmp_X);
|
||||
|
||||
// Compute angle phi (argument of Latitude)
|
||||
const double phi = nu + d_OMEGA;
|
||||
double pkdot = sq1e2 * ekdot / OneMinusecosE;
|
||||
|
||||
// Reduce phi to between 0 and 2*pi rad
|
||||
// phi = fmod((phi), (2.0 * GNSS_PI));
|
||||
const double s2pk = sin(2.0 * phi);
|
||||
const double c2pk = cos(2.0 * phi);
|
||||
|
||||
// Correct argument of latitude
|
||||
const double u = phi + d_Cuc * c2pk + d_Cus * s2pk;
|
||||
const double cuk = cos(u);
|
||||
const double suk = sin(u);
|
||||
const double ukdot = pkdot * (1.0 + 2.0 * (d_Cus * c2pk - d_Cuc * s2pk));
|
||||
|
||||
// Correct radius
|
||||
const double r = a * (1.0 - d_e_eccentricity * cek) + d_Crc * c2pk + d_Crs * s2pk;
|
||||
|
||||
const double rkdot = a * d_e_eccentricity * sek * ekdot + 2.0 * pkdot * (d_Crs * c2pk - d_Crc * s2pk);
|
||||
|
||||
// Correct inclination
|
||||
const double i = d_i_0 + d_IDOT * tk + d_Cic * c2pk + d_Cis * s2pk;
|
||||
const double sik = sin(i);
|
||||
const double cik = cos(i);
|
||||
const double ikdot = d_IDOT + 2.0 * pkdot * (d_Cis * c2pk - d_Cic * s2pk);
|
||||
|
||||
// Compute the angle between the ascending node and the Greenwich meridian
|
||||
const double Omega = d_OMEGA0 + (d_OMEGA_DOT - GNSS_OMEGA_EARTH_DOT) * tk - GNSS_OMEGA_EARTH_DOT * d_Toe;
|
||||
const double sok = sin(Omega);
|
||||
const double cok = cos(Omega);
|
||||
|
||||
// --- Compute satellite coordinates in Earth-fixed coordinates
|
||||
const double xprime = r * cuk;
|
||||
const double yprime = r * suk;
|
||||
d_satpos_X = xprime * cok - yprime * cik * sok;
|
||||
d_satpos_Y = xprime * sok + yprime * cik * cok;
|
||||
d_satpos_Z = yprime * sik;
|
||||
|
||||
// Satellite's velocity. Can be useful for Vector Tracking loops
|
||||
const double Omega_dot = d_OMEGA_DOT - GNSS_OMEGA_EARTH_DOT;
|
||||
|
||||
const double xpkdot = rkdot * cuk - yprime * ukdot;
|
||||
const double ypkdot = rkdot * suk + xprime * ukdot;
|
||||
const double tmp = ypkdot * cik - d_satpos_Z * ikdot;
|
||||
|
||||
d_satvel_X = -Omega_dot * d_satpos_Y + xpkdot * cok - tmp * sok;
|
||||
d_satvel_Y = Omega_dot * d_satpos_X + xpkdot * sok + tmp * cok;
|
||||
d_satvel_Z = yprime * cik * ikdot + ypkdot * sik;
|
||||
|
||||
// Time from ephemeris reference clock
|
||||
tk = check_t(transmitTime - d_Toc);
|
||||
|
||||
double dtr_s = d_A_f0 + d_A_f1 * tk + d_A_f2 * tk * tk;
|
||||
|
||||
/* relativity correction */
|
||||
dtr_s -= 2.0 * sqrt(GPS_GM * a) * d_e_eccentricity * sek / (SPEED_OF_LIGHT_M_S * SPEED_OF_LIGHT_M_S);
|
||||
|
||||
return dtr_s;
|
||||
this->System = 'G';
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
#define GNSS_SDR_GPS_EPHEMERIS_H
|
||||
|
||||
|
||||
#include "gnss_ephemeris.h"
|
||||
#include <boost/serialization/nvp.hpp>
|
||||
#include <cstdint>
|
||||
#include <map>
|
||||
@ -31,11 +32,12 @@
|
||||
|
||||
|
||||
/*!
|
||||
* \brief This class is a storage and orbital model functions for the GPS SV ephemeris data as described in IS-GPS-200L
|
||||
* \brief This class is a storage and orbital model functions for the GPS SV
|
||||
* ephemeris data as described in IS-GPS-200L
|
||||
*
|
||||
* See https://www.gps.gov/technical/icwg/IS-GPS-200L.pdf Appendix II
|
||||
*/
|
||||
class Gps_Ephemeris
|
||||
class Gps_Ephemeris : public Gnss_Ephemeris
|
||||
{
|
||||
public:
|
||||
/*!
|
||||
@ -43,63 +45,20 @@ public:
|
||||
*/
|
||||
Gps_Ephemeris();
|
||||
|
||||
/*!
|
||||
* \brief Compute the ECEF SV coordinates and ECEF velocity
|
||||
* Implementation of Table 20-IV (IS-GPS-200L)
|
||||
* and compute the clock bias term including relativistic effect (return value)
|
||||
*/
|
||||
double satellitePosition(double transmitTime);
|
||||
|
||||
/*!
|
||||
* \brief Sets (\a d_satClkDrift)and returns the clock drift in seconds according to the User Algorithm for SV Clock Correction
|
||||
* (IS-GPS-200L, 20.3.3.3.3.1)
|
||||
*/
|
||||
double sv_clock_drift(double transmitTime);
|
||||
|
||||
/*!
|
||||
* \brief Sets (\a d_dtr) and returns the clock relativistic correction term in seconds according to the User Algorithm for SV Clock Correction
|
||||
* (IS-GPS-200L, 20.3.3.3.3.1)
|
||||
*/
|
||||
double sv_clock_relativistic_term(double transmitTime);
|
||||
|
||||
uint32_t i_satellite_PRN{}; // SV PRN NUMBER
|
||||
int32_t d_TOW{}; //!< Time of GPS Week of the ephemeris set (taken from subframes TOW) [s]
|
||||
double d_Crs{}; //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m]
|
||||
double d_Delta_n{}; //!< Mean Motion Difference From Computed Value [semi-circles/s]
|
||||
double d_M_0{}; //!< Mean Anomaly at Reference Time [semi-circles]
|
||||
double d_Cuc{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad]
|
||||
double d_e_eccentricity{}; //!< Eccentricity [dimensionless]
|
||||
double d_Cus{}; //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad]
|
||||
double d_sqrt_A{}; //!< Square Root of the Semi-Major Axis [sqrt(m)]
|
||||
int32_t d_Toe{}; //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200L) [s]
|
||||
int32_t d_Toc{}; //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200L) [s]
|
||||
double d_Cic{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad]
|
||||
double d_OMEGA0{}; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles]
|
||||
double d_Cis{}; //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad]
|
||||
double d_i_0{}; //!< Inclination Angle at Reference Time [semi-circles]
|
||||
double d_Crc{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius [m]
|
||||
double d_OMEGA{}; //!< Argument of Perigee [semi-cicles]
|
||||
double d_OMEGA_DOT{}; //!< Rate of Right Ascension [semi-circles/s]
|
||||
double d_IDOT{}; //!< Rate of Inclination Angle [semi-circles/s]
|
||||
int32_t i_code_on_L2{}; //!< If 1, P code ON in L2; if 2, C/A code ON in L2;
|
||||
int32_t i_GPS_week{}; //!< GPS week number, aka WN [week]
|
||||
bool b_L2_P_data_flag{}; //!< When true, indicates that the NAV data stream was commanded OFF on the P-code of the L2 channel
|
||||
int32_t i_SV_accuracy{}; //!< User Range Accuracy (URA) index of the SV (reference paragraph 6.2.1) for the standard positioning service user (Ref 20.3.3.3.1.3 IS-GPS-200L)
|
||||
int32_t i_SV_health{};
|
||||
double d_TGD{}; //!< Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s]
|
||||
int32_t d_IODC{}; //!< Issue of Data, Clock
|
||||
int32_t d_IODE_SF2{}; //!< Issue of Data, Ephemeris (IODE), subframe 2
|
||||
int32_t d_IODE_SF3{}; //!< Issue of Data, Ephemeris(IODE), subframe 3
|
||||
int32_t i_AODO{}; //!< Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s]
|
||||
int32_t code_on_L2{}; //!< If 1, P code ON in L2; if 2, C/A code ON in L2;
|
||||
bool L2_P_data_flag{}; //!< When true, indicates that the NAV data stream was commanded OFF on the P-code of the L2 channel
|
||||
int32_t SV_accuracy{}; //!< User Range Accuracy (URA) index of the SV (reference paragraph 6.2.1) for the standard positioning service user (Ref 20.3.3.3.1.3 IS-GPS-200L)
|
||||
int32_t SV_health{}; //!< Satellite heath status
|
||||
double TGD{}; //!< Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s]
|
||||
int32_t IODC{}; //!< Issue of Data, Clock
|
||||
int32_t IODE_SF2{}; //!< Issue of Data, Ephemeris (IODE), subframe 2
|
||||
int32_t IODE_SF3{}; //!< Issue of Data, Ephemeris (IODE), subframe 3
|
||||
int32_t AODO{}; //!< Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s]
|
||||
|
||||
bool b_fit_interval_flag{}; //!< indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours.
|
||||
double d_spare1{};
|
||||
double d_spare2{};
|
||||
|
||||
double d_A_f0{}; //!< Coefficient 0 of code phase offset model [s]
|
||||
double d_A_f1{}; //!< Coefficient 1 of code phase offset model [s/s]
|
||||
double d_A_f2{}; //!< Coefficient 2 of code phase offset model [s/s^2]
|
||||
|
||||
// Flags
|
||||
|
||||
/*! \brief If true, enhanced level of integrity assurance.
|
||||
@ -113,29 +72,16 @@ public:
|
||||
* accompanying alert, is less than 1E-8 per hour.
|
||||
*/
|
||||
bool b_integrity_status_flag{};
|
||||
bool b_alert_flag{}; //!< If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk.
|
||||
bool b_alert_flag{}; //!< If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk.
|
||||
bool b_antispoofing_flag{}; //!< If true, the AntiSpoofing mode is ON in that SV
|
||||
|
||||
// clock terms derived from ephemeris data
|
||||
double d_satClkDrift{}; //!< GPS clock error
|
||||
double d_dtr{}; //!< relativistic clock correction term
|
||||
|
||||
// satellite positions
|
||||
double d_satpos_X{}; //!< Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis.
|
||||
double d_satpos_Y{}; //!< Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system.
|
||||
double d_satpos_Z{}; //!< Earth-fixed coordinate z of the satellite [m]. The direction of the IERS (International Earth Rotation and Reference Systems Service) Reference Pole (IRP).
|
||||
|
||||
// Satellite velocity
|
||||
double d_satvel_X{}; //!< Earth-fixed velocity coordinate x of the satellite [m]
|
||||
double d_satvel_Y{}; //!< Earth-fixed velocity coordinate y of the satellite [m]
|
||||
double d_satvel_Z{}; //!< Earth-fixed velocity coordinate z of the satellite [m]
|
||||
|
||||
std::map<int, std::string> satelliteBlock; //!< Map that stores to which block the PRN belongs https://www.navcen.uscg.gov/?Do=constellationStatus
|
||||
|
||||
template <class Archive>
|
||||
|
||||
/*!
|
||||
* \brief Serialize is a boost standard method to be called by the boost XML serialization. Here is used to save the ephemeris data on disk file.
|
||||
* \brief Serialize is a boost standard method to be called by the boost XML
|
||||
* serialization. Here is used to save the ephemeris data on disk file.
|
||||
*/
|
||||
inline void serialize(Archive& archive, const uint32_t version)
|
||||
{
|
||||
@ -144,58 +90,48 @@ public:
|
||||
{
|
||||
};
|
||||
|
||||
archive& make_nvp("i_satellite_PRN", i_satellite_PRN); // SV PRN NUMBER
|
||||
archive& make_nvp("d_TOW", d_TOW); //!< Time of GPS Week of the ephemeris set (taken from subframes TOW) [s]
|
||||
archive& make_nvp("d_IODE_SF2", d_IODE_SF2);
|
||||
archive& make_nvp("d_IODE_SF3", d_IODE_SF3);
|
||||
archive& make_nvp("d_Crs", d_Crs); //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m]
|
||||
archive& make_nvp("d_Delta_n", d_Delta_n); //!< Mean Motion Difference From Computed Value [semi-circles/s]
|
||||
archive& make_nvp("d_M_0", d_M_0); //!< Mean Anomaly at Reference Time [semi-circles]
|
||||
archive& make_nvp("d_Cuc", d_Cuc); //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad]
|
||||
archive& make_nvp("d_e_eccentricity", d_e_eccentricity); //!< Eccentricity [dimensionless]
|
||||
archive& make_nvp("d_Cus", d_Cus); //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad]
|
||||
archive& make_nvp("d_sqrt_A", d_sqrt_A); //!< Square Root of the Semi-Major Axis [sqrt(m)]
|
||||
archive& make_nvp("d_Toe", d_Toe); //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200L) [s]
|
||||
archive& make_nvp("d_Toc", d_Toc); //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200L) [s]
|
||||
archive& make_nvp("d_Cic", d_Cic); //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad]
|
||||
archive& make_nvp("d_OMEGA0", d_OMEGA0); //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles]
|
||||
archive& make_nvp("d_Cis", d_Cis); //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad]
|
||||
archive& make_nvp("d_i_0", d_i_0); //!< Inclination Angle at Reference Time [semi-circles]
|
||||
archive& make_nvp("d_Crc", d_Crc); //!< Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius [m]
|
||||
archive& make_nvp("d_OMEGA", d_OMEGA); //!< Argument of Perigee [semi-cicles]
|
||||
archive& make_nvp("d_OMEGA_DOT", d_OMEGA_DOT); //!< Rate of Right Ascension [semi-circles/s]
|
||||
archive& make_nvp("d_IDOT", d_IDOT); //!< Rate of Inclination Angle [semi-circles/s]
|
||||
archive& make_nvp("i_code_on_L2", i_code_on_L2); //!< If 1, P code ON in L2; if 2, C/A code ON in L2;
|
||||
archive& make_nvp("i_GPS_week", i_GPS_week); //!< GPS week number, aka WN [week]
|
||||
archive& make_nvp("b_L2_P_data_flag", b_L2_P_data_flag); //!< When true, indicates that the NAV data stream was commanded OFF on the P-code of the L2 channel
|
||||
archive& make_nvp("i_SV_accuracy", i_SV_accuracy); //!< User Range Accuracy (URA) index of the SV (reference paragraph 6.2.1) for the standard positioning service user (Ref 20.3.3.3.1.3 IS-GPS-200L)
|
||||
archive& make_nvp("i_SV_health", i_SV_health);
|
||||
archive& make_nvp("d_TGD", d_TGD); //!< Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s]
|
||||
archive& make_nvp("d_IODC", d_IODC); //!< Issue of Data, Clock
|
||||
archive& make_nvp("i_AODO", i_AODO); //!< Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s]
|
||||
archive& BOOST_SERIALIZATION_NVP(PRN);
|
||||
archive& BOOST_SERIALIZATION_NVP(M_0);
|
||||
archive& BOOST_SERIALIZATION_NVP(delta_n);
|
||||
archive& BOOST_SERIALIZATION_NVP(ecc);
|
||||
archive& BOOST_SERIALIZATION_NVP(sqrtA);
|
||||
archive& BOOST_SERIALIZATION_NVP(OMEGA_0);
|
||||
archive& BOOST_SERIALIZATION_NVP(i_0);
|
||||
archive& BOOST_SERIALIZATION_NVP(omega);
|
||||
archive& BOOST_SERIALIZATION_NVP(OMEGAdot);
|
||||
archive& BOOST_SERIALIZATION_NVP(idot);
|
||||
archive& BOOST_SERIALIZATION_NVP(Cuc);
|
||||
archive& BOOST_SERIALIZATION_NVP(Cus);
|
||||
archive& BOOST_SERIALIZATION_NVP(Crc);
|
||||
archive& BOOST_SERIALIZATION_NVP(Crs);
|
||||
archive& BOOST_SERIALIZATION_NVP(Cic);
|
||||
archive& BOOST_SERIALIZATION_NVP(Cis);
|
||||
archive& BOOST_SERIALIZATION_NVP(toe);
|
||||
archive& BOOST_SERIALIZATION_NVP(toc);
|
||||
archive& BOOST_SERIALIZATION_NVP(af0);
|
||||
archive& BOOST_SERIALIZATION_NVP(af1);
|
||||
archive& BOOST_SERIALIZATION_NVP(af2);
|
||||
archive& BOOST_SERIALIZATION_NVP(WN);
|
||||
archive& BOOST_SERIALIZATION_NVP(tow);
|
||||
archive& BOOST_SERIALIZATION_NVP(satClkDrift);
|
||||
archive& BOOST_SERIALIZATION_NVP(dtr);
|
||||
|
||||
archive& make_nvp("b_fit_interval_flag", b_fit_interval_flag); //!< Indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours.
|
||||
archive& make_nvp("d_spare1", d_spare1);
|
||||
archive& make_nvp("d_spare2", d_spare2);
|
||||
|
||||
archive& make_nvp("d_A_f0", d_A_f0); //!< Coefficient 0 of code phase offset model [s]
|
||||
archive& make_nvp("d_A_f1", d_A_f1); //!< Coefficient 1 of code phase offset model [s/s]
|
||||
archive& make_nvp("d_A_f2", d_A_f2); //!< Coefficient 2 of code phase offset model [s/s^2]
|
||||
|
||||
archive& make_nvp("b_integrity_status_flag", b_integrity_status_flag);
|
||||
archive& make_nvp("b_alert_flag", b_alert_flag); //!< If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk.
|
||||
archive& make_nvp("b_antispoofing_flag", b_antispoofing_flag); //!< If true, the AntiSpoofing mode is ON in that SV
|
||||
archive& BOOST_SERIALIZATION_NVP(IODE_SF2);
|
||||
archive& BOOST_SERIALIZATION_NVP(IODE_SF3);
|
||||
archive& BOOST_SERIALIZATION_NVP(code_on_L2);
|
||||
archive& BOOST_SERIALIZATION_NVP(L2_P_data_flag);
|
||||
archive& BOOST_SERIALIZATION_NVP(SV_accuracy);
|
||||
archive& BOOST_SERIALIZATION_NVP(SV_health);
|
||||
archive& BOOST_SERIALIZATION_NVP(TGD);
|
||||
archive& BOOST_SERIALIZATION_NVP(IODC);
|
||||
archive& BOOST_SERIALIZATION_NVP(AODO);
|
||||
archive& BOOST_SERIALIZATION_NVP(b_fit_interval_flag);
|
||||
archive& BOOST_SERIALIZATION_NVP(d_spare1);
|
||||
archive& BOOST_SERIALIZATION_NVP(d_spare2);
|
||||
archive& BOOST_SERIALIZATION_NVP(b_integrity_status_flag);
|
||||
archive& BOOST_SERIALIZATION_NVP(b_alert_flag);
|
||||
archive& BOOST_SERIALIZATION_NVP(b_antispoofing_flag);
|
||||
}
|
||||
|
||||
private:
|
||||
/*
|
||||
* Accounts for the beginning or end of week crossover
|
||||
*
|
||||
* See paragraph 20.3.3.3.3.1 (IS-GPS-200L)
|
||||
* \param[in] - time in seconds
|
||||
* \param[out] - corrected time, in seconds
|
||||
*/
|
||||
double check_t(double time);
|
||||
};
|
||||
|
||||
|
||||
|
@ -37,36 +37,36 @@ class Gps_Iono
|
||||
public:
|
||||
bool valid{}; //!< Valid flag
|
||||
// Ionospheric parameters
|
||||
double d_alpha0{}; //!< Coefficient 0 of a cubic equation representing the amplitude of the vertical delay [s]
|
||||
double d_alpha1{}; //!< Coefficient 1 of a cubic equation representing the amplitude of the vertical delay [s/semi-circle]
|
||||
double d_alpha2{}; //!< Coefficient 2 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^2]
|
||||
double d_alpha3{}; //!< Coefficient 3 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^3]
|
||||
double d_beta0{}; //!< Coefficient 0 of a cubic equation representing the period of the model [s]
|
||||
double d_beta1{}; //!< Coefficient 1 of a cubic equation representing the period of the model [s/semi-circle]
|
||||
double d_beta2{}; //!< Coefficient 2 of a cubic equation representing the period of the model [s(semi-circle)^2]
|
||||
double d_beta3{}; //!< Coefficient 3 of a cubic equation representing the period of the model [s(semi-circle)^3]
|
||||
double alpha0{}; //!< Coefficient 0 of a cubic equation representing the amplitude of the vertical delay [s]
|
||||
double alpha1{}; //!< Coefficient 1 of a cubic equation representing the amplitude of the vertical delay [s/semi-circle]
|
||||
double alpha2{}; //!< Coefficient 2 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^2]
|
||||
double alpha3{}; //!< Coefficient 3 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^3]
|
||||
double beta0{}; //!< Coefficient 0 of a cubic equation representing the period of the model [s]
|
||||
double beta1{}; //!< Coefficient 1 of a cubic equation representing the period of the model [s/semi-circle]
|
||||
double beta2{}; //!< Coefficient 2 of a cubic equation representing the period of the model [s(semi-circle)^2]
|
||||
double beta3{}; //!< Coefficient 3 of a cubic equation representing the period of the model [s(semi-circle)^3]
|
||||
|
||||
Gps_Iono() = default; //!< Default constructor
|
||||
|
||||
template <class Archive>
|
||||
|
||||
/*!
|
||||
* \brief Serialize is a boost standard method to be called by the boost XML serialization. Here is used to save the ephemeris data on disk file.
|
||||
* \brief Serialize is a boost standard method to be called by the boost XML
|
||||
* serialization. Here is used to save the ephemeris data on disk file.
|
||||
*/
|
||||
inline void serialize(Archive& archive, const unsigned int version)
|
||||
{
|
||||
using boost::serialization::make_nvp;
|
||||
if (version)
|
||||
{
|
||||
};
|
||||
archive& make_nvp("d_alpha0", d_alpha0);
|
||||
archive& make_nvp("d_alpha1", d_alpha1);
|
||||
archive& make_nvp("d_alpha2", d_alpha2);
|
||||
archive& make_nvp("d_alpha3", d_alpha3);
|
||||
archive& make_nvp("d_beta0", d_beta0);
|
||||
archive& make_nvp("d_beta1", d_beta1);
|
||||
archive& make_nvp("d_beta2", d_beta2);
|
||||
archive& make_nvp("d_beta3", d_beta3);
|
||||
archive& BOOST_SERIALIZATION_NVP(alpha0);
|
||||
archive& BOOST_SERIALIZATION_NVP(alpha1);
|
||||
archive& BOOST_SERIALIZATION_NVP(alpha2);
|
||||
archive& BOOST_SERIALIZATION_NVP(alpha3);
|
||||
archive& BOOST_SERIALIZATION_NVP(beta0);
|
||||
archive& BOOST_SERIALIZATION_NVP(beta1);
|
||||
archive& BOOST_SERIALIZATION_NVP(beta2);
|
||||
archive& BOOST_SERIALIZATION_NVP(beta3);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -426,52 +426,56 @@ double Gps_Navigation_Message::utc_time(const double gpstime_corrected) const
|
||||
Gps_Ephemeris Gps_Navigation_Message::get_ephemeris() const
|
||||
{
|
||||
Gps_Ephemeris ephemeris;
|
||||
ephemeris.i_satellite_PRN = i_satellite_PRN;
|
||||
ephemeris.d_TOW = d_TOW;
|
||||
ephemeris.d_Crs = d_Crs;
|
||||
ephemeris.d_Delta_n = d_Delta_n;
|
||||
ephemeris.d_M_0 = d_M_0;
|
||||
ephemeris.d_Cuc = d_Cuc;
|
||||
ephemeris.d_e_eccentricity = d_e_eccentricity;
|
||||
ephemeris.d_Cus = d_Cus;
|
||||
ephemeris.d_sqrt_A = d_sqrt_A;
|
||||
ephemeris.d_Toe = d_Toe;
|
||||
ephemeris.d_Toc = d_Toc;
|
||||
ephemeris.d_Cic = d_Cic;
|
||||
ephemeris.d_OMEGA0 = d_OMEGA0;
|
||||
ephemeris.d_Cis = d_Cis;
|
||||
ephemeris.d_i_0 = d_i_0;
|
||||
ephemeris.d_Crc = d_Crc;
|
||||
ephemeris.d_OMEGA = d_OMEGA;
|
||||
ephemeris.d_OMEGA_DOT = d_OMEGA_DOT;
|
||||
ephemeris.d_IDOT = d_IDOT;
|
||||
ephemeris.i_code_on_L2 = i_code_on_L2;
|
||||
ephemeris.i_GPS_week = i_GPS_week;
|
||||
ephemeris.b_L2_P_data_flag = b_L2_P_data_flag;
|
||||
ephemeris.i_SV_accuracy = i_SV_accuracy;
|
||||
ephemeris.i_SV_health = i_SV_health;
|
||||
ephemeris.d_TGD = d_TGD;
|
||||
ephemeris.d_IODC = d_IODC;
|
||||
ephemeris.d_IODE_SF2 = d_IODE_SF2;
|
||||
ephemeris.d_IODE_SF3 = d_IODE_SF3;
|
||||
ephemeris.i_AODO = i_AODO;
|
||||
ephemeris.PRN = i_satellite_PRN;
|
||||
ephemeris.tow = d_TOW;
|
||||
ephemeris.Crs = d_Crs;
|
||||
ephemeris.delta_n = d_Delta_n;
|
||||
ephemeris.M_0 = d_M_0;
|
||||
ephemeris.Cuc = d_Cuc;
|
||||
ephemeris.ecc = d_e_eccentricity;
|
||||
ephemeris.Cus = d_Cus;
|
||||
ephemeris.sqrtA = d_sqrt_A;
|
||||
ephemeris.toe = d_Toe;
|
||||
ephemeris.toc = d_Toc;
|
||||
ephemeris.Cic = d_Cic;
|
||||
ephemeris.OMEGA_0 = d_OMEGA0;
|
||||
ephemeris.Cis = d_Cis;
|
||||
ephemeris.i_0 = d_i_0;
|
||||
ephemeris.Crc = d_Crc;
|
||||
ephemeris.omega = d_OMEGA;
|
||||
ephemeris.OMEGAdot = d_OMEGA_DOT;
|
||||
ephemeris.idot = d_IDOT;
|
||||
ephemeris.code_on_L2 = i_code_on_L2;
|
||||
ephemeris.WN = i_GPS_week;
|
||||
ephemeris.L2_P_data_flag = b_L2_P_data_flag;
|
||||
ephemeris.SV_accuracy = i_SV_accuracy;
|
||||
ephemeris.SV_health = i_SV_health;
|
||||
ephemeris.TGD = d_TGD;
|
||||
ephemeris.IODC = d_IODC;
|
||||
ephemeris.IODE_SF2 = d_IODE_SF2;
|
||||
ephemeris.IODE_SF3 = d_IODE_SF3;
|
||||
ephemeris.AODO = i_AODO;
|
||||
ephemeris.b_fit_interval_flag = b_fit_interval_flag;
|
||||
ephemeris.d_spare1 = d_spare1;
|
||||
ephemeris.d_spare2 = d_spare2;
|
||||
ephemeris.d_A_f0 = d_A_f0;
|
||||
ephemeris.d_A_f1 = d_A_f1;
|
||||
ephemeris.d_A_f2 = d_A_f2;
|
||||
ephemeris.af0 = d_A_f0;
|
||||
ephemeris.af1 = d_A_f1;
|
||||
ephemeris.af2 = d_A_f2;
|
||||
ephemeris.b_integrity_status_flag = b_integrity_status_flag;
|
||||
ephemeris.b_alert_flag = b_alert_flag;
|
||||
ephemeris.b_antispoofing_flag = b_antispoofing_flag;
|
||||
ephemeris.d_satClkDrift = d_satClkDrift;
|
||||
ephemeris.d_dtr = d_dtr;
|
||||
ephemeris.d_satpos_X = d_satpos_X;
|
||||
ephemeris.d_satpos_Y = d_satpos_Y;
|
||||
ephemeris.d_satpos_Z = d_satpos_Z;
|
||||
ephemeris.d_satvel_X = d_satvel_X;
|
||||
ephemeris.d_satvel_Y = d_satvel_Y;
|
||||
ephemeris.d_satvel_Z = d_satvel_Z;
|
||||
|
||||
// These parameters are empty; can be computed later with
|
||||
// ephemeris.sv_clock_drift(double transmitTime);
|
||||
// ephemeris.satellitePosition(double transmitTime);
|
||||
ephemeris.satClkDrift = d_satClkDrift;
|
||||
ephemeris.dtr = d_dtr;
|
||||
ephemeris.satpos_X = d_satpos_X;
|
||||
ephemeris.satpos_Y = d_satpos_Y;
|
||||
ephemeris.satpos_Z = d_satpos_Z;
|
||||
ephemeris.satvel_X = d_satvel_X;
|
||||
ephemeris.satvel_Y = d_satvel_Y;
|
||||
ephemeris.satvel_Z = d_satvel_Z;
|
||||
|
||||
return ephemeris;
|
||||
}
|
||||
@ -480,14 +484,14 @@ Gps_Ephemeris Gps_Navigation_Message::get_ephemeris() const
|
||||
Gps_Iono Gps_Navigation_Message::get_iono()
|
||||
{
|
||||
Gps_Iono iono;
|
||||
iono.d_alpha0 = d_alpha0;
|
||||
iono.d_alpha1 = d_alpha1;
|
||||
iono.d_alpha2 = d_alpha2;
|
||||
iono.d_alpha3 = d_alpha3;
|
||||
iono.d_beta0 = d_beta0;
|
||||
iono.d_beta1 = d_beta1;
|
||||
iono.d_beta2 = d_beta2;
|
||||
iono.d_beta3 = d_beta3;
|
||||
iono.alpha0 = d_alpha0;
|
||||
iono.alpha1 = d_alpha1;
|
||||
iono.alpha2 = d_alpha2;
|
||||
iono.alpha3 = d_alpha3;
|
||||
iono.beta0 = d_beta0;
|
||||
iono.beta1 = d_beta1;
|
||||
iono.beta2 = d_beta2;
|
||||
iono.beta3 = d_beta3;
|
||||
iono.valid = flag_iono_valid;
|
||||
// WARNING: We clear flag_utc_model_valid in order to not re-send the same information to the ionospheric parameters queue
|
||||
flag_iono_valid = false;
|
||||
@ -500,14 +504,14 @@ Gps_Utc_Model Gps_Navigation_Message::get_utc_model()
|
||||
Gps_Utc_Model utc_model;
|
||||
utc_model.valid = flag_utc_model_valid;
|
||||
// UTC parameters
|
||||
utc_model.d_A1 = d_A1;
|
||||
utc_model.d_A0 = d_A0;
|
||||
utc_model.d_t_OT = d_t_OT;
|
||||
utc_model.i_WN_T = i_WN_T;
|
||||
utc_model.d_DeltaT_LS = d_DeltaT_LS;
|
||||
utc_model.i_WN_LSF = i_WN_LSF;
|
||||
utc_model.i_DN = i_DN;
|
||||
utc_model.d_DeltaT_LSF = d_DeltaT_LSF;
|
||||
utc_model.A1 = d_A1;
|
||||
utc_model.A0 = d_A0;
|
||||
utc_model.tot = d_t_OT;
|
||||
utc_model.WN_T = i_WN_T;
|
||||
utc_model.DeltaT_LS = d_DeltaT_LS;
|
||||
utc_model.WN_LSF = i_WN_LSF;
|
||||
utc_model.DN = i_DN;
|
||||
utc_model.DeltaT_LSF = d_DeltaT_LSF;
|
||||
// warning: We clear flag_utc_model_valid in order to not re-send the same information to the ionospheric parameters queue
|
||||
flag_utc_model_valid = false;
|
||||
return utc_model;
|
||||
|
@ -41,37 +41,37 @@ public:
|
||||
Gps_Utc_Model() = default;
|
||||
|
||||
// UTC parameters
|
||||
double d_A0{}; //!< Constant of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200L) [s]
|
||||
double d_A1{}; //!< 1st order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200L) [s/s]
|
||||
double d_A2{}; //!< 2nd order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200L) [s/s]
|
||||
int32_t d_t_OT{}; //!< Reference time for UTC data (reference 20.3.4.5 and 20.3.3.5.2.4 IS-GPS-200L) [s]
|
||||
int32_t i_WN_T{}; //!< UTC reference week number [weeks]
|
||||
int32_t d_DeltaT_LS{}; //!< delta time due to leap seconds [s]. Number of leap seconds since 6-Jan-1980 as transmitted by the GPS almanac.
|
||||
int32_t i_WN_LSF{}; //!< Week number at the end of which the leap second becomes effective [weeks]
|
||||
int32_t i_DN{}; //!< Day number (DN) at the end of which the leap second becomes effective [days]
|
||||
int32_t d_DeltaT_LSF{}; //!< Scheduled future or recent past (relative to NAV message upload) value of the delta time due to leap seconds [s]
|
||||
double A0{}; //!< Constant of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200L) [s]
|
||||
double A1{}; //!< 1st order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200L) [s/s]
|
||||
double A2{}; //!< 2nd order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200L) [s/s]
|
||||
int32_t tot{}; //!< Reference time for UTC data (reference 20.3.4.5 and 20.3.3.5.2.4 IS-GPS-200L) [s]
|
||||
int32_t WN_T{}; //!< UTC reference week number [weeks]
|
||||
int32_t DeltaT_LS{}; //!< Delta time due to leap seconds [s]. Number of leap seconds since 6-Jan-1980 as transmitted by the GPS almanac.
|
||||
int32_t WN_LSF{}; //!< Week number at the end of which the leap second becomes effective [weeks]
|
||||
int32_t DN{}; //!< Day number (DN) at the end of which the leap second becomes effective [days]
|
||||
int32_t DeltaT_LSF{}; //!< Scheduled future or recent past (relative to NAV message upload) value of the delta time due to leap seconds [s]
|
||||
|
||||
bool valid{};
|
||||
|
||||
template <class Archive>
|
||||
/*
|
||||
* \brief Serialize is a boost standard method to be called by the boost XML serialization. Here is used to save the ephemeris data on disk file.
|
||||
* \brief Serialize is a boost standard method to be called by the boost XML
|
||||
* serialization. Here is used to save the ephemeris data on disk file.
|
||||
*/
|
||||
inline void serialize(Archive& archive, const uint32_t version)
|
||||
{
|
||||
using boost::serialization::make_nvp;
|
||||
if (version)
|
||||
{
|
||||
};
|
||||
archive& make_nvp("d_A1", d_A1);
|
||||
archive& make_nvp("d_A0", d_A0);
|
||||
archive& make_nvp("d_t_OT", d_t_OT);
|
||||
archive& make_nvp("i_WN_T", i_WN_T);
|
||||
archive& make_nvp("d_DeltaT_LS", d_DeltaT_LS);
|
||||
archive& make_nvp("i_WN_LSF", i_WN_LSF);
|
||||
archive& make_nvp("i_DN", i_DN);
|
||||
archive& make_nvp("d_DeltaT_LSF", d_DeltaT_LSF);
|
||||
archive& make_nvp("valid", valid);
|
||||
archive& BOOST_SERIALIZATION_NVP(A1);
|
||||
archive& BOOST_SERIALIZATION_NVP(A0);
|
||||
archive& BOOST_SERIALIZATION_NVP(tot);
|
||||
archive& BOOST_SERIALIZATION_NVP(WN_T);
|
||||
archive& BOOST_SERIALIZATION_NVP(DeltaT_LS);
|
||||
archive& BOOST_SERIALIZATION_NVP(WN_LSF);
|
||||
archive& BOOST_SERIALIZATION_NVP(DN);
|
||||
archive& BOOST_SERIALIZATION_NVP(DeltaT_LSF);
|
||||
archive& BOOST_SERIALIZATION_NVP(valid);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -143,7 +143,7 @@ TEST_F(RinexPrinterTest, GalileoObsHeader)
|
||||
{
|
||||
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, 12, "filename", false, false);
|
||||
auto eph = Galileo_Ephemeris();
|
||||
eph.i_satellite_PRN = 1;
|
||||
eph.PRN = 1;
|
||||
pvt_solution->galileo_ephemeris_map[1] = eph;
|
||||
|
||||
std::map<int, Gnss_Synchro> gnss_observables_map;
|
||||
@ -229,7 +229,7 @@ TEST_F(RinexPrinterTest, GlonassObsHeader)
|
||||
{
|
||||
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, 12, "filename", false, false);
|
||||
auto eph = Glonass_Gnav_Ephemeris();
|
||||
eph.i_satellite_PRN = 1;
|
||||
eph.PRN = 1;
|
||||
pvt_solution->glonass_gnav_ephemeris_map[1] = eph;
|
||||
|
||||
std::map<int, Gnss_Synchro> gnss_observables_map;
|
||||
@ -285,8 +285,8 @@ TEST_F(RinexPrinterTest, MixedObsHeader)
|
||||
bool no_more_finds = false;
|
||||
auto eph_gal = Galileo_Ephemeris();
|
||||
auto eph_gps = Gps_Ephemeris();
|
||||
eph_gal.i_satellite_PRN = 1;
|
||||
eph_gps.i_satellite_PRN = 1;
|
||||
eph_gal.PRN = 1;
|
||||
eph_gps.PRN = 1;
|
||||
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, 12, "filename", false, false);
|
||||
pvt_solution->galileo_ephemeris_map[1] = eph_gal;
|
||||
|
||||
@ -355,8 +355,8 @@ TEST_F(RinexPrinterTest, MixedObsHeaderGpsGlo)
|
||||
bool no_more_finds = false;
|
||||
auto eph_glo = Glonass_Gnav_Ephemeris();
|
||||
auto eph_gps = Gps_Ephemeris();
|
||||
eph_glo.i_satellite_PRN = 1;
|
||||
eph_gps.i_satellite_PRN = 1;
|
||||
eph_glo.PRN = 1;
|
||||
eph_gps.PRN = 1;
|
||||
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, 12, "filename", false, false);
|
||||
pvt_solution->glonass_gnav_ephemeris_map[1] = eph_glo;
|
||||
|
||||
@ -423,7 +423,7 @@ TEST_F(RinexPrinterTest, GalileoObsLog)
|
||||
std::string line_str;
|
||||
bool no_more_finds = false;
|
||||
auto eph = Galileo_Ephemeris();
|
||||
eph.i_satellite_PRN = 1;
|
||||
eph.PRN = 1;
|
||||
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, 12, "filename", false, false);
|
||||
pvt_solution->galileo_ephemeris_map[1] = eph;
|
||||
std::map<int, Gnss_Synchro> gnss_observables_map;
|
||||
@ -503,7 +503,7 @@ TEST_F(RinexPrinterTest, GlonassObsLog)
|
||||
std::string line_str;
|
||||
bool no_more_finds = false;
|
||||
auto eph = Glonass_Gnav_Ephemeris();
|
||||
eph.i_satellite_PRN = 22;
|
||||
eph.PRN = 22;
|
||||
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, 12, "filename", false, false);
|
||||
pvt_solution->glonass_gnav_ephemeris_map[1] = eph;
|
||||
std::map<int, Gnss_Synchro> gnss_observables_map;
|
||||
@ -584,8 +584,8 @@ TEST_F(RinexPrinterTest, GpsObsLogDualBand)
|
||||
bool no_more_finds = false;
|
||||
auto eph = Gps_Ephemeris();
|
||||
auto eph_cnav = Gps_CNAV_Ephemeris();
|
||||
eph.i_satellite_PRN = 1;
|
||||
eph_cnav.i_satellite_PRN = 1;
|
||||
eph.PRN = 1;
|
||||
eph_cnav.PRN = 1;
|
||||
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, 12, "filename", false, false);
|
||||
pvt_solution->gps_ephemeris_map[1] = eph;
|
||||
pvt_solution->gps_cnav_ephemeris_map[1] = eph_cnav;
|
||||
@ -676,7 +676,7 @@ TEST_F(RinexPrinterTest, GalileoObsLogDualBand)
|
||||
{
|
||||
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, 12, "filename", false, false);
|
||||
auto eph = Galileo_Ephemeris();
|
||||
eph.i_satellite_PRN = 1;
|
||||
eph.PRN = 1;
|
||||
pvt_solution->galileo_ephemeris_map[1] = eph;
|
||||
|
||||
std::map<int, Gnss_Synchro> gnss_observables_map;
|
||||
@ -772,8 +772,8 @@ TEST_F(RinexPrinterTest, MixedObsLog)
|
||||
bool no_more_finds = false;
|
||||
auto eph_gps = Gps_Ephemeris();
|
||||
auto eph_gal = Galileo_Ephemeris();
|
||||
eph_gps.i_satellite_PRN = 1;
|
||||
eph_gal.i_satellite_PRN = 1;
|
||||
eph_gps.PRN = 1;
|
||||
eph_gal.PRN = 1;
|
||||
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, 12, "filename", false, false);
|
||||
pvt_solution->gps_ephemeris_map[1] = eph_gps;
|
||||
pvt_solution->galileo_ephemeris_map[1] = eph_gal;
|
||||
@ -896,8 +896,8 @@ TEST_F(RinexPrinterTest, MixedObsLogGpsGlo)
|
||||
bool no_more_finds = false;
|
||||
auto eph_gps = Gps_Ephemeris();
|
||||
auto eph_glo = Glonass_Gnav_Ephemeris();
|
||||
eph_gps.i_satellite_PRN = 1;
|
||||
eph_glo.i_satellite_PRN = 1;
|
||||
eph_gps.PRN = 1;
|
||||
eph_glo.PRN = 1;
|
||||
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, 12, "filename", false, false);
|
||||
pvt_solution->gps_ephemeris_map[1] = eph_gps;
|
||||
pvt_solution->glonass_gnav_ephemeris_map[1] = eph_glo;
|
||||
|
@ -247,16 +247,16 @@ TEST(RtcmTest, MT1019)
|
||||
Gps_Ephemeris gps_eph = Gps_Ephemeris();
|
||||
Gps_Ephemeris gps_eph_read = Gps_Ephemeris();
|
||||
|
||||
gps_eph.i_satellite_PRN = 3;
|
||||
gps_eph.d_IODC = 4;
|
||||
gps_eph.d_e_eccentricity = 2.0 * ECCENTRICITY_LSB;
|
||||
gps_eph.PRN = 3;
|
||||
gps_eph.IODC = 4;
|
||||
gps_eph.ecc = 2.0 * ECCENTRICITY_LSB;
|
||||
gps_eph.b_fit_interval_flag = true;
|
||||
std::string tx_msg = rtcm->print_MT1019(gps_eph);
|
||||
|
||||
EXPECT_EQ(0, rtcm->read_MT1019(tx_msg, gps_eph_read));
|
||||
EXPECT_EQ(static_cast<unsigned int>(3), gps_eph_read.i_satellite_PRN);
|
||||
EXPECT_DOUBLE_EQ(4, gps_eph_read.d_IODC);
|
||||
EXPECT_DOUBLE_EQ(2.0 * ECCENTRICITY_LSB, gps_eph_read.d_e_eccentricity);
|
||||
EXPECT_EQ(static_cast<unsigned int>(3), gps_eph_read.PRN);
|
||||
EXPECT_DOUBLE_EQ(4, gps_eph_read.IODC);
|
||||
EXPECT_DOUBLE_EQ(2.0 * ECCENTRICITY_LSB, gps_eph_read.ecc);
|
||||
EXPECT_EQ(expected_true, gps_eph_read.b_fit_interval_flag);
|
||||
EXPECT_EQ(1, rtcm->read_MT1019(rtcm->bin_to_binary_data(rtcm->hex_to_bin("FFFFFFFFFFF")), gps_eph_read));
|
||||
}
|
||||
@ -322,16 +322,16 @@ TEST(RtcmTest, MT1045)
|
||||
Galileo_Ephemeris gal_eph = Galileo_Ephemeris();
|
||||
Galileo_Ephemeris gal_eph_read = Galileo_Ephemeris();
|
||||
|
||||
gal_eph.i_satellite_PRN = 5;
|
||||
gal_eph.OMEGA_dot_3 = 53.0 * OMEGA_DOT_3_LSB;
|
||||
gal_eph.PRN = 5;
|
||||
gal_eph.OMEGAdot = 53.0 * OMEGA_DOT_3_LSB;
|
||||
gal_eph.E5a_DVS = true;
|
||||
|
||||
std::string tx_msg = rtcm->print_MT1045(gal_eph);
|
||||
|
||||
EXPECT_EQ(0, rtcm->read_MT1045(tx_msg, gal_eph_read));
|
||||
EXPECT_EQ(expected_true, gal_eph_read.E5a_DVS);
|
||||
EXPECT_DOUBLE_EQ(53.0 * OMEGA_DOT_3_LSB, gal_eph_read.OMEGA_dot_3);
|
||||
EXPECT_EQ(static_cast<unsigned int>(5), gal_eph_read.i_satellite_PRN);
|
||||
EXPECT_DOUBLE_EQ(53.0 * OMEGA_DOT_3_LSB, gal_eph_read.OMEGAdot);
|
||||
EXPECT_EQ(static_cast<unsigned int>(5), gal_eph_read.PRN);
|
||||
EXPECT_EQ(1, rtcm->read_MT1045(rtcm->bin_to_binary_data(rtcm->hex_to_bin("FFFFFFFFFFF")), gal_eph_read));
|
||||
}
|
||||
|
||||
@ -402,9 +402,9 @@ TEST(RtcmTest, MSMCell)
|
||||
bool more_messages = false;
|
||||
double obs_time = 25.0;
|
||||
|
||||
gps_eph.i_satellite_PRN = gnss_synchro2.PRN;
|
||||
gal_eph.i_satellite_PRN = gnss_synchro.PRN;
|
||||
// glo_gnav_eph.i_satellite_PRN = gnss_synchro.PRN;
|
||||
gps_eph.PRN = gnss_synchro2.PRN;
|
||||
gal_eph.PRN = gnss_synchro.PRN;
|
||||
// glo_gnav_eph.PRN = gnss_synchro.PRN;
|
||||
|
||||
std::string MSM1 = rtcm->print_MSM_1(gps_eph,
|
||||
{},
|
||||
@ -529,7 +529,7 @@ TEST(RtcmTest, MSM1)
|
||||
bool more_messages = false;
|
||||
double obs_time = 25.0;
|
||||
|
||||
gps_eph.i_satellite_PRN = gnss_synchro.PRN;
|
||||
gps_eph.PRN = gnss_synchro.PRN;
|
||||
|
||||
std::string MSM1 = rtcm->print_MSM_1(gps_eph,
|
||||
{}, {}, {},
|
||||
|
@ -56,8 +56,8 @@ bool FrontEndCal::read_assistance_from_XML()
|
||||
{
|
||||
std::cout << "SUPL: Read XML Ephemeris for GPS SV " << gps_eph_iter->first << '\n';
|
||||
LOG(INFO) << "SUPL: Read XML Ephemeris for GPS SV " << gps_eph_iter->first;
|
||||
LOG(INFO) << "New Ephemeris record inserted with Toe=" << gps_eph_iter->second.d_Toe << " and GPS Week=" << gps_eph_iter->second.i_GPS_week;
|
||||
global_gps_ephemeris_map.write(gps_eph_iter->second.i_satellite_PRN, gps_eph_iter->second);
|
||||
LOG(INFO) << "New Ephemeris record inserted with Toe=" << gps_eph_iter->second.toe << " and GPS Week=" << gps_eph_iter->second.WN;
|
||||
global_gps_ephemeris_map.write(gps_eph_iter->second.PRN, gps_eph_iter->second);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -134,8 +134,8 @@ int FrontEndCal::Get_SUPL_Assist()
|
||||
{
|
||||
LOG(INFO) << "SUPL: Received Ephemeris for GPS SV " << gps_eph_iter->first;
|
||||
std::cout << "SUPL: Received Ephemeris for GPS SV " << gps_eph_iter->first << '\n';
|
||||
LOG(INFO) << "New Ephemeris record inserted with Toe=" << gps_eph_iter->second.d_Toe << " and GPS Week=" << gps_eph_iter->second.i_GPS_week;
|
||||
global_gps_ephemeris_map.write(gps_eph_iter->second.i_satellite_PRN, gps_eph_iter->second);
|
||||
LOG(INFO) << "New Ephemeris record inserted with Toe=" << gps_eph_iter->second.toe << " and GPS Week=" << gps_eph_iter->second.WN;
|
||||
global_gps_ephemeris_map.write(gps_eph_iter->second.PRN, gps_eph_iter->second);
|
||||
}
|
||||
// Save ephemeris to XML file
|
||||
std::string eph_xml_filename = configuration_->property("GNSS-SDR.SUPL_gps_ephemeris_xml", eph_default_xml_filename);
|
||||
@ -200,7 +200,7 @@ int FrontEndCal::Get_SUPL_Assist()
|
||||
LOG(INFO) << "SUPL: Received Acquisition assistance for GPS SV " << gps_acq_iter->first;
|
||||
std::cout << "SUPL: Received Acquisition assistance for GPS SV " << gps_acq_iter->first << '\n';
|
||||
LOG(INFO) << "New acq assist record inserted";
|
||||
global_gps_acq_assist_map.write(gps_acq_iter->second.i_satellite_PRN, gps_acq_iter->second);
|
||||
global_gps_acq_assist_map.write(gps_acq_iter->second.PRN, gps_acq_iter->second);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -323,9 +323,9 @@ double FrontEndCal::estimate_doppler_from_eph(unsigned int PRN, double tow, doub
|
||||
for (int i = 0; i < n_points; i++)
|
||||
{
|
||||
eph_it->second.satellitePosition(obs_time);
|
||||
SV_pos_ecef(0) = eph_it->second.d_satpos_X;
|
||||
SV_pos_ecef(1) = eph_it->second.d_satpos_Y;
|
||||
SV_pos_ecef(2) = eph_it->second.d_satpos_Z;
|
||||
SV_pos_ecef(0) = eph_it->second.satpos_X;
|
||||
SV_pos_ecef(1) = eph_it->second.satpos_Y;
|
||||
SV_pos_ecef(2) = eph_it->second.satpos_Z;
|
||||
// SV distances to observer (true range)
|
||||
ranges(i) = arma::norm(SV_pos_ecef - obs_ecef, 2);
|
||||
obs_time += step_secs;
|
||||
|
@ -495,12 +495,12 @@ int main(int argc, char** argv)
|
||||
{
|
||||
std::map<int, Gps_Ephemeris> Eph_map;
|
||||
Eph_map = global_gps_ephemeris_map.get_map_copy();
|
||||
current_TOW = Eph_map.begin()->second.d_TOW;
|
||||
current_TOW = Eph_map.begin()->second.tow;
|
||||
|
||||
time_t t = utc_time(Eph_map.begin()->second.i_GPS_week, static_cast<int64_t>(current_TOW));
|
||||
time_t t = utc_time(Eph_map.begin()->second.WN, static_cast<int64_t>(current_TOW));
|
||||
|
||||
std::cout << "Reference Time:\n";
|
||||
std::cout << " GPS Week: " << Eph_map.begin()->second.i_GPS_week << '\n';
|
||||
std::cout << " GPS Week: " << Eph_map.begin()->second.WN << '\n';
|
||||
std::cout << " GPS TOW: " << static_cast<int64_t>(current_TOW) << " " << static_cast<int64_t>(current_TOW) * 0.08 << '\n';
|
||||
std::cout << " ~ UTC: " << ctime(&t) << '\n';
|
||||
std::cout << "Current TOW obtained from SUPL assistance = " << current_TOW << '\n';
|
||||
|
@ -174,47 +174,47 @@ int main(int argc, char** argv)
|
||||
if (hdr.fileSys == "G: (GPS)" || hdr.fileSys == "MIXED")
|
||||
{
|
||||
gps_utc_model.valid = (hdr.valid > 2147483648) ? true : false;
|
||||
gps_utc_model.d_A1 = hdr.mapTimeCorr["GPUT"].A0;
|
||||
gps_utc_model.d_A0 = hdr.mapTimeCorr["GPUT"].A1;
|
||||
gps_utc_model.d_t_OT = hdr.mapTimeCorr["GPUT"].refSOW;
|
||||
gps_utc_model.i_WN_T = hdr.mapTimeCorr["GPUT"].refWeek;
|
||||
gps_utc_model.d_DeltaT_LS = hdr.leapSeconds;
|
||||
gps_utc_model.i_WN_LSF = hdr.leapWeek;
|
||||
gps_utc_model.i_DN = hdr.leapDay;
|
||||
gps_utc_model.d_DeltaT_LSF = hdr.leapDelta;
|
||||
gps_utc_model.A1 = hdr.mapTimeCorr["GPUT"].A0;
|
||||
gps_utc_model.A0 = hdr.mapTimeCorr["GPUT"].A1;
|
||||
gps_utc_model.tot = hdr.mapTimeCorr["GPUT"].refSOW;
|
||||
gps_utc_model.WN_T = hdr.mapTimeCorr["GPUT"].refWeek;
|
||||
gps_utc_model.DeltaT_LS = hdr.leapSeconds;
|
||||
gps_utc_model.WN_LSF = hdr.leapWeek;
|
||||
gps_utc_model.DN = hdr.leapDay;
|
||||
gps_utc_model.DeltaT_LSF = hdr.leapDelta;
|
||||
|
||||
// Collect iono parameters from RINEX header
|
||||
gps_iono.valid = (hdr.mapIonoCorr["GPSA"].param[0] == 0) ? false : true;
|
||||
gps_iono.d_alpha0 = hdr.mapIonoCorr["GPSA"].param[0];
|
||||
gps_iono.d_alpha1 = hdr.mapIonoCorr["GPSA"].param[1];
|
||||
gps_iono.d_alpha2 = hdr.mapIonoCorr["GPSA"].param[2];
|
||||
gps_iono.d_alpha3 = hdr.mapIonoCorr["GPSA"].param[3];
|
||||
gps_iono.d_beta0 = hdr.mapIonoCorr["GPSB"].param[0];
|
||||
gps_iono.d_beta1 = hdr.mapIonoCorr["GPSB"].param[1];
|
||||
gps_iono.d_beta2 = hdr.mapIonoCorr["GPSB"].param[2];
|
||||
gps_iono.d_beta3 = hdr.mapIonoCorr["GPSB"].param[3];
|
||||
gps_iono.alpha0 = hdr.mapIonoCorr["GPSA"].param[0];
|
||||
gps_iono.alpha1 = hdr.mapIonoCorr["GPSA"].param[1];
|
||||
gps_iono.alpha2 = hdr.mapIonoCorr["GPSA"].param[2];
|
||||
gps_iono.alpha3 = hdr.mapIonoCorr["GPSA"].param[3];
|
||||
gps_iono.beta0 = hdr.mapIonoCorr["GPSB"].param[0];
|
||||
gps_iono.beta1 = hdr.mapIonoCorr["GPSB"].param[1];
|
||||
gps_iono.beta2 = hdr.mapIonoCorr["GPSB"].param[2];
|
||||
gps_iono.beta3 = hdr.mapIonoCorr["GPSB"].param[3];
|
||||
}
|
||||
if (hdr.fileSys == "E: (GAL)" || hdr.fileSys == "MIXED")
|
||||
{
|
||||
gal_utc_model.A0_6 = hdr.mapTimeCorr["GAUT"].A0;
|
||||
gal_utc_model.A1_6 = hdr.mapTimeCorr["GAUT"].A1;
|
||||
gal_utc_model.Delta_tLS_6 = hdr.leapSeconds;
|
||||
gal_utc_model.t0t_6 = hdr.mapTimeCorr["GAUT"].refSOW;
|
||||
gal_utc_model.WNot_6 = hdr.mapTimeCorr["GAUT"].refWeek;
|
||||
gal_utc_model.WN_LSF_6 = hdr.leapWeek;
|
||||
gal_utc_model.DN_6 = hdr.leapDay;
|
||||
gal_utc_model.Delta_tLSF_6 = hdr.leapDelta;
|
||||
gal_utc_model.A0 = hdr.mapTimeCorr["GAUT"].A0;
|
||||
gal_utc_model.A1 = hdr.mapTimeCorr["GAUT"].A1;
|
||||
gal_utc_model.Delta_tLS = hdr.leapSeconds;
|
||||
gal_utc_model.tot = hdr.mapTimeCorr["GAUT"].refSOW;
|
||||
gal_utc_model.WNot = hdr.mapTimeCorr["GAUT"].refWeek;
|
||||
gal_utc_model.WN_LSF = hdr.leapWeek;
|
||||
gal_utc_model.DN = hdr.leapDay;
|
||||
gal_utc_model.Delta_tLSF = hdr.leapDelta;
|
||||
gal_utc_model.flag_utc_model = (hdr.mapTimeCorr["GAUT"].A0 == 0.0);
|
||||
gal_iono.ai0_5 = hdr.mapIonoCorr["GAL"].param[0];
|
||||
gal_iono.ai1_5 = hdr.mapIonoCorr["GAL"].param[1];
|
||||
gal_iono.ai2_5 = hdr.mapIonoCorr["GAL"].param[2];
|
||||
gal_iono.Region1_flag_5 = false;
|
||||
gal_iono.Region2_flag_5 = false;
|
||||
gal_iono.Region3_flag_5 = false;
|
||||
gal_iono.Region4_flag_5 = false;
|
||||
gal_iono.Region5_flag_5 = false;
|
||||
gal_iono.TOW_5 = 0.0;
|
||||
gal_iono.WN_5 = 0.0;
|
||||
gal_iono.ai0 = hdr.mapIonoCorr["GAL"].param[0];
|
||||
gal_iono.ai1 = hdr.mapIonoCorr["GAL"].param[1];
|
||||
gal_iono.ai2 = hdr.mapIonoCorr["GAL"].param[2];
|
||||
gal_iono.Region1_flag = false;
|
||||
gal_iono.Region2_flag = false;
|
||||
gal_iono.Region3_flag = false;
|
||||
gal_iono.Region4_flag = false;
|
||||
gal_iono.Region5_flag = false;
|
||||
gal_iono.tow = 0.0;
|
||||
gal_iono.WN = 0.0;
|
||||
}
|
||||
|
||||
// Read navigation data
|
||||
@ -224,41 +224,41 @@ int main(int argc, char** argv)
|
||||
{
|
||||
// Fill GPS ephemeris object
|
||||
Gps_Ephemeris eph;
|
||||
eph.i_satellite_PRN = rne.PRNID;
|
||||
eph.d_TOW = rne.xmitTime;
|
||||
eph.d_IODE_SF2 = rne.IODE;
|
||||
eph.d_IODE_SF3 = rne.IODE;
|
||||
eph.d_Crs = rne.Crs;
|
||||
eph.d_Delta_n = rne.dn;
|
||||
eph.d_M_0 = rne.M0;
|
||||
eph.d_Cuc = rne.Cuc;
|
||||
eph.d_e_eccentricity = rne.ecc;
|
||||
eph.d_Cus = rne.Cus;
|
||||
eph.d_sqrt_A = rne.Ahalf;
|
||||
eph.d_Toe = rne.Toe;
|
||||
eph.d_Toc = rne.Toc;
|
||||
eph.d_Cic = rne.Cic;
|
||||
eph.d_OMEGA0 = rne.OMEGA0;
|
||||
eph.d_Cis = rne.Cis;
|
||||
eph.d_i_0 = rne.i0;
|
||||
eph.d_Crc = rne.Crc;
|
||||
eph.d_OMEGA = rne.w;
|
||||
eph.d_OMEGA_DOT = rne.OMEGAdot;
|
||||
eph.d_IDOT = rne.idot;
|
||||
eph.i_code_on_L2 = rne.codeflgs; //
|
||||
eph.i_GPS_week = rne.weeknum;
|
||||
eph.b_L2_P_data_flag = rne.L2Pdata;
|
||||
eph.i_SV_accuracy = rne.accuracy;
|
||||
eph.i_SV_health = rne.health;
|
||||
eph.d_TGD = rne.Tgd;
|
||||
eph.d_IODC = rne.IODC;
|
||||
eph.i_AODO = 0; //
|
||||
eph.PRN = rne.PRNID;
|
||||
eph.tow = rne.xmitTime;
|
||||
eph.IODE_SF2 = rne.IODE;
|
||||
eph.IODE_SF3 = rne.IODE;
|
||||
eph.Crs = rne.Crs;
|
||||
eph.delta_n = rne.dn;
|
||||
eph.M_0 = rne.M0;
|
||||
eph.Cuc = rne.Cuc;
|
||||
eph.ecc = rne.ecc;
|
||||
eph.Cus = rne.Cus;
|
||||
eph.sqrtA = rne.Ahalf;
|
||||
eph.toe = rne.Toe;
|
||||
eph.toc = rne.Toc;
|
||||
eph.Cic = rne.Cic;
|
||||
eph.OMEGA_0 = rne.OMEGA0;
|
||||
eph.Cis = rne.Cis;
|
||||
eph.i_0 = rne.i0;
|
||||
eph.Crc = rne.Crc;
|
||||
eph.omega = rne.w;
|
||||
eph.OMEGAdot = rne.OMEGAdot;
|
||||
eph.idot = rne.idot;
|
||||
eph.code_on_L2 = rne.codeflgs; //
|
||||
eph.WN = rne.weeknum;
|
||||
eph.L2_P_data_flag = rne.L2Pdata;
|
||||
eph.SV_accuracy = rne.accuracy;
|
||||
eph.SV_health = rne.health;
|
||||
eph.TGD = rne.Tgd;
|
||||
eph.IODC = rne.IODC;
|
||||
eph.AODO = 0; //
|
||||
eph.b_fit_interval_flag = (rne.fitint > 4) ? true : false;
|
||||
eph.d_spare1 = 0.0;
|
||||
eph.d_spare2 = 0.0;
|
||||
eph.d_A_f0 = rne.af0;
|
||||
eph.d_A_f1 = rne.af1;
|
||||
eph.d_A_f2 = rne.af2;
|
||||
eph.af0 = rne.af0;
|
||||
eph.af1 = rne.af1;
|
||||
eph.af2 = rne.af2;
|
||||
eph.b_integrity_status_flag = false; //
|
||||
eph.b_alert_flag = false; //
|
||||
eph.b_antispoofing_flag = false; //
|
||||
@ -269,28 +269,28 @@ int main(int argc, char** argv)
|
||||
{
|
||||
// Fill Galileo ephemeris object
|
||||
Galileo_Ephemeris eph;
|
||||
eph.i_satellite_PRN = rne.PRNID;
|
||||
eph.M0_1 = rne.M0;
|
||||
eph.e_1 = rne.ecc;
|
||||
eph.A_1 = rne.Ahalf;
|
||||
eph.OMEGA_0_2 = rne.OMEGA0;
|
||||
eph.i_0_2 = rne.i0;
|
||||
eph.omega_2 = rne.w;
|
||||
eph.OMEGA_dot_3 = rne.OMEGAdot;
|
||||
eph.delta_n_3 = rne.dn;
|
||||
eph.iDot_2 = rne.idot;
|
||||
eph.C_uc_3 = rne.Cuc;
|
||||
eph.C_us_3 = rne.Cus;
|
||||
eph.C_rc_3 = rne.Crc;
|
||||
eph.C_rs_3 = rne.Crs;
|
||||
eph.C_ic_4 = rne.Cic;
|
||||
eph.C_is_4 = rne.Cis;
|
||||
eph.t0e_1 = rne.Toe;
|
||||
eph.t0c_4 = rne.Toc;
|
||||
eph.af0_4 = rne.af0;
|
||||
eph.af1_4 = rne.af1;
|
||||
eph.af2_4 = rne.af2;
|
||||
eph.WN_5 = rne.weeknum;
|
||||
eph.PRN = rne.PRNID;
|
||||
eph.M_0 = rne.M0;
|
||||
eph.ecc = rne.ecc;
|
||||
eph.sqrtA = rne.Ahalf;
|
||||
eph.OMEGA_0 = rne.OMEGA0;
|
||||
eph.i_0 = rne.i0;
|
||||
eph.omega = rne.w;
|
||||
eph.OMEGAdot = rne.OMEGAdot;
|
||||
eph.delta_n = rne.dn;
|
||||
eph.idot = rne.idot;
|
||||
eph.Cuc = rne.Cuc;
|
||||
eph.Cus = rne.Cus;
|
||||
eph.Crc = rne.Crc;
|
||||
eph.Crs = rne.Crs;
|
||||
eph.Cic = rne.Cic;
|
||||
eph.Cis = rne.Cis;
|
||||
eph.toe = rne.Toe;
|
||||
eph.toc = rne.Toc;
|
||||
eph.af0 = rne.af0;
|
||||
eph.af1 = rne.af1;
|
||||
eph.af2 = rne.af2;
|
||||
eph.WN = rne.weeknum;
|
||||
eph_gal_map[j] = eph;
|
||||
j++;
|
||||
}
|
||||
@ -392,7 +392,7 @@ int main(int argc, char** argv)
|
||||
std::cout << "Generated file: " << xml_filename << '\n';
|
||||
}
|
||||
|
||||
if (gal_utc_model.A0_6 != 0)
|
||||
if (gal_utc_model.A0 != 0)
|
||||
{
|
||||
std::ofstream ofs5;
|
||||
xml_filename = "gal_utc_model.xml";
|
||||
@ -410,7 +410,7 @@ int main(int argc, char** argv)
|
||||
}
|
||||
std::cout << "Generated file: " << xml_filename << '\n';
|
||||
}
|
||||
if (gal_iono.ai0_5 != 0)
|
||||
if (gal_iono.ai0 != 0)
|
||||
{
|
||||
std::ofstream ofs7;
|
||||
xml_filename = "gal_iono.xml";
|
||||
|
Loading…
Reference in New Issue
Block a user