mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-07 07:50:32 +00:00
Add work on ISM
This commit is contained in:
parent
4c8cde1ec7
commit
557a7f7265
@ -184,7 +184,7 @@ bool Galileo_ISM::check_ism_crc(const std::bitset<GALILEO_DATA_JK_BITS>& bits) c
|
||||
boost::to_block_range(frame_bits, std::back_inserter(bytes));
|
||||
std::reverse(bytes.begin(), bytes.end());
|
||||
|
||||
boost::crc_32_type crc32_ism;
|
||||
boost::crc_optimal<32, 0xC0A0A0D5, 0xFFFFFFFF, 0xFFFFFFFF, true, true> crc32_ism;
|
||||
crc32_ism.process_bytes(bytes.data(), GALILEO_ISM_CRC_DATA_BYTES);
|
||||
const uint32_t crc_computed = crc32_ism.checksum();
|
||||
if (this->ism_crc == crc_computed)
|
||||
@ -193,4 +193,36 @@ bool Galileo_ISM::check_ism_crc(const std::bitset<GALILEO_DATA_JK_BITS>& bits) c
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool Galileo_ISM::ism_apply_to_sat(uint32_t prn) const
|
||||
{
|
||||
if (prn == 0 || prn > 63)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
std::bitset<32> bs(this->ism_mask);
|
||||
if (this->ism_mask_msb == 0)
|
||||
{
|
||||
if (prn <= 32)
|
||||
{
|
||||
return bs[prn - 1];
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (prn > 32)
|
||||
{
|
||||
return bs[prn - 32];
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
@ -57,16 +57,17 @@ public:
|
||||
void set_ism_Tvalidity(uint8_t tvalidity);
|
||||
void set_ism_crc(uint32_t crc);
|
||||
|
||||
bool check_ism_crc(const std::bitset<GALILEO_DATA_JK_BITS>& bits) const;
|
||||
bool check_ism_crc(const std::bitset<GALILEO_DATA_JK_BITS>& bits) const; //!< Requires ism_crc to be already set
|
||||
bool ism_apply_to_sat(uint32_t prn) const; //!< Returns true if ISM parameters apply to the prn satellite, false otherwise
|
||||
|
||||
double get_pconst_value() const;
|
||||
double get_psat_value() const;
|
||||
float get_ura_m() const;
|
||||
float get_ure_m() const;
|
||||
float get_bnom_m() const;
|
||||
uint16_t get_WN_ISM() const;
|
||||
uint16_t get_t0_ISM() const;
|
||||
uint16_t get_Tvalidity_hours() const;
|
||||
double get_pconst_value() const; //!< A priori constellation fault probability
|
||||
double get_psat_value() const; //!< A priori satellite fault probability
|
||||
float get_ura_m() const; //!< User Range Accuracy, in m, used for integrity
|
||||
float get_ure_m() const; //!< User Range Error, in m, used for accuracy
|
||||
float get_bnom_m() const; //!< Maximum nominal bias for a satellite, in m
|
||||
uint16_t get_WN_ISM() const; //!< ISM Week Number, in weeks
|
||||
uint16_t get_t0_ISM() const; //!< ISM Time of Week, in seconds
|
||||
uint16_t get_Tvalidity_hours() const; //!< Validity duration of ISM content, in hours
|
||||
|
||||
private:
|
||||
// ICD 2.1 Table 97
|
||||
|
@ -95,6 +95,9 @@ DECLARE_string(log_dir);
|
||||
#include "unit-tests/system-parameters/glonass_gnav_ephemeris_test.cc"
|
||||
#include "unit-tests/system-parameters/glonass_gnav_nav_message_test.cc"
|
||||
#include "unit-tests/system-parameters/has_decoding_test.cc"
|
||||
#include "unit-tests/system-parameters/galileo_ism_test.cc"
|
||||
|
||||
|
||||
|
||||
#ifndef EXCLUDE_TESTS_REQUIRING_BINARIES
|
||||
#include "unit-tests/control-plane/control_thread_test.cc"
|
||||
|
Loading…
Reference in New Issue
Block a user