|
|
|
@@ -1,5 +1,5 @@
|
|
|
|
|
/*!
|
|
|
|
|
* \file galileo_navigation_message.cc
|
|
|
|
|
* \file galileo_inav_message.cc
|
|
|
|
|
* \brief Implementation of a Galileo I/NAV Data message
|
|
|
|
|
* as described in Galileo OS SIS ICD Issue 1.1 (Sept. 2010)
|
|
|
|
|
* \author Mara Branzanti 2013. mara.branzanti(at)gmail.com
|
|
|
|
@@ -19,7 +19,7 @@
|
|
|
|
|
* -----------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "galileo_navigation_message.h"
|
|
|
|
|
#include "galileo_inav_message.h"
|
|
|
|
|
#include <boost/crc.hpp> // for boost::crc_basic, boost::crc_optimal
|
|
|
|
|
#include <boost/dynamic_bitset.hpp> // for boost::dynamic_bitset
|
|
|
|
|
#include <glog/logging.h> // for DLOG
|
|
|
|
@@ -31,7 +31,7 @@
|
|
|
|
|
using CRC_Galileo_INAV_type = boost::crc_optimal<24, 0x1864CFBU, 0x0, 0x0, false, false>;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool Galileo_Navigation_Message::CRC_test(std::bitset<GALILEO_DATA_FRAME_BITS> bits, uint32_t checksum) const
|
|
|
|
|
bool Galileo_Inav_Message::CRC_test(std::bitset<GALILEO_DATA_FRAME_BITS> bits, uint32_t checksum) const
|
|
|
|
|
{
|
|
|
|
|
CRC_Galileo_INAV_type CRC_Galileo;
|
|
|
|
|
|
|
|
|
@@ -58,7 +58,7 @@ bool Galileo_Navigation_Message::CRC_test(std::bitset<GALILEO_DATA_FRAME_BITS> b
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uint64_t Galileo_Navigation_Message::read_navigation_unsigned(std::bitset<GALILEO_DATA_JK_BITS> bits, const std::vector<std::pair<int32_t, int32_t> >& parameter) const
|
|
|
|
|
uint64_t Galileo_Inav_Message::read_navigation_unsigned(std::bitset<GALILEO_DATA_JK_BITS> bits, const std::vector<std::pair<int32_t, int32_t> >& parameter) const
|
|
|
|
|
{
|
|
|
|
|
uint64_t value = 0ULL;
|
|
|
|
|
const int32_t num_of_slices = parameter.size();
|
|
|
|
@@ -77,7 +77,7 @@ uint64_t Galileo_Navigation_Message::read_navigation_unsigned(std::bitset<GALILE
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uint64_t Galileo_Navigation_Message::read_page_type_unsigned(std::bitset<GALILEO_PAGE_TYPE_BITS> bits, const std::vector<std::pair<int32_t, int32_t> >& parameter) const
|
|
|
|
|
uint64_t Galileo_Inav_Message::read_page_type_unsigned(std::bitset<GALILEO_PAGE_TYPE_BITS> bits, const std::vector<std::pair<int32_t, int32_t> >& parameter) const
|
|
|
|
|
{
|
|
|
|
|
uint64_t value = 0ULL;
|
|
|
|
|
const int32_t num_of_slices = parameter.size();
|
|
|
|
@@ -96,7 +96,7 @@ uint64_t Galileo_Navigation_Message::read_page_type_unsigned(std::bitset<GALILEO
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int64_t Galileo_Navigation_Message::read_navigation_signed(std::bitset<GALILEO_DATA_JK_BITS> bits, const std::vector<std::pair<int32_t, int32_t> >& parameter) const
|
|
|
|
|
int64_t Galileo_Inav_Message::read_navigation_signed(std::bitset<GALILEO_DATA_JK_BITS> bits, const std::vector<std::pair<int32_t, int32_t> >& parameter) const
|
|
|
|
|
{
|
|
|
|
|
int64_t value = 0LL;
|
|
|
|
|
const int32_t num_of_slices = parameter.size();
|
|
|
|
@@ -127,7 +127,7 @@ int64_t Galileo_Navigation_Message::read_navigation_signed(std::bitset<GALILEO_D
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool Galileo_Navigation_Message::read_navigation_bool(std::bitset<GALILEO_DATA_JK_BITS> bits, const std::vector<std::pair<int32_t, int32_t> >& parameter) const
|
|
|
|
|
bool Galileo_Inav_Message::read_navigation_bool(std::bitset<GALILEO_DATA_JK_BITS> bits, const std::vector<std::pair<int32_t, int32_t> >& parameter) const
|
|
|
|
|
{
|
|
|
|
|
bool value;
|
|
|
|
|
if (static_cast<int>(static_cast<int>(bits[GALILEO_DATA_JK_BITS - parameter[0].first])) == 1)
|
|
|
|
@@ -142,7 +142,7 @@ bool Galileo_Navigation_Message::read_navigation_bool(std::bitset<GALILEO_DATA_J
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Galileo_Navigation_Message::split_page(std::string page_string, int32_t flag_even_word)
|
|
|
|
|
void Galileo_Inav_Message::split_page(std::string page_string, int32_t flag_even_word)
|
|
|
|
|
{
|
|
|
|
|
int32_t Page_type = 0;
|
|
|
|
|
|
|
|
|
@@ -202,7 +202,7 @@ void Galileo_Navigation_Message::split_page(std::string page_string, int32_t fla
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool Galileo_Navigation_Message::have_new_ephemeris() // Check if we have a new ephemeris stored in the galileo navigation class
|
|
|
|
|
bool Galileo_Inav_Message::have_new_ephemeris() // Check if we have a new ephemeris stored in the galileo navigation class
|
|
|
|
|
{
|
|
|
|
|
if ((flag_ephemeris_1 == true) and (flag_ephemeris_2 == true) and (flag_ephemeris_3 == true) and (flag_ephemeris_4 == true) and (flag_iono_and_GST == true))
|
|
|
|
|
{
|
|
|
|
@@ -224,7 +224,7 @@ bool Galileo_Navigation_Message::have_new_ephemeris() // Check if we have a new
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool Galileo_Navigation_Message::have_new_iono_and_GST() // Check if we have a new iono data set stored in the galileo navigation class
|
|
|
|
|
bool Galileo_Inav_Message::have_new_iono_and_GST() // Check if we have a new iono data set stored in the galileo navigation class
|
|
|
|
|
{
|
|
|
|
|
if ((flag_iono_and_GST == true) and (flag_utc_model == true)) // the condition on flag_utc_model is added to have a time stamp for iono
|
|
|
|
|
{
|
|
|
|
@@ -236,7 +236,7 @@ bool Galileo_Navigation_Message::have_new_iono_and_GST() // Check if we have a
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool Galileo_Navigation_Message::have_new_utc_model() // Check if we have a new utc data set stored in the galileo navigation class
|
|
|
|
|
bool Galileo_Inav_Message::have_new_utc_model() // Check if we have a new utc data set stored in the galileo navigation class
|
|
|
|
|
{
|
|
|
|
|
if (flag_utc_model == true)
|
|
|
|
|
{
|
|
|
|
@@ -248,7 +248,7 @@ bool Galileo_Navigation_Message::have_new_utc_model() // Check if we have a new
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool Galileo_Navigation_Message::have_new_almanac() // Check if we have a new almanac data set stored in the galileo navigation class
|
|
|
|
|
bool Galileo_Inav_Message::have_new_almanac() // Check if we have a new almanac data set stored in the galileo navigation class
|
|
|
|
|
{
|
|
|
|
|
if ((flag_almanac_1 == true) and (flag_almanac_2 == true) and (flag_almanac_3 == true) and (flag_almanac_4 == true))
|
|
|
|
|
{
|
|
|
|
@@ -265,7 +265,7 @@ bool Galileo_Navigation_Message::have_new_almanac() // Check if we have a new a
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Galileo_Ephemeris Galileo_Navigation_Message::get_ephemeris() const
|
|
|
|
|
Galileo_Ephemeris Galileo_Inav_Message::get_ephemeris() const
|
|
|
|
|
{
|
|
|
|
|
Galileo_Ephemeris ephemeris;
|
|
|
|
|
ephemeris.flag_all_ephemeris = flag_all_ephemeris;
|
|
|
|
@@ -314,7 +314,7 @@ Galileo_Ephemeris Galileo_Navigation_Message::get_ephemeris() const
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Galileo_Iono Galileo_Navigation_Message::get_iono() const
|
|
|
|
|
Galileo_Iono Galileo_Inav_Message::get_iono() const
|
|
|
|
|
{
|
|
|
|
|
Galileo_Iono iono;
|
|
|
|
|
// Ionospheric correction
|
|
|
|
@@ -338,7 +338,7 @@ Galileo_Iono Galileo_Navigation_Message::get_iono() const
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Galileo_Utc_Model Galileo_Navigation_Message::get_utc_model() const
|
|
|
|
|
Galileo_Utc_Model Galileo_Inav_Message::get_utc_model() const
|
|
|
|
|
{
|
|
|
|
|
Galileo_Utc_Model utc_model;
|
|
|
|
|
// Word type 6: GST-UTC conversion parameters
|
|
|
|
@@ -360,7 +360,7 @@ Galileo_Utc_Model Galileo_Navigation_Message::get_utc_model() const
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Galileo_Almanac_Helper Galileo_Navigation_Message::get_almanac() const
|
|
|
|
|
Galileo_Almanac_Helper Galileo_Inav_Message::get_almanac() const
|
|
|
|
|
{
|
|
|
|
|
Galileo_Almanac_Helper almanac;
|
|
|
|
|
// Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number
|
|
|
|
@@ -419,7 +419,7 @@ Galileo_Almanac_Helper Galileo_Navigation_Message::get_almanac() const
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int32_t Galileo_Navigation_Message::page_jk_decoder(const char* data_jk)
|
|
|
|
|
int32_t Galileo_Inav_Message::page_jk_decoder(const char* data_jk)
|
|
|
|
|
{
|
|
|
|
|
const std::string data_jk_string = data_jk;
|
|
|
|
|
const std::bitset<GALILEO_DATA_JK_BITS> data_jk_bits(data_jk_string);
|