mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-10-31 23:33:03 +00:00
Consider CI/CD comments (x2)
This commit is contained in:
@@ -24,7 +24,7 @@ bool OSNMA_NavData::add_nav_data(std::string nav_data)
|
||||
if (nav_data.size() == 549)
|
||||
{
|
||||
d_ephemeris_iono = nav_data;
|
||||
std::bitset<10> bits(nav_data.substr(0,10));
|
||||
std::bitset<10> bits(nav_data.substr(0, 10));
|
||||
IOD_nav = static_cast<uint8_t>(bits.to_ulong());
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -127,9 +127,7 @@ public:
|
||||
class OSNMA_NavData
|
||||
{
|
||||
public:
|
||||
OSNMA_NavData(): nav_data_id(id_counter++){
|
||||
|
||||
}
|
||||
OSNMA_NavData(): nav_data_id(id_counter++){}
|
||||
bool have_this_bits(std::string nav_data);
|
||||
bool add_nav_data(std::string nav_data);
|
||||
void update_last_received_timestamp(uint32_t TOW);
|
||||
@@ -141,6 +139,8 @@ public:
|
||||
uint32_t IOD_nav{0};
|
||||
std::string get_utc_data() const;
|
||||
std::string get_ephemeris_data() const;
|
||||
void set_ephemeris_data(std::string value) {d_ephemeris_iono = value;}
|
||||
void set_utc_data(std::string value) {d_utc = value;}
|
||||
bool verified{false};
|
||||
uint32_t PRNd{0};
|
||||
uint32_t ADKD{};
|
||||
|
||||
@@ -1,10 +1,23 @@
|
||||
//
|
||||
// Created by cgm on 23/07/24.
|
||||
//
|
||||
/*!
|
||||
* \file osnma_nav_data_manager.cc
|
||||
* \brief Class for Galileo OSNMA navigation data management
|
||||
* \author Cesare Ghionoiu-Martinez, 2020-2023 cesare.martinez(at)proton.me
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2023 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "osnma_nav_data_manager.h"
|
||||
#if USE_GLOG_AND_GFLAGS
|
||||
#include <glog/logging.h> // for DLOG
|
||||
#include <vector>
|
||||
#else
|
||||
#include <absl/log/log.h>
|
||||
#endif
|
||||
@@ -18,7 +31,7 @@
|
||||
*/
|
||||
void OSNMA_nav_data_Manager::add_navigation_data(std::string nav_bits, uint32_t PRNd, uint32_t TOW)
|
||||
{
|
||||
if(not have_nav_data(nav_bits, PRNd, TOW))
|
||||
if (not have_nav_data(nav_bits, PRNd, TOW))
|
||||
{
|
||||
_satellite_nav_data[PRNd][TOW].add_nav_data(nav_bits);
|
||||
_satellite_nav_data[PRNd][TOW].PRNd = PRNd;
|
||||
@@ -36,16 +49,16 @@ void OSNMA_nav_data_Manager::update_nav_data(const std::multimap<uint32_t, Tag>&
|
||||
// if tag status is verified, look for corresponding OSNMA_NavData and add increase verified tag bits.
|
||||
if (tag.second.status == Tag::e_verification_status::SUCCESS)
|
||||
{
|
||||
if(have_PRNd_nav_data(tag.second.PRN_d))
|
||||
if (have_PRNd_nav_data(tag.second.PRN_d))
|
||||
{
|
||||
std::map<uint32_t, OSNMA_NavData> tow_map = _satellite_nav_data.find(tag.second.PRN_d)->second;
|
||||
for (auto tow_it = tow_map.begin(); tow_it != tow_map.end(); ++tow_it) // note: starts with smallest (i.e. oldest) navigation dataset
|
||||
for (auto tow_it = tow_map.begin(); tow_it != tow_map.end(); ++tow_it) // note: starts with smallest (i.e. oldest) navigation dataset
|
||||
{
|
||||
std::string nav_data;
|
||||
if(tag.second.ADKD == 0 || tag.second.ADKD == 12){
|
||||
if (tag.second.ADKD == 0 || tag.second.ADKD == 12){
|
||||
nav_data = tow_it->second.get_ephemeris_data();
|
||||
}
|
||||
else if(tag.second.ADKD == 4){
|
||||
else if (tag.second.ADKD == 4){
|
||||
nav_data = tow_it->second.get_utc_data();
|
||||
}
|
||||
// find associated OSNMA_NavData
|
||||
@@ -120,20 +133,20 @@ std::string OSNMA_nav_data_Manager::get_navigation_data(const Tag& tag)
|
||||
|
||||
// satellite was found, check if TOW exists in inner map
|
||||
std::map<uint32_t, OSNMA_NavData> tow_map = prn_it->second;
|
||||
for (auto tow_it = tow_map.begin(); tow_it != tow_map.end(); ++tow_it) // note: starts with smallest (i.e. oldest) navigation dataset
|
||||
for (auto tow_it = tow_map.begin(); tow_it != tow_map.end(); ++tow_it) // note: starts with smallest (i.e. oldest) navigation dataset
|
||||
{
|
||||
// Check if current key (TOW) fulfills condition
|
||||
if ((tag.TOW - 30 * tag.cop) <= tow_it->first && tow_it->first <= tag.TOW - 30)
|
||||
{
|
||||
if(tag.ADKD == 0 || tag.ADKD == 12)
|
||||
if (tag.ADKD == 0 || tag.ADKD == 12)
|
||||
{
|
||||
if(tow_it->second.get_ephemeris_data() != ""){
|
||||
if (tow_it->second.get_ephemeris_data() != ""){
|
||||
return tow_it->second.get_ephemeris_data();
|
||||
}
|
||||
}
|
||||
else if(tag.ADKD == 4)
|
||||
{
|
||||
if(tow_it->second.get_utc_data() != ""){
|
||||
if (tow_it->second.get_utc_data() != ""){
|
||||
return tow_it->second.get_utc_data();
|
||||
}
|
||||
}
|
||||
@@ -150,17 +163,17 @@ std::string OSNMA_nav_data_Manager::get_navigation_data(const Tag& tag)
|
||||
*/
|
||||
bool OSNMA_nav_data_Manager::have_nav_data(std::string nav_bits, uint32_t PRNd, uint32_t TOW)
|
||||
{
|
||||
if(_satellite_nav_data.find(PRNd) != _satellite_nav_data.end()){
|
||||
if (_satellite_nav_data.find(PRNd) != _satellite_nav_data.end()){
|
||||
for (auto& data_timestamp : _satellite_nav_data[PRNd])
|
||||
{
|
||||
if(nav_bits.size() == EPH_SIZE){
|
||||
if(data_timestamp.second.get_ephemeris_data() == nav_bits){
|
||||
if (nav_bits.size() == EPH_SIZE){
|
||||
if (data_timestamp.second.get_ephemeris_data() == nav_bits){
|
||||
data_timestamp.second.update_last_received_timestamp(TOW);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if(nav_bits.size() == UTC_SIZE){
|
||||
if(data_timestamp.second.get_utc_data() == nav_bits){
|
||||
else if (nav_bits.size() == UTC_SIZE){
|
||||
if (data_timestamp.second.get_utc_data() == nav_bits){
|
||||
data_timestamp.second.update_last_received_timestamp(TOW);
|
||||
return true;
|
||||
}
|
||||
@@ -182,24 +195,23 @@ bool OSNMA_nav_data_Manager::have_nav_data(const Tag& t) const
|
||||
}
|
||||
// satellite was found, check if TOW exists in inner map
|
||||
std::map<uint32_t, OSNMA_NavData> tow_map = prn_it->second;
|
||||
for (auto tow_it = tow_map.begin(); tow_it != tow_map.end(); ++tow_it) // note: starts with smallest (i.e. oldest) navigation dataset
|
||||
for (auto tow_it = tow_map.begin(); tow_it != tow_map.end(); ++tow_it) // note: starts with smallest (i.e. oldest) navigation dataset
|
||||
{
|
||||
// Check if current key (TOW) fulfills condition
|
||||
if (t.TOW - 30 * t.cop <= tow_it->first && tow_it->first <= t.TOW - 30)
|
||||
{
|
||||
if(t.ADKD == 0 || t.ADKD == 12)
|
||||
if (t.ADKD == 0 || t.ADKD == 12)
|
||||
{
|
||||
if(tow_it->second.get_ephemeris_data() != ""){
|
||||
if (tow_it->second.get_ephemeris_data() != ""){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if(t.ADKD == 4)
|
||||
else if (t.ADKD == 4)
|
||||
{
|
||||
if(tow_it->second.get_utc_data() != ""){
|
||||
if (tow_it->second.get_utc_data() != ""){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -1,13 +1,26 @@
|
||||
//
|
||||
// Created by cgm on 23/07/24.
|
||||
//
|
||||
/*!
|
||||
* \file osnma_nav_data_manager.h
|
||||
* \brief Class for Galileo OSNMA navigation data management
|
||||
* \author Cesare Ghionoiu-Martinez, 2020-2023 cesare.martinez(at)proton.me
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2023 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef GNSS_SDR_OSNMA_NAV_DATA_MANAGER_H
|
||||
#define GNSS_SDR_OSNMA_NAV_DATA_MANAGER_H
|
||||
|
||||
#include "osnma_data.h" // NavData
|
||||
#include <cstdint> // uint32_t
|
||||
#include "osnma_data.h" // NavData
|
||||
#include <cstdint> // uint32_t
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
/**
|
||||
@@ -22,7 +35,7 @@ public:
|
||||
bool have_nav_data(std::string nav_bits, uint32_t PRNd, uint32_t TOW);
|
||||
bool have_nav_data(uint32_t PRNd, uint32_t TOW, uint8_t ADKD);
|
||||
bool have_nav_data(const Tag& t) const;
|
||||
void add_navigation_data(std::string nav_bits, uint32_t PRNd, uint32_t TOW); // gets the bits and adds them to the list
|
||||
void add_navigation_data(std::string nav_bits, uint32_t PRNd, uint32_t TOW); // gets the bits and adds them to the list
|
||||
std::string get_navigation_data(const Tag& t);
|
||||
|
||||
void update_nav_data(const std::multimap<uint32_t, Tag>& tags_verified, const uint8_t tag_size);
|
||||
@@ -31,11 +44,10 @@ public:
|
||||
private:
|
||||
bool have_PRNd_nav_data(uint32_t PRNd);
|
||||
|
||||
std::map<uint32_t, std::map<uint32_t, OSNMA_NavData>> _satellite_nav_data{}; // NavData sorted by [PRNd][TOW_start]
|
||||
std::map<uint32_t, std::map<uint32_t, OSNMA_NavData>> _satellite_nav_data{}; // NavData sorted by [PRNd][TOW_start]
|
||||
const uint32_t L_t_min{40};
|
||||
const uint16_t EPH_SIZE{549};
|
||||
const uint16_t UTC_SIZE{141};
|
||||
const uint16_t MAX_ALLOWED_SIZE{150}; // arbitrary maximum for the navigation data container
|
||||
|
||||
const uint16_t MAX_ALLOWED_SIZE{150}; // arbitrary maximum for the navigation data container
|
||||
};
|
||||
#endif // GNSS_SDR_OSNMA_NAV_DATA_MANAGER_H
|
||||
|
||||
Reference in New Issue
Block a user