mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-11-28 04:45:16 +00:00
bds_b3i: merging new changes, fixing small bugs
This commit is contained in:
@@ -32,19 +32,30 @@ add_library(pvt_adapters ${PVT_ADAPTER_SOURCES} ${PVT_ADAPTER_HEADERS})
|
||||
target_link_libraries(pvt_adapters
|
||||
PUBLIC
|
||||
pvt_gr_blocks
|
||||
Armadillo::armadillo
|
||||
Gnuradio::runtime
|
||||
gnss_system_parameters
|
||||
gnss_rx
|
||||
pvt_lib
|
||||
core_system_parameters
|
||||
PRIVATE
|
||||
Boost::serialization
|
||||
gnss_sdr_flags
|
||||
pvt_libs
|
||||
)
|
||||
|
||||
target_include_directories(pvt_adapters
|
||||
PUBLIC
|
||||
${CMAKE_SOURCE_DIR}/src/core/interfaces
|
||||
)
|
||||
|
||||
if(Boost_VERSION LESS 105800)
|
||||
target_compile_definitions(pvt_adapters PRIVATE -DOLD_BOOST=1)
|
||||
endif()
|
||||
|
||||
if(ENABLE_CLANG_TIDY)
|
||||
if(CLANG_TIDY_EXE)
|
||||
set_target_properties(pvt_adapters
|
||||
PROPERTIES
|
||||
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set_property(TARGET pvt_adapters
|
||||
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
|
||||
@@ -33,9 +33,6 @@
|
||||
#include "configuration_interface.h"
|
||||
#include "gnss_sdr_flags.h"
|
||||
#include "pvt_conf.h"
|
||||
#include <boost/archive/xml_iarchive.hpp>
|
||||
#include <boost/archive/xml_oarchive.hpp>
|
||||
#include <boost/serialization/map.hpp>
|
||||
#include <glog/logging.h>
|
||||
#if OLD_BOOST
|
||||
#include <boost/math/common_factor_rt.hpp>
|
||||
@@ -49,7 +46,7 @@ namespace bc = boost::integer;
|
||||
using google::LogMessage;
|
||||
|
||||
|
||||
RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
|
||||
Rtklib_Pvt::Rtklib_Pvt(ConfigurationInterface* configuration,
|
||||
const std::string& role,
|
||||
unsigned int in_streams,
|
||||
unsigned int out_streams) : role_(role),
|
||||
@@ -197,65 +194,195 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
|
||||
int bds_B1_count = configuration->property("Channels_B1.count", 0);
|
||||
int bds_B3_count = configuration->property("Channels_B3.count", 0);
|
||||
|
||||
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0)) pvt_output_parameters.type_of_receiver = 1; // L1
|
||||
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0)) pvt_output_parameters.type_of_receiver = 2;
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0)) pvt_output_parameters.type_of_receiver = 3; // L5
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0)) pvt_output_parameters.type_of_receiver = 4; // E1
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0)) pvt_output_parameters.type_of_receiver = 5; // E5a
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0)) pvt_output_parameters.type_of_receiver = 6;
|
||||
|
||||
if ((gps_1C_count != 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0)) pvt_output_parameters.type_of_receiver = 7;
|
||||
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0)) pvt_output_parameters.type_of_receiver = 8; // L1+L5
|
||||
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0)) pvt_output_parameters.type_of_receiver = 9; // L1+E1
|
||||
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0)) pvt_output_parameters.type_of_receiver = 10;
|
||||
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0)) pvt_output_parameters.type_of_receiver = 11;
|
||||
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0)) pvt_output_parameters.type_of_receiver = 12;
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0)) pvt_output_parameters.type_of_receiver = 13; // L5+E5a
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0)) pvt_output_parameters.type_of_receiver = 14;
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0)) pvt_output_parameters.type_of_receiver = 15;
|
||||
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
|
||||
{
|
||||
pvt_output_parameters.type_of_receiver = 1; // L1
|
||||
}
|
||||
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
|
||||
{
|
||||
pvt_output_parameters.type_of_receiver = 2;
|
||||
}
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
|
||||
{
|
||||
pvt_output_parameters.type_of_receiver = 3; // L5
|
||||
}
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
|
||||
{
|
||||
pvt_output_parameters.type_of_receiver = 4; // E1
|
||||
}
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
|
||||
{
|
||||
pvt_output_parameters.type_of_receiver = 5; // E5a
|
||||
}
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
|
||||
{
|
||||
pvt_output_parameters.type_of_receiver = 6;
|
||||
}
|
||||
if ((gps_1C_count != 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
|
||||
{
|
||||
pvt_output_parameters.type_of_receiver = 7;
|
||||
}
|
||||
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
|
||||
{
|
||||
pvt_output_parameters.type_of_receiver = 8; // L1+L5
|
||||
}
|
||||
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
|
||||
{
|
||||
pvt_output_parameters.type_of_receiver = 9; // L1+E1
|
||||
}
|
||||
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
|
||||
{
|
||||
pvt_output_parameters.type_of_receiver = 10;
|
||||
}
|
||||
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
|
||||
{
|
||||
pvt_output_parameters.type_of_receiver = 11;
|
||||
}
|
||||
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
|
||||
{
|
||||
pvt_output_parameters.type_of_receiver = 12;
|
||||
}
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
|
||||
{
|
||||
pvt_output_parameters.type_of_receiver = 13; // L5+E5a
|
||||
}
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
|
||||
{
|
||||
pvt_output_parameters.type_of_receiver = 14;
|
||||
}
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
|
||||
{
|
||||
pvt_output_parameters.type_of_receiver = 15;
|
||||
}
|
||||
//if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) pvt_output_parameters.type_of_receiver = 16;
|
||||
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0)) pvt_output_parameters.type_of_receiver = 17;
|
||||
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0)) pvt_output_parameters.type_of_receiver = 18;
|
||||
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
|
||||
{
|
||||
pvt_output_parameters.type_of_receiver = 17;
|
||||
}
|
||||
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
|
||||
{
|
||||
pvt_output_parameters.type_of_receiver = 18;
|
||||
}
|
||||
//if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) pvt_output_parameters.type_of_receiver = 19;
|
||||
//if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) pvt_output_parameters.type_of_receiver = 20;
|
||||
if ((gps_1C_count != 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0)) pvt_output_parameters.type_of_receiver = 21;
|
||||
if ((gps_1C_count != 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
|
||||
{
|
||||
pvt_output_parameters.type_of_receiver = 21;
|
||||
}
|
||||
//if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count = 0)) pvt_output_parameters.type_of_receiver = 22;
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (bds_B1_count == 0) && (bds_B3_count == 0)) pvt_output_parameters.type_of_receiver = 23;
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0) && (bds_B1_count == 0) && (bds_B3_count == 0)) pvt_output_parameters.type_of_receiver = 24;
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count != 0) && (bds_B1_count == 0) && (bds_B3_count == 0)) pvt_output_parameters.type_of_receiver = 25;
|
||||
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0)) pvt_output_parameters.type_of_receiver = 26;
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0)) pvt_output_parameters.type_of_receiver = 27;
|
||||
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0)) pvt_output_parameters.type_of_receiver = 28;
|
||||
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0) && (bds_B1_count == 0) && (bds_B3_count == 0)) pvt_output_parameters.type_of_receiver = 29;
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0) && (bds_B1_count == 0) && (bds_B3_count == 0)) pvt_output_parameters.type_of_receiver = 30;
|
||||
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0) && (bds_B1_count == 0) && (bds_B3_count == 0)) pvt_output_parameters.type_of_receiver = 31;
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
|
||||
{
|
||||
pvt_output_parameters.type_of_receiver = 23;
|
||||
}
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
|
||||
{
|
||||
pvt_output_parameters.type_of_receiver = 24;
|
||||
}
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count != 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
|
||||
{
|
||||
pvt_output_parameters.type_of_receiver = 25;
|
||||
}
|
||||
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
|
||||
{
|
||||
pvt_output_parameters.type_of_receiver = 26;
|
||||
}
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
|
||||
{
|
||||
pvt_output_parameters.type_of_receiver = 27;
|
||||
}
|
||||
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
|
||||
{
|
||||
pvt_output_parameters.type_of_receiver = 28;
|
||||
}
|
||||
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
|
||||
{
|
||||
pvt_output_parameters.type_of_receiver = 29;
|
||||
}
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
|
||||
{
|
||||
pvt_output_parameters.type_of_receiver = 30;
|
||||
}
|
||||
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
|
||||
{
|
||||
pvt_output_parameters.type_of_receiver = 31;
|
||||
}
|
||||
|
||||
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count != 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0)) pvt_output_parameters.type_of_receiver = 32; // L1+E1+L5+E5a
|
||||
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count != 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0))
|
||||
{
|
||||
pvt_output_parameters.type_of_receiver = 32; // L1+E1+L5+E5a
|
||||
}
|
||||
// BeiDou B1I Receiver
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count != 0) && (bds_B3_count == 0)) pvt_output_parameters.type_of_receiver = 50;
|
||||
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count != 0) && (bds_B3_count == 0)) pvt_output_parameters.type_of_receiver = 51;
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count != 0) && (bds_B3_count == 0)) pvt_output_parameters.type_of_receiver = 52;
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0) && (bds_B1_count != 0) && (bds_B3_count == 0)) pvt_output_parameters.type_of_receiver = 53;
|
||||
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count != 0) && (bds_B3_count == 0)) pvt_output_parameters.type_of_receiver = 54;
|
||||
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0) && (bds_B1_count != 0) && (bds_B3_count == 0)) pvt_output_parameters.type_of_receiver = 55;
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count != 0) && (bds_B3_count != 0)) pvt_output_parameters.type_of_receiver = 56;
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count != 0) && (bds_B3_count == 0))
|
||||
{
|
||||
pvt_output_parameters.type_of_receiver = 50;
|
||||
}
|
||||
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count != 0) && (bds_B3_count == 0))
|
||||
{
|
||||
pvt_output_parameters.type_of_receiver = 51;
|
||||
}
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count != 0) && (bds_B3_count == 0))
|
||||
{
|
||||
pvt_output_parameters.type_of_receiver = 52;
|
||||
}
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0) && (bds_B1_count != 0) && (bds_B3_count == 0))
|
||||
{
|
||||
pvt_output_parameters.type_of_receiver = 53;
|
||||
}
|
||||
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count != 0) && (bds_B3_count == 0))
|
||||
{
|
||||
pvt_output_parameters.type_of_receiver = 54;
|
||||
}
|
||||
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0) && (bds_B1_count != 0) && (bds_B3_count == 0))
|
||||
{
|
||||
pvt_output_parameters.type_of_receiver = 55;
|
||||
}
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count != 0) && (bds_B3_count != 0))
|
||||
{
|
||||
pvt_output_parameters.type_of_receiver = 56;
|
||||
}
|
||||
// BeiDou B3I Receiver
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count != 0)) pvt_output_parameters.type_of_receiver = 60;
|
||||
if ((gps_1C_count != 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count != 0)) pvt_output_parameters.type_of_receiver = 61;
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0) && (bds_B1_count == 0) && (bds_B3_count != 0)) pvt_output_parameters.type_of_receiver = 62;
|
||||
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count != 0) && (bds_B1_count == 0) && (bds_B3_count != 0)) pvt_output_parameters.type_of_receiver = 63;
|
||||
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count != 0))
|
||||
{
|
||||
pvt_output_parameters.type_of_receiver = 60;
|
||||
}
|
||||
if ((gps_1C_count != 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count != 0))
|
||||
{
|
||||
pvt_output_parameters.type_of_receiver = 61;
|
||||
}
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0) && (bds_B1_count == 0) && (bds_B3_count != 0))
|
||||
{
|
||||
pvt_output_parameters.type_of_receiver = 62;
|
||||
}
|
||||
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count != 0) && (bds_B1_count == 0) && (bds_B3_count != 0))
|
||||
{
|
||||
pvt_output_parameters.type_of_receiver = 63;
|
||||
}
|
||||
|
||||
// RTKLIB PVT solver options
|
||||
// Settings 1
|
||||
int positioning_mode = -1;
|
||||
std::string default_pos_mode("Single");
|
||||
std::string positioning_mode_str = configuration->property(role + ".positioning_mode", default_pos_mode); // (PMODE_XXX) see src/algorithms/libs/rtklib/rtklib.h
|
||||
if (positioning_mode_str == "Single") positioning_mode = PMODE_SINGLE;
|
||||
if (positioning_mode_str == "Static") positioning_mode = PMODE_STATIC;
|
||||
if (positioning_mode_str == "Kinematic") positioning_mode = PMODE_KINEMA;
|
||||
if (positioning_mode_str == "PPP_Static") positioning_mode = PMODE_PPP_STATIC;
|
||||
if (positioning_mode_str == "PPP_Kinematic") positioning_mode = PMODE_PPP_KINEMA;
|
||||
if (positioning_mode_str == "Single")
|
||||
{
|
||||
positioning_mode = PMODE_SINGLE;
|
||||
}
|
||||
if (positioning_mode_str == "Static")
|
||||
{
|
||||
positioning_mode = PMODE_STATIC;
|
||||
}
|
||||
if (positioning_mode_str == "Kinematic")
|
||||
{
|
||||
positioning_mode = PMODE_KINEMA;
|
||||
}
|
||||
if (positioning_mode_str == "PPP_Static")
|
||||
{
|
||||
positioning_mode = PMODE_PPP_STATIC;
|
||||
}
|
||||
if (positioning_mode_str == "PPP_Kinematic")
|
||||
{
|
||||
positioning_mode = PMODE_PPP_KINEMA;
|
||||
}
|
||||
|
||||
if (positioning_mode == -1)
|
||||
{
|
||||
@@ -269,10 +396,22 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
|
||||
|
||||
int num_bands = 0;
|
||||
|
||||
if (( gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0) || (bds_B1_count > 0)) num_bands = 1;
|
||||
if (((gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0) || (bds_B1_count > 0)) && ((gps_2S_count > 0) || (glo_2G_count > 0) || (bds_B3_count > 0))) num_bands = 2;
|
||||
if (((gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0) || (bds_B1_count > 0)) && ((gal_E5a_count > 0) || (gal_E5b_count > 0) || (gps_L5_count > 0))) num_bands = 2;
|
||||
if (((gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0) || (bds_B1_count > 0)) && ((gps_2S_count > 0) || (glo_2G_count > 0) || (bds_B3_count > 0)) && ((gal_E5a_count > 0) || (gal_E5b_count > 0) || (gps_L5_count > 0))) num_bands = 3;
|
||||
if ((gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0) || (bds_B1_count > 0))
|
||||
{
|
||||
num_bands = 1;
|
||||
}
|
||||
if (((gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0) || (bds_B1_count > 0)) && ((gps_2S_count > 0) || (glo_2G_count > 0) || (bds_B3_count > 0)))
|
||||
{
|
||||
num_bands = 2;
|
||||
}
|
||||
if (((gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0) || (bds_B1_count > 0)) && ((gal_E5a_count > 0) || (gal_E5b_count > 0) || (gps_L5_count > 0)))
|
||||
{
|
||||
num_bands = 2;
|
||||
}
|
||||
if (((gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0) || (bds_B1_count > 0)) && ((gps_2S_count > 0) || (glo_2G_count > 0) || (bds_B3_count > 0)) && ((gal_E5a_count > 0) || (gal_E5b_count > 0) || (gps_L5_count > 0)))
|
||||
{
|
||||
num_bands = 3;
|
||||
}
|
||||
|
||||
int number_of_frequencies = configuration->property(role + ".num_bands", num_bands); /* (1:L1, 2:L1+L2, 3:L1+L2+L5) */
|
||||
if ((number_of_frequencies < 1) || (number_of_frequencies > 3))
|
||||
@@ -300,12 +439,30 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
|
||||
std::string default_iono_model("OFF");
|
||||
std::string iono_model_str = configuration->property(role + ".iono_model", default_iono_model); /* (IONOOPT_XXX) see src/algorithms/libs/rtklib/rtklib.h */
|
||||
int iono_model = -1;
|
||||
if (iono_model_str == "OFF") iono_model = IONOOPT_OFF;
|
||||
if (iono_model_str == "Broadcast") iono_model = IONOOPT_BRDC;
|
||||
if (iono_model_str == "SBAS") iono_model = IONOOPT_SBAS;
|
||||
if (iono_model_str == "Iono-Free-LC") iono_model = IONOOPT_IFLC;
|
||||
if (iono_model_str == "Estimate_STEC") iono_model = IONOOPT_EST;
|
||||
if (iono_model_str == "IONEX") iono_model = IONOOPT_TEC;
|
||||
if (iono_model_str == "OFF")
|
||||
{
|
||||
iono_model = IONOOPT_OFF;
|
||||
}
|
||||
if (iono_model_str == "Broadcast")
|
||||
{
|
||||
iono_model = IONOOPT_BRDC;
|
||||
}
|
||||
if (iono_model_str == "SBAS")
|
||||
{
|
||||
iono_model = IONOOPT_SBAS;
|
||||
}
|
||||
if (iono_model_str == "Iono-Free-LC")
|
||||
{
|
||||
iono_model = IONOOPT_IFLC;
|
||||
}
|
||||
if (iono_model_str == "Estimate_STEC")
|
||||
{
|
||||
iono_model = IONOOPT_EST;
|
||||
}
|
||||
if (iono_model_str == "IONEX")
|
||||
{
|
||||
iono_model = IONOOPT_TEC;
|
||||
}
|
||||
if (iono_model == -1)
|
||||
{
|
||||
//warn user and set the default
|
||||
@@ -319,11 +476,26 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
|
||||
std::string default_trop_model("OFF");
|
||||
int trop_model = -1;
|
||||
std::string trop_model_str = configuration->property(role + ".trop_model", default_trop_model); /* (TROPOPT_XXX) see src/algorithms/libs/rtklib/rtklib.h */
|
||||
if (trop_model_str == "OFF") trop_model = TROPOPT_OFF;
|
||||
if (trop_model_str == "Saastamoinen") trop_model = TROPOPT_SAAS;
|
||||
if (trop_model_str == "SBAS") trop_model = TROPOPT_SBAS;
|
||||
if (trop_model_str == "Estimate_ZTD") trop_model = TROPOPT_EST;
|
||||
if (trop_model_str == "Estimate_ZTD_Grad") trop_model = TROPOPT_ESTG;
|
||||
if (trop_model_str == "OFF")
|
||||
{
|
||||
trop_model = TROPOPT_OFF;
|
||||
}
|
||||
if (trop_model_str == "Saastamoinen")
|
||||
{
|
||||
trop_model = TROPOPT_SAAS;
|
||||
}
|
||||
if (trop_model_str == "SBAS")
|
||||
{
|
||||
trop_model = TROPOPT_SBAS;
|
||||
}
|
||||
if (trop_model_str == "Estimate_ZTD")
|
||||
{
|
||||
trop_model = TROPOPT_EST;
|
||||
}
|
||||
if (trop_model_str == "Estimate_ZTD_Grad")
|
||||
{
|
||||
trop_model = TROPOPT_ESTG;
|
||||
}
|
||||
if (trop_model == -1)
|
||||
{
|
||||
//warn user and set the default
|
||||
@@ -353,10 +525,22 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
|
||||
int earth_tide = configuration->property(role + ".earth_tide", 0);
|
||||
|
||||
int nsys = 0;
|
||||
if ((gps_1C_count > 0) || (gps_2S_count > 0) || (gps_L5_count > 0)) nsys += SYS_GPS;
|
||||
if ((gal_1B_count > 0) || (gal_E5a_count > 0) || (gal_E5b_count > 0)) nsys += SYS_GAL;
|
||||
if ((glo_1G_count > 0) || (glo_2G_count > 0)) nsys += SYS_GLO;
|
||||
if ((bds_B1_count > 0) || (bds_B3_count > 0)) nsys += SYS_BDS;
|
||||
if ((gps_1C_count > 0) || (gps_2S_count > 0) || (gps_L5_count > 0))
|
||||
{
|
||||
nsys += SYS_GPS;
|
||||
}
|
||||
if ((gal_1B_count > 0) || (gal_E5a_count > 0) || (gal_E5b_count > 0))
|
||||
{
|
||||
nsys += SYS_GAL;
|
||||
}
|
||||
if ((glo_1G_count > 0) || (glo_2G_count > 0))
|
||||
{
|
||||
nsys += SYS_GLO;
|
||||
}
|
||||
if ((bds_B1_count > 0) || (bds_B3_count > 0))
|
||||
{
|
||||
nsys += SYS_BDS;
|
||||
}
|
||||
|
||||
int navigation_system = configuration->property(role + ".navigation_system", nsys); /* (SYS_XXX) see src/algorithms/libs/rtklib/rtklib.h */
|
||||
if ((navigation_system < 1) || (navigation_system > 255)) /* GPS: 1 SBAS: 2 GPS+SBAS: 3 Galileo: 8 Galileo+GPS: 9 GPS+SBAS+Galileo: 11 All: 255 */
|
||||
@@ -370,11 +554,26 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
|
||||
std::string default_gps_ar("Continuous");
|
||||
std::string integer_ambiguity_resolution_gps_str = configuration->property(role + ".AR_GPS", default_gps_ar); /* Integer Ambiguity Resolution mode for GPS (0:off,1:continuous,2:instantaneous,3:fix and hold,4:ppp-ar) */
|
||||
int integer_ambiguity_resolution_gps = -1;
|
||||
if (integer_ambiguity_resolution_gps_str == "OFF") integer_ambiguity_resolution_gps = ARMODE_OFF;
|
||||
if (integer_ambiguity_resolution_gps_str == "Continuous") integer_ambiguity_resolution_gps = ARMODE_CONT;
|
||||
if (integer_ambiguity_resolution_gps_str == "Instantaneous") integer_ambiguity_resolution_gps = ARMODE_INST;
|
||||
if (integer_ambiguity_resolution_gps_str == "Fix-and-Hold") integer_ambiguity_resolution_gps = ARMODE_FIXHOLD;
|
||||
if (integer_ambiguity_resolution_gps_str == "PPP-AR") integer_ambiguity_resolution_gps = ARMODE_PPPAR;
|
||||
if (integer_ambiguity_resolution_gps_str == "OFF")
|
||||
{
|
||||
integer_ambiguity_resolution_gps = ARMODE_OFF;
|
||||
}
|
||||
if (integer_ambiguity_resolution_gps_str == "Continuous")
|
||||
{
|
||||
integer_ambiguity_resolution_gps = ARMODE_CONT;
|
||||
}
|
||||
if (integer_ambiguity_resolution_gps_str == "Instantaneous")
|
||||
{
|
||||
integer_ambiguity_resolution_gps = ARMODE_INST;
|
||||
}
|
||||
if (integer_ambiguity_resolution_gps_str == "Fix-and-Hold")
|
||||
{
|
||||
integer_ambiguity_resolution_gps = ARMODE_FIXHOLD;
|
||||
}
|
||||
if (integer_ambiguity_resolution_gps_str == "PPP-AR")
|
||||
{
|
||||
integer_ambiguity_resolution_gps = ARMODE_PPPAR;
|
||||
}
|
||||
if (integer_ambiguity_resolution_gps == -1)
|
||||
{
|
||||
//warn user and set the default
|
||||
@@ -549,13 +748,13 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
|
||||
}
|
||||
|
||||
|
||||
RtklibPvt::~RtklibPvt()
|
||||
Rtklib_Pvt::~Rtklib_Pvt()
|
||||
{
|
||||
rtkfree(&rtk);
|
||||
}
|
||||
|
||||
|
||||
bool RtklibPvt::get_latest_PVT(double* longitude_deg,
|
||||
bool Rtklib_Pvt::get_latest_PVT(double* longitude_deg,
|
||||
double* latitude_deg,
|
||||
double* height_m,
|
||||
double* ground_speed_kmh,
|
||||
@@ -571,37 +770,37 @@ bool RtklibPvt::get_latest_PVT(double* longitude_deg,
|
||||
}
|
||||
|
||||
|
||||
void RtklibPvt::clear_ephemeris()
|
||||
void Rtklib_Pvt::clear_ephemeris()
|
||||
{
|
||||
pvt_->clear_ephemeris();
|
||||
}
|
||||
|
||||
|
||||
std::map<int, Gps_Ephemeris> RtklibPvt::get_gps_ephemeris() const
|
||||
std::map<int, Gps_Ephemeris> Rtklib_Pvt::get_gps_ephemeris() const
|
||||
{
|
||||
return pvt_->get_gps_ephemeris_map();
|
||||
}
|
||||
|
||||
|
||||
std::map<int, Galileo_Ephemeris> RtklibPvt::get_galileo_ephemeris() const
|
||||
std::map<int, Galileo_Ephemeris> Rtklib_Pvt::get_galileo_ephemeris() const
|
||||
{
|
||||
return pvt_->get_galileo_ephemeris_map();
|
||||
}
|
||||
|
||||
|
||||
std::map<int, Gps_Almanac> RtklibPvt::get_gps_almanac() const
|
||||
std::map<int, Gps_Almanac> Rtklib_Pvt::get_gps_almanac() const
|
||||
{
|
||||
return pvt_->get_gps_almanac_map();
|
||||
}
|
||||
|
||||
|
||||
std::map<int, Galileo_Almanac> RtklibPvt::get_galileo_almanac() const
|
||||
std::map<int, Galileo_Almanac> Rtklib_Pvt::get_galileo_almanac() const
|
||||
{
|
||||
return pvt_->get_galileo_almanac_map();
|
||||
}
|
||||
|
||||
|
||||
void RtklibPvt::connect(gr::top_block_sptr top_block)
|
||||
void Rtklib_Pvt::connect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if (top_block)
|
||||
{ /* top_block is not null */
|
||||
@@ -611,7 +810,7 @@ void RtklibPvt::connect(gr::top_block_sptr top_block)
|
||||
}
|
||||
|
||||
|
||||
void RtklibPvt::disconnect(gr::top_block_sptr top_block)
|
||||
void Rtklib_Pvt::disconnect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if (top_block)
|
||||
{ /* top_block is not null */
|
||||
@@ -620,13 +819,13 @@ void RtklibPvt::disconnect(gr::top_block_sptr top_block)
|
||||
}
|
||||
|
||||
|
||||
gr::basic_block_sptr RtklibPvt::get_left_block()
|
||||
gr::basic_block_sptr Rtklib_Pvt::get_left_block()
|
||||
{
|
||||
return pvt_;
|
||||
}
|
||||
|
||||
|
||||
gr::basic_block_sptr RtklibPvt::get_right_block()
|
||||
gr::basic_block_sptr Rtklib_Pvt::get_right_block()
|
||||
{
|
||||
return pvt_; // this is a sink, nothing downstream
|
||||
return nullptr; // this is a sink, nothing downstream
|
||||
}
|
||||
|
||||
@@ -32,8 +32,14 @@
|
||||
#ifndef GNSS_SDR_RTKLIB_PVT_H_
|
||||
#define GNSS_SDR_RTKLIB_PVT_H_
|
||||
|
||||
#include "galileo_almanac.h"
|
||||
#include "galileo_ephemeris.h"
|
||||
#include "gps_almanac.h"
|
||||
#include "gps_ephemeris.h"
|
||||
#include "pvt_interface.h"
|
||||
#include "rtklib.h"
|
||||
#include "rtklib_pvt_cc.h"
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
|
||||
@@ -42,15 +48,15 @@ class ConfigurationInterface;
|
||||
/*!
|
||||
* \brief This class implements a PvtInterface for the RTKLIB PVT block
|
||||
*/
|
||||
class RtklibPvt : public PvtInterface
|
||||
class Rtklib_Pvt : public PvtInterface
|
||||
{
|
||||
public:
|
||||
RtklibPvt(ConfigurationInterface* configuration,
|
||||
Rtklib_Pvt(ConfigurationInterface* configuration,
|
||||
const std::string& role,
|
||||
unsigned int in_streams,
|
||||
unsigned int out_streams);
|
||||
|
||||
virtual ~RtklibPvt();
|
||||
virtual ~Rtklib_Pvt();
|
||||
|
||||
inline std::string role() override
|
||||
{
|
||||
|
||||
@@ -30,23 +30,28 @@ add_library(pvt_gr_blocks ${PVT_GR_BLOCKS_SOURCES} ${PVT_GR_BLOCKS_HEADERS})
|
||||
|
||||
target_link_libraries(pvt_gr_blocks
|
||||
PUBLIC
|
||||
pvt_libs
|
||||
core_system_parameters
|
||||
Boost::date_time
|
||||
pvt_lib
|
||||
Gnuradio::pmt
|
||||
Gnuradio::runtime
|
||||
gnss_system_parameters
|
||||
gnss_rx
|
||||
PRIVATE
|
||||
algorithms_libs
|
||||
Gflags::gflags
|
||||
Glog::glog
|
||||
Boost::filesystem
|
||||
Boost::system
|
||||
Boost::serialization
|
||||
)
|
||||
|
||||
target_include_directories(pvt_gr_blocks
|
||||
PUBLIC
|
||||
${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs
|
||||
${CMAKE_SOURCE_DIR}/src/core/system_parameters
|
||||
)
|
||||
if(ENABLE_CLANG_TIDY)
|
||||
if(CLANG_TIDY_EXE)
|
||||
set_target_properties(pvt_gr_blocks
|
||||
PROPERTIES
|
||||
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(Boost_VERSION LESS 105800)
|
||||
target_compile_definitions(pvt_gr_blocks PRIVATE -DOLD_BOOST=1)
|
||||
@@ -55,5 +60,4 @@ endif()
|
||||
set_property(TARGET pvt_gr_blocks
|
||||
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/core/system_parameters>
|
||||
)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -31,7 +31,13 @@
|
||||
#ifndef GNSS_SDR_RTKLIB_PVT_CC_H
|
||||
#define GNSS_SDR_RTKLIB_PVT_CC_H
|
||||
|
||||
#include "beidou_dnav_almanac.h"
|
||||
#include "beidou_dnav_ephemeris.h"
|
||||
#include "galileo_almanac.h"
|
||||
#include "galileo_ephemeris.h"
|
||||
#include "geojson_printer.h"
|
||||
#include "gnss_synchro.h"
|
||||
#include "gps_almanac.h"
|
||||
#include "gps_ephemeris.h"
|
||||
#include "gpx_printer.h"
|
||||
#include "kml_printer.h"
|
||||
@@ -44,21 +50,24 @@
|
||||
#include <boost/date_time/gregorian/gregorian.hpp>
|
||||
#include <boost/date_time/posix_time/posix_time.hpp>
|
||||
#include <gnuradio/sync_block.h>
|
||||
#include <pmt/pmt.h>
|
||||
#include <chrono>
|
||||
#include <cstdint>
|
||||
#include <fstream>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <sys/ipc.h>
|
||||
#include <sys/msg.h>
|
||||
#include <sys/types.h>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
|
||||
class rtklib_pvt_cc;
|
||||
|
||||
typedef boost::shared_ptr<rtklib_pvt_cc> rtklib_pvt_cc_sptr;
|
||||
using rtklib_pvt_cc_sptr = boost::shared_ptr<rtklib_pvt_cc>;
|
||||
|
||||
rtklib_pvt_cc_sptr rtklib_make_pvt_cc(uint32_t n_channels,
|
||||
rtklib_pvt_cc_sptr rtklib_make_pvt_cc(uint32_t nchannels,
|
||||
const Pvt_Conf& conf_,
|
||||
const rtk_t& rtk);
|
||||
|
||||
@@ -85,15 +94,15 @@ private:
|
||||
|
||||
bool b_rtcm_writing_started;
|
||||
bool b_rtcm_enabled;
|
||||
int32_t d_rtcm_MT1045_rate_ms; //!< Galileo Broadcast Ephemeris
|
||||
int32_t d_rtcm_MT1019_rate_ms; //!< GPS Broadcast Ephemeris (orbits)
|
||||
int32_t d_rtcm_MT1020_rate_ms; //!< GLONASS Broadcast Ephemeris (orbits)
|
||||
int32_t d_rtcm_MT1077_rate_ms; //!< The type 7 Multiple Signal Message format for the USA’s GPS system, popular
|
||||
int32_t d_rtcm_MT1087_rate_ms; //!< GLONASS MSM7. The type 7 Multiple Signal Message format for the Russian GLONASS system
|
||||
int32_t d_rtcm_MT1097_rate_ms; //!< Galileo MSM7. The type 7 Multiple Signal Message format for Europe’s Galileo system
|
||||
int32_t d_rtcm_MT1045_rate_ms; // Galileo Broadcast Ephemeris
|
||||
int32_t d_rtcm_MT1019_rate_ms; // GPS Broadcast Ephemeris (orbits)
|
||||
int32_t d_rtcm_MT1020_rate_ms; // GLONASS Broadcast Ephemeris (orbits)
|
||||
int32_t d_rtcm_MT1077_rate_ms; // The type 7 Multiple Signal Message format for the USA’s GPS system, popular
|
||||
int32_t d_rtcm_MT1087_rate_ms; // GLONASS MSM7. The type 7 Multiple Signal Message format for the Russian GLONASS system
|
||||
int32_t d_rtcm_MT1097_rate_ms; // Galileo MSM7. The type 7 Multiple Signal Message format for Europe’s Galileo system
|
||||
int32_t d_rtcm_MSM_rate_ms;
|
||||
|
||||
int32_t d_last_status_print_seg; //for status printer
|
||||
int32_t d_last_status_print_seg; // for status printer
|
||||
|
||||
uint32_t d_nchannels;
|
||||
std::string d_dump_filename;
|
||||
@@ -114,7 +123,7 @@ private:
|
||||
bool d_kml_output_enabled;
|
||||
bool d_nmea_output_file_enabled;
|
||||
|
||||
std::shared_ptr<rtklib_solver> d_pvt_solver;
|
||||
std::shared_ptr<Rtklib_Solver> d_pvt_solver;
|
||||
|
||||
std::map<int, Gnss_Synchro> gnss_observables_map;
|
||||
bool observables_pairCompare_min(const std::pair<int, Gnss_Synchro>& a, const std::pair<int, Gnss_Synchro>& b);
|
||||
@@ -132,29 +141,31 @@ private:
|
||||
bool send_sys_v_ttff_msg(ttff_msgbuf ttff);
|
||||
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||
|
||||
bool save_gnss_synchro_map_xml(const std::string& file_name); //debug helper function
|
||||
bool save_gnss_synchro_map_xml(const std::string& file_name); // debug helper function
|
||||
|
||||
bool load_gnss_synchro_map_xml(const std::string& file_name); //debug helper function
|
||||
bool load_gnss_synchro_map_xml(const std::string& file_name); // debug helper function
|
||||
|
||||
bool d_xml_storage;
|
||||
std::string xml_base_path;
|
||||
|
||||
inline std::time_t to_time_t(boost::posix_time::ptime pt)
|
||||
inline std::time_t convert_to_time_t(const boost::posix_time::ptime pt) const
|
||||
{
|
||||
return (pt - boost::posix_time::ptime(boost::gregorian::date(1970, 1, 1))).total_seconds();
|
||||
}
|
||||
|
||||
bool flag_monitor_pvt_enabled;
|
||||
std::unique_ptr<Monitor_Pvt_Udp_Sink> udp_sink_ptr;
|
||||
std::vector<std::string> split_string(const std::string& s, char delim);
|
||||
std::vector<std::string> split_string(const std::string& s, char delim) const;
|
||||
|
||||
public:
|
||||
rtklib_pvt_cc(uint32_t nchannels,
|
||||
const Pvt_Conf& conf_,
|
||||
const rtk_t& rtk);
|
||||
|
||||
~rtklib_pvt_cc(); //!< Default destructor
|
||||
|
||||
/*!
|
||||
* \brief Get latest set of ephemeris from PVT block
|
||||
* \brief Get latest set of GPS ephemeris from PVT block
|
||||
*
|
||||
*/
|
||||
std::map<int, Gps_Ephemeris> get_gps_ephemeris_map() const;
|
||||
@@ -183,9 +194,7 @@ public:
|
||||
double* height_m,
|
||||
double* ground_speed_kmh,
|
||||
double* course_over_ground_deg,
|
||||
time_t* UTC_time);
|
||||
|
||||
~rtklib_pvt_cc(); //!< Default destructor
|
||||
time_t* UTC_time) const;
|
||||
|
||||
int work(int noutput_items, gr_vector_const_void_star& input_items,
|
||||
gr_vector_void_star& output_items); //!< PVT Signal Processing
|
||||
|
||||
@@ -53,16 +53,15 @@ list(SORT PVT_LIB_SOURCES)
|
||||
|
||||
source_group(Headers FILES ${PVT_LIB_HEADERS})
|
||||
|
||||
add_library(pvt_lib ${PVT_LIB_SOURCES} ${PVT_LIB_HEADERS})
|
||||
add_library(pvt_libs ${PVT_LIB_SOURCES} ${PVT_LIB_HEADERS})
|
||||
|
||||
target_link_libraries(pvt_lib
|
||||
target_link_libraries(pvt_libs
|
||||
PUBLIC
|
||||
Armadillo::armadillo
|
||||
Boost::date_time
|
||||
gnss_system_parameters
|
||||
gnss_sp_libs
|
||||
rtklib_lib
|
||||
gnss_rx
|
||||
algorithms_libs
|
||||
algorithms_libs_rtklib
|
||||
core_system_parameters
|
||||
PRIVATE
|
||||
Boost::filesystem
|
||||
Boost::system
|
||||
@@ -71,15 +70,25 @@ target_link_libraries(pvt_lib
|
||||
Matio::matio
|
||||
)
|
||||
|
||||
target_include_directories(pvt_lib
|
||||
target_include_directories(pvt_libs
|
||||
PUBLIC
|
||||
${CMAKE_SOURCE_DIR}/src/algorithms/libs
|
||||
${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib
|
||||
${CMAKE_SOURCE_DIR}/src/core/receiver
|
||||
)
|
||||
|
||||
target_compile_definitions(pvt_lib PRIVATE -DGNSS_SDR_VERSION="${VERSION}")
|
||||
target_compile_definitions(pvt_libs PRIVATE -DGNSS_SDR_VERSION="${VERSION}")
|
||||
|
||||
set_property(TARGET pvt_lib APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
||||
if(ENABLE_CLANG_TIDY)
|
||||
if(CLANG_TIDY_EXE)
|
||||
set_target_properties(pvt_libs
|
||||
PROPERTIES
|
||||
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set_property(TARGET pvt_libs APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/algorithms/libs>
|
||||
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib>
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include <boost/filesystem/path.hpp> // for path, operator<<
|
||||
#include <boost/filesystem/path_traits.hpp> // for filesystem
|
||||
#include <glog/logging.h>
|
||||
#include <exception>
|
||||
#include <iomanip>
|
||||
#include <sstream>
|
||||
|
||||
@@ -79,7 +80,14 @@ GeoJSON_Printer::GeoJSON_Printer(const std::string& base_path)
|
||||
|
||||
GeoJSON_Printer::~GeoJSON_Printer()
|
||||
{
|
||||
GeoJSON_Printer::close_file();
|
||||
try
|
||||
{
|
||||
GeoJSON_Printer::close_file();
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
std::cerr << e.what() << '\n';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -213,7 +221,10 @@ bool GeoJSON_Printer::close_file()
|
||||
// if nothing is written, erase the file
|
||||
if (first_pos == true)
|
||||
{
|
||||
if (remove(filename_.c_str()) != 0) LOG(INFO) << "Error deleting temporary file";
|
||||
if (remove(filename_.c_str()) != 0)
|
||||
{
|
||||
LOG(INFO) << "Error deleting temporary file";
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include <boost/filesystem/path.hpp> // for path, operator<<
|
||||
#include <boost/filesystem/path_traits.hpp> // for filesystem
|
||||
#include <glog/logging.h>
|
||||
#include <exception>
|
||||
#include <sstream>
|
||||
|
||||
using google::LogMessage;
|
||||
@@ -154,14 +155,14 @@ bool Gpx_Printer::set_headers(const std::string& filename, bool time_tag_name)
|
||||
}
|
||||
|
||||
|
||||
bool Gpx_Printer::print_position(const std::shared_ptr<rtklib_solver>& position, bool print_average_values)
|
||||
bool Gpx_Printer::print_position(const std::shared_ptr<Rtklib_Solver>& position, bool print_average_values)
|
||||
{
|
||||
double latitude;
|
||||
double longitude;
|
||||
double height;
|
||||
|
||||
positions_printed = true;
|
||||
const std::shared_ptr<rtklib_solver>& position_ = position;
|
||||
const std::shared_ptr<Rtklib_Solver>& position_ = position;
|
||||
|
||||
double speed_over_ground = position_->get_speed_over_ground(); // expressed in m/s
|
||||
double course_over_ground = position_->get_course_over_ground(); // expressed in deg
|
||||
@@ -170,7 +171,10 @@ bool Gpx_Printer::print_position(const std::shared_ptr<rtklib_solver>& position,
|
||||
double vdop = position_->get_vdop();
|
||||
double pdop = position_->get_pdop();
|
||||
std::string utc_time = to_iso_extended_string(position_->get_position_UTC_time());
|
||||
if (utc_time.length() < 23) utc_time += ".";
|
||||
if (utc_time.length() < 23)
|
||||
{
|
||||
utc_time += ".";
|
||||
}
|
||||
utc_time.resize(23, '0'); // time up to ms
|
||||
utc_time.append("Z"); // UTC time zone
|
||||
|
||||
@@ -218,9 +222,19 @@ bool Gpx_Printer::close_file()
|
||||
|
||||
Gpx_Printer::~Gpx_Printer()
|
||||
{
|
||||
close_file();
|
||||
try
|
||||
{
|
||||
close_file();
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
std::cerr << e.what() << '\n';
|
||||
}
|
||||
if (!positions_printed)
|
||||
{
|
||||
if (remove(gpx_filename.c_str()) != 0) LOG(INFO) << "Error deleting temporary GPX file";
|
||||
if (remove(gpx_filename.c_str()) != 0)
|
||||
{
|
||||
LOG(INFO) << "Error deleting temporary GPX file";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ public:
|
||||
Gpx_Printer(const std::string& base_path = ".");
|
||||
~Gpx_Printer();
|
||||
bool set_headers(const std::string& filename, bool time_tag_name = true);
|
||||
bool print_position(const std::shared_ptr<rtklib_solver>& position, bool print_average_values);
|
||||
bool print_position(const std::shared_ptr<Rtklib_Solver>& position, bool print_average_values);
|
||||
bool close_file();
|
||||
};
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
hybrid_ls_pvt::hybrid_ls_pvt(int nchannels, std::string dump_filename, bool flag_dump_to_file) : Ls_Pvt()
|
||||
Hybrid_Ls_Pvt::Hybrid_Ls_Pvt(int nchannels, std::string dump_filename, bool flag_dump_to_file) : Ls_Pvt()
|
||||
{
|
||||
// init empty ephemeris for all the available GNSS channels
|
||||
d_nchannels = nchannels;
|
||||
@@ -69,7 +69,7 @@ hybrid_ls_pvt::hybrid_ls_pvt(int nchannels, std::string dump_filename, bool flag
|
||||
}
|
||||
|
||||
|
||||
hybrid_ls_pvt::~hybrid_ls_pvt()
|
||||
Hybrid_Ls_Pvt::~Hybrid_Ls_Pvt()
|
||||
{
|
||||
if (d_dump_file.is_open() == true)
|
||||
{
|
||||
@@ -85,7 +85,7 @@ hybrid_ls_pvt::~hybrid_ls_pvt()
|
||||
}
|
||||
|
||||
|
||||
bool hybrid_ls_pvt::get_PVT(std::map<int, Gnss_Synchro> gnss_observables_map, double hybrid_current_time, bool flag_averaging)
|
||||
bool Hybrid_Ls_Pvt::get_PVT(std::map<int, Gnss_Synchro> gnss_observables_map, double hybrid_current_time, bool flag_averaging)
|
||||
{
|
||||
std::map<int, Gnss_Synchro>::iterator gnss_observables_iter;
|
||||
std::map<int, Galileo_Ephemeris>::iterator galileo_ephemeris_iter;
|
||||
@@ -133,7 +133,7 @@ bool hybrid_ls_pvt::get_PVT(std::map<int, Gnss_Synchro> gnss_observables_map, do
|
||||
|
||||
// COMMON RX TIME PVT ALGORITHM
|
||||
double Rx_time = hybrid_current_time;
|
||||
double Tx_time = Rx_time - gnss_observables_iter->second.Pseudorange_m / GALILEO_C_m_s;
|
||||
double Tx_time = Rx_time - gnss_observables_iter->second.Pseudorange_m / GALILEO_C_M_S;
|
||||
|
||||
// 2- compute the clock drift using the clock model (broadcast) for this SV
|
||||
SV_clock_bias_s = galileo_ephemeris_iter->second.sv_clock_drift(Tx_time);
|
||||
@@ -150,7 +150,7 @@ bool hybrid_ls_pvt::get_PVT(std::map<int, Gnss_Synchro> gnss_observables_map, do
|
||||
|
||||
// 4- fill the observations vector with the corrected observables
|
||||
obs.resize(valid_obs + 1, 1);
|
||||
obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + SV_clock_bias_s * GALILEO_C_m_s - this->get_time_offset_s() * GALILEO_C_m_s;
|
||||
obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + SV_clock_bias_s * GALILEO_C_M_S - this->get_time_offset_s() * GALILEO_C_M_S;
|
||||
|
||||
Galileo_week_number = galileo_ephemeris_iter->second.WN_5; //for GST
|
||||
GST = galileo_ephemeris_iter->second.Galileo_System_Time(Galileo_week_number, hybrid_current_time);
|
||||
@@ -188,7 +188,7 @@ bool hybrid_ls_pvt::get_PVT(std::map<int, Gnss_Synchro> gnss_observables_map, do
|
||||
// COMMON RX TIME PVT ALGORITHM MODIFICATION (Like RINEX files)
|
||||
// first estimate of transmit time
|
||||
double Rx_time = hybrid_current_time;
|
||||
double Tx_time = Rx_time - gnss_observables_iter->second.Pseudorange_m / GPS_C_m_s;
|
||||
double Tx_time = Rx_time - gnss_observables_iter->second.Pseudorange_m / GPS_C_M_S;
|
||||
|
||||
// 2- compute the clock drift using the clock model (broadcast) for this SV, not including relativistic effect
|
||||
SV_clock_bias_s = gps_ephemeris_iter->second.sv_clock_drift(Tx_time); //- gps_ephemeris_iter->second.d_TGD;
|
||||
@@ -208,10 +208,10 @@ bool hybrid_ls_pvt::get_PVT(std::map<int, Gnss_Synchro> gnss_observables_map, do
|
||||
// See IS-GPS-200E section 20.3.3.3.3.2
|
||||
double sqrt_Gamma = GPS_L1_FREQ_HZ / GPS_L2_FREQ_HZ;
|
||||
double Gamma = sqrt_Gamma * sqrt_Gamma;
|
||||
double P1_P2 = (1.0 - Gamma) * (gps_ephemeris_iter->second.d_TGD * GPS_C_m_s);
|
||||
double P1_P2 = (1.0 - Gamma) * (gps_ephemeris_iter->second.d_TGD * GPS_C_M_S);
|
||||
double Code_bias_m = P1_P2 / (1.0 - Gamma);
|
||||
obs.resize(valid_obs + 1, 1);
|
||||
obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + dtr * GPS_C_m_s - Code_bias_m - this->get_time_offset_s() * GPS_C_m_s;
|
||||
obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + dtr * GPS_C_M_S - Code_bias_m - this->get_time_offset_s() * GPS_C_M_S;
|
||||
|
||||
// SV ECEF DEBUG OUTPUT
|
||||
LOG(INFO) << "(new)ECEF GPS L1 CA satellite SV ID=" << gps_ephemeris_iter->second.i_satellite_PRN
|
||||
@@ -243,7 +243,7 @@ bool hybrid_ls_pvt::get_PVT(std::map<int, Gnss_Synchro> gnss_observables_map, do
|
||||
// COMMON RX TIME PVT ALGORITHM MODIFICATION (Like RINEX files)
|
||||
// first estimate of transmit time
|
||||
double Rx_time = hybrid_current_time;
|
||||
double Tx_time = Rx_time - gnss_observables_iter->second.Pseudorange_m / GPS_C_m_s;
|
||||
double Tx_time = Rx_time - gnss_observables_iter->second.Pseudorange_m / GPS_C_M_S;
|
||||
|
||||
// 2- compute the clock drift using the clock model (broadcast) for this SV
|
||||
SV_clock_bias_s = gps_cnav_ephemeris_iter->second.sv_clock_drift(Tx_time);
|
||||
@@ -261,7 +261,7 @@ bool hybrid_ls_pvt::get_PVT(std::map<int, Gnss_Synchro> gnss_observables_map, do
|
||||
|
||||
// 4- fill the observations vector with the corrected observables
|
||||
obs.resize(valid_obs + 1, 1);
|
||||
obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + dtr * GPS_C_m_s + SV_clock_bias_s * GPS_C_m_s;
|
||||
obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + dtr * GPS_C_M_S + SV_clock_bias_s * GPS_C_M_S;
|
||||
|
||||
GPS_week = gps_cnav_ephemeris_iter->second.i_GPS_week;
|
||||
GPS_week = GPS_week % 1024; //Necessary due to the increase of WN bits in CNAV message (10 in GPS NAV and 13 in CNAV)
|
||||
@@ -311,17 +311,17 @@ bool hybrid_ls_pvt::get_PVT(std::map<int, Gnss_Synchro> gnss_observables_map, do
|
||||
DLOG(INFO) << " Executing Bancroft algorithm...";
|
||||
rx_position_and_time = bancroftPos(satpos.t(), obs);
|
||||
this->set_rx_pos(rx_position_and_time.rows(0, 2)); // save ECEF position for the next iteration
|
||||
this->set_time_offset_s(rx_position_and_time(3) / GPS_C_m_s); // save time for the next iteration [meters]->[seconds]
|
||||
this->set_time_offset_s(rx_position_and_time(3) / GPS_C_M_S); // save time for the next iteration [meters]->[seconds]
|
||||
}
|
||||
|
||||
// Execute WLS using previous position as the initialization point
|
||||
rx_position_and_time = leastSquarePos(satpos, obs, W);
|
||||
|
||||
this->set_rx_pos(rx_position_and_time.rows(0, 2)); // save ECEF position for the next iteration
|
||||
this->set_time_offset_s(this->get_time_offset_s() + rx_position_and_time(3) / GPS_C_m_s); // accumulate the rx time error for the next iteration [meters]->[seconds]
|
||||
this->set_time_offset_s(this->get_time_offset_s() + rx_position_and_time(3) / GPS_C_M_S); // accumulate the rx time error for the next iteration [meters]->[seconds]
|
||||
|
||||
DLOG(INFO) << "Hybrid Position at TOW=" << hybrid_current_time << " in ECEF (X,Y,Z,t[meters]) = " << rx_position_and_time;
|
||||
DLOG(INFO) << "Accumulated rx clock error=" << this->get_time_offset_s() << " clock error for this iteration=" << rx_position_and_time(3) / GPS_C_m_s << " [s]";
|
||||
DLOG(INFO) << "Accumulated rx clock error=" << this->get_time_offset_s() << " clock error for this iteration=" << rx_position_and_time(3) / GPS_C_M_S << " [s]";
|
||||
|
||||
// Compute GST and Gregorian time
|
||||
if (GST != 0.0)
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
/*!
|
||||
* \brief This class implements a simple PVT Least Squares solution
|
||||
*/
|
||||
class hybrid_ls_pvt : public Ls_Pvt
|
||||
class Hybrid_Ls_Pvt : public Ls_Pvt
|
||||
{
|
||||
private:
|
||||
int count_valid_position;
|
||||
@@ -57,10 +57,10 @@ private:
|
||||
double d_galileo_current_time;
|
||||
|
||||
public:
|
||||
hybrid_ls_pvt(int nchannels, std::string dump_filename, bool flag_dump_to_file);
|
||||
~hybrid_ls_pvt();
|
||||
Hybrid_Ls_Pvt(int nchannels, std::string dump_filename, bool flag_dump_to_file);
|
||||
~Hybrid_Ls_Pvt();
|
||||
|
||||
bool get_PVT(std::map<int, Gnss_Synchro> gnss_observables_map, double Rx_time, bool flag_averaging);
|
||||
bool get_PVT(std::map<int, Gnss_Synchro> gnss_observables_map, double hybrid_current_time, bool flag_averaging);
|
||||
|
||||
std::map<int, Galileo_Ephemeris> galileo_ephemeris_map; //!< Map storing new Galileo_Ephemeris
|
||||
std::map<int, Gps_Ephemeris> gps_ephemeris_map; //!< Map storing new GPS_Ephemeris
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include <boost/filesystem/path.hpp> // for path, operator<<
|
||||
#include <boost/filesystem/path_traits.hpp> // for filesystem
|
||||
#include <glog/logging.h>
|
||||
#include <exception>
|
||||
#include <sstream>
|
||||
|
||||
using google::LogMessage;
|
||||
@@ -211,7 +212,7 @@ bool Kml_Printer::set_headers(const std::string& filename, bool time_tag_name)
|
||||
}
|
||||
|
||||
|
||||
bool Kml_Printer::print_position(const std::shared_ptr<rtklib_solver>& position, bool print_average_values)
|
||||
bool Kml_Printer::print_position(const std::shared_ptr<Rtklib_Solver>& position, bool print_average_values)
|
||||
{
|
||||
double latitude;
|
||||
double longitude;
|
||||
@@ -219,7 +220,7 @@ bool Kml_Printer::print_position(const std::shared_ptr<rtklib_solver>& position,
|
||||
|
||||
positions_printed = true;
|
||||
|
||||
const std::shared_ptr<rtklib_solver>& position_ = position;
|
||||
const std::shared_ptr<Rtklib_Solver>& position_ = position;
|
||||
|
||||
double speed_over_ground = position_->get_speed_over_ground(); // expressed in m/s
|
||||
double course_over_ground = position_->get_course_over_ground(); // expressed in deg
|
||||
@@ -228,7 +229,10 @@ bool Kml_Printer::print_position(const std::shared_ptr<rtklib_solver>& position,
|
||||
double vdop = position_->get_vdop();
|
||||
double pdop = position_->get_pdop();
|
||||
std::string utc_time = to_iso_extended_string(position_->get_position_UTC_time());
|
||||
if (utc_time.length() < 23) utc_time += ".";
|
||||
if (utc_time.length() < 23)
|
||||
{
|
||||
utc_time += ".";
|
||||
}
|
||||
utc_time.resize(23, '0'); // time up to ms
|
||||
utc_time.append("Z"); // UTC time zone
|
||||
|
||||
@@ -319,9 +323,19 @@ bool Kml_Printer::close_file()
|
||||
|
||||
Kml_Printer::~Kml_Printer()
|
||||
{
|
||||
close_file();
|
||||
try
|
||||
{
|
||||
close_file();
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
std::cerr << e.what() << '\n';
|
||||
}
|
||||
if (!positions_printed)
|
||||
{
|
||||
if (remove(kml_filename.c_str()) != 0) LOG(INFO) << "Error deleting temporary KML file";
|
||||
if (remove(kml_filename.c_str()) != 0)
|
||||
{
|
||||
LOG(INFO) << "Error deleting temporary KML file";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
Kml_Printer(const std::string& base_path = std::string("."));
|
||||
~Kml_Printer();
|
||||
bool set_headers(const std::string& filename, bool time_tag_name = true);
|
||||
bool print_position(const std::shared_ptr<rtklib_solver>& position, bool print_average_values);
|
||||
bool print_position(const std::shared_ptr<Rtklib_Solver>& position, bool print_average_values);
|
||||
bool close_file();
|
||||
};
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ arma::vec Ls_Pvt::bancroftPos(const arma::mat& satpos, const arma::vec& obs)
|
||||
{
|
||||
int z = B(i, 2);
|
||||
double rho = (x - pos(0)) * (x - pos(0)) + (y - pos(1)) * (y - pos(1)) + (z - pos(2)) * (z - pos(2));
|
||||
traveltime = sqrt(rho) / GPS_C_m_s;
|
||||
traveltime = sqrt(rho) / GPS_C_M_S;
|
||||
}
|
||||
double angle = traveltime * 7.292115147e-5;
|
||||
double cosa = cos(angle);
|
||||
@@ -228,7 +228,7 @@ arma::vec Ls_Pvt::leastSquarePos(const arma::mat& satpos, const arma::vec& obs,
|
||||
(X(1, i) - pos(1)) +
|
||||
(X(2, i) - pos(2)) *
|
||||
(X(2, i) - pos(2));
|
||||
traveltime = sqrt(rho2) / GPS_C_m_s;
|
||||
traveltime = sqrt(rho2) / GPS_C_M_S;
|
||||
|
||||
//--- Correct satellite position (do to earth rotation) --------
|
||||
Rot_X = Ls_Pvt::rotateSatellite(traveltime, X.col(i)); //armadillo
|
||||
@@ -253,7 +253,10 @@ arma::vec Ls_Pvt::leastSquarePos(const arma::mat& satpos, const arma::vec& obs,
|
||||
{
|
||||
//--- Find delay due to troposphere (in meters)
|
||||
Ls_Pvt::tropo(&trop, sin(*elev * GPS_PI / 180.0), h / 1000.0, 1013.0, 293.0, 50.0, 0.0, 0.0, 0.0);
|
||||
if (trop > 5.0) trop = 0.0; //check for erratic values
|
||||
if (trop > 5.0)
|
||||
{
|
||||
trop = 0.0; //check for erratic values
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -280,9 +283,9 @@ arma::vec Ls_Pvt::leastSquarePos(const arma::mat& satpos, const arma::vec& obs,
|
||||
}
|
||||
|
||||
// check the consistency of the PVT solution
|
||||
if (((fabs(pos(3)) * 1000.0) / GPS_C_m_s) > GPS_STARTOFFSET_ms * 2)
|
||||
if (((fabs(pos(3)) * 1000.0) / GPS_C_M_S) > GPS_STARTOFFSET_MS * 2)
|
||||
{
|
||||
LOG(WARNING) << "Receiver time offset out of range! Estimated RX Time error [s]:" << pos(3) / GPS_C_m_s;
|
||||
LOG(WARNING) << "Receiver time offset out of range! Estimated RX Time error [s]:" << pos(3) / GPS_C_M_S;
|
||||
throw std::runtime_error("Receiver time offset out of range!");
|
||||
}
|
||||
return pos;
|
||||
|
||||
@@ -28,8 +28,8 @@
|
||||
* -------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef MONITOR_PVT_H_
|
||||
#define MONITOR_PVT_H_
|
||||
#ifndef GNSS_SDR_MONITOR_PVT_H_
|
||||
#define GNSS_SDR_MONITOR_PVT_H_
|
||||
|
||||
#include <boost/serialization/nvp.hpp>
|
||||
#include <cstdint>
|
||||
@@ -137,4 +137,4 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
#endif /* MONITOR_PVT_H_ */
|
||||
#endif /* GNSS_SDR_MONITOR_PVT_H_ */
|
||||
|
||||
@@ -31,27 +31,56 @@
|
||||
|
||||
#include "monitor_pvt_udp_sink.h"
|
||||
#include <boost/archive/binary_oarchive.hpp>
|
||||
//#include <boost/serialization/vector.hpp>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
|
||||
Monitor_Pvt_Udp_Sink::Monitor_Pvt_Udp_Sink(std::vector<std::string> addresses, const uint16_t& port) : socket{io_service}
|
||||
{
|
||||
for (auto address : addresses)
|
||||
for (const auto& address : addresses)
|
||||
{
|
||||
boost::asio::ip::udp::endpoint endpoint(boost::asio::ip::address::from_string(address, error), port);
|
||||
endpoints.push_back(endpoint);
|
||||
}
|
||||
monitor_pvt.TOW_at_current_symbol_ms = 0U;
|
||||
monitor_pvt.week = 0U;
|
||||
monitor_pvt.RX_time = 0.0;
|
||||
monitor_pvt.user_clk_offset = 0.0;
|
||||
monitor_pvt.pos_x = 0.0;
|
||||
monitor_pvt.pos_y = 0.0;
|
||||
monitor_pvt.pos_z = 0.0;
|
||||
monitor_pvt.vel_x = 0.0;
|
||||
monitor_pvt.vel_y = 0.0;
|
||||
monitor_pvt.vel_z = 0.0;
|
||||
monitor_pvt.cov_xx = 0.0;
|
||||
monitor_pvt.cov_yy = 0.0;
|
||||
monitor_pvt.cov_zz = 0.0;
|
||||
monitor_pvt.cov_xy = 0.0;
|
||||
monitor_pvt.cov_yz = 0.0;
|
||||
monitor_pvt.cov_zx = 0.0;
|
||||
monitor_pvt.latitude = 0.0;
|
||||
monitor_pvt.longitude = 0.0;
|
||||
monitor_pvt.height = 0.0;
|
||||
monitor_pvt.valid_sats = 0;
|
||||
monitor_pvt.solution_status = 0;
|
||||
monitor_pvt.solution_type = 0;
|
||||
monitor_pvt.AR_ratio_factor = 0.0;
|
||||
monitor_pvt.AR_ratio_threshold = 0.0;
|
||||
monitor_pvt.gdop = 0.0;
|
||||
monitor_pvt.pdop = 0.0;
|
||||
monitor_pvt.hdop = 0.0;
|
||||
monitor_pvt.vdop = 0.0;
|
||||
}
|
||||
|
||||
bool Monitor_Pvt_Udp_Sink::write_monitor_pvt(Monitor_Pvt monitor_pvt)
|
||||
|
||||
bool Monitor_Pvt_Udp_Sink::write_monitor_pvt(const Monitor_Pvt& monitor_pvt)
|
||||
{
|
||||
std::ostringstream archive_stream;
|
||||
boost::archive::binary_oarchive oa{archive_stream};
|
||||
oa << monitor_pvt;
|
||||
std::string outbound_data = archive_stream.str();
|
||||
|
||||
for (auto endpoint : endpoints)
|
||||
for (const auto& endpoint : endpoints)
|
||||
{
|
||||
socket.open(endpoint.protocol(), error);
|
||||
socket.connect(endpoint, error);
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
* -------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef MONITOR_PVT_UDP_SINK_H_
|
||||
#define MONITOR_PVT_UDP_SINK_H_
|
||||
#ifndef GNSS_SDR_MONITOR_PVT_UDP_SINK_H_
|
||||
#define GNSS_SDR_MONITOR_PVT_UDP_SINK_H_
|
||||
|
||||
#include "monitor_pvt.h"
|
||||
#include <boost/asio.hpp>
|
||||
@@ -39,7 +39,7 @@ class Monitor_Pvt_Udp_Sink
|
||||
{
|
||||
public:
|
||||
Monitor_Pvt_Udp_Sink(std::vector<std::string> addresses, const uint16_t &port);
|
||||
bool write_monitor_pvt(Monitor_Pvt monitor_pvt);
|
||||
bool write_monitor_pvt(const Monitor_Pvt &monitor_pvt);
|
||||
|
||||
private:
|
||||
boost::asio::io_service io_service;
|
||||
@@ -50,4 +50,4 @@ private:
|
||||
};
|
||||
|
||||
|
||||
#endif /* MONITOR_PVT_UDP_SINK_H_ */
|
||||
#endif /* GNSS_SDR_MONITOR_PVT_UDP_SINK_H_ */
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
#include <boost/filesystem/path_traits.hpp> // for filesystem
|
||||
#include <glog/logging.h>
|
||||
#include <cstdint>
|
||||
#include <exception>
|
||||
#include <fcntl.h>
|
||||
#include <termios.h>
|
||||
|
||||
@@ -118,11 +119,29 @@ Nmea_Printer::Nmea_Printer(const std::string& filename, bool flag_nmea_output_fi
|
||||
|
||||
Nmea_Printer::~Nmea_Printer()
|
||||
{
|
||||
if (nmea_file_descriptor.is_open())
|
||||
try
|
||||
{
|
||||
nmea_file_descriptor.close();
|
||||
if (nmea_file_descriptor.is_open())
|
||||
{
|
||||
nmea_file_descriptor.close();
|
||||
}
|
||||
}
|
||||
catch (const std::ofstream::failure& e)
|
||||
{
|
||||
std::cerr << "Problem closing NMEA dump file: " << nmea_filename << '\n';
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
std::cerr << e.what() << '\n';
|
||||
}
|
||||
try
|
||||
{
|
||||
close_serial();
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
std::cerr << e.what() << '\n';
|
||||
}
|
||||
close_serial();
|
||||
}
|
||||
|
||||
|
||||
@@ -142,10 +161,16 @@ int Nmea_Printer::init_serial(const std::string& serial_device)
|
||||
int64_t PARITY;
|
||||
|
||||
fd = open(serial_device.c_str(), O_RDWR | O_NOCTTY | O_NDELAY | O_CLOEXEC);
|
||||
if (fd == -1) return fd; // failed to open TTY port
|
||||
if (fd == -1)
|
||||
{
|
||||
return fd; // failed to open TTY port
|
||||
}
|
||||
|
||||
if (fcntl(fd, F_SETFL, 0) == -1) LOG(INFO) << "Error enabling direct I/O"; // clear all flags on descriptor, enable direct I/O
|
||||
tcgetattr(fd, &options); // read serial port options
|
||||
if (fcntl(fd, F_SETFL, 0) == -1)
|
||||
{
|
||||
LOG(INFO) << "Error enabling direct I/O"; // clear all flags on descriptor, enable direct I/O
|
||||
}
|
||||
tcgetattr(fd, &options); // read serial port options
|
||||
|
||||
BAUD = B9600;
|
||||
// BAUD = B38400;
|
||||
@@ -174,7 +199,7 @@ void Nmea_Printer::close_serial()
|
||||
}
|
||||
|
||||
|
||||
bool Nmea_Printer::Print_Nmea_Line(const std::shared_ptr<rtklib_solver>& pvt_data, bool print_average_values)
|
||||
bool Nmea_Printer::Print_Nmea_Line(const std::shared_ptr<Rtklib_Solver>& pvt_data, bool print_average_values)
|
||||
{
|
||||
std::string GPRMC;
|
||||
std::string GPGGA;
|
||||
@@ -348,13 +373,22 @@ std::string Nmea_Printer::get_UTC_NMEA_time(boost::posix_time::ptime d_position_
|
||||
utc_seconds = td.seconds();
|
||||
utc_milliseconds = td.total_milliseconds() - td.total_seconds() * 1000;
|
||||
|
||||
if (utc_hours < 10) sentence_str << "0"; // two digits for hours
|
||||
if (utc_hours < 10)
|
||||
{
|
||||
sentence_str << "0"; // two digits for hours
|
||||
}
|
||||
sentence_str << utc_hours;
|
||||
|
||||
if (utc_mins < 10) sentence_str << "0"; // two digits for minutes
|
||||
if (utc_mins < 10)
|
||||
{
|
||||
sentence_str << "0"; // two digits for minutes
|
||||
}
|
||||
sentence_str << utc_mins;
|
||||
|
||||
if (utc_seconds < 10) sentence_str << "0"; // two digits for seconds
|
||||
if (utc_seconds < 10)
|
||||
{
|
||||
sentence_str << "0"; // two digits for seconds
|
||||
}
|
||||
sentence_str << utc_seconds;
|
||||
|
||||
if (utc_milliseconds < 10)
|
||||
|
||||
@@ -59,7 +59,7 @@ public:
|
||||
/*!
|
||||
* \brief Print NMEA PVT and satellite info to the initialized device
|
||||
*/
|
||||
bool Print_Nmea_Line(const std::shared_ptr<rtklib_solver>& pvt_data, bool print_average_values);
|
||||
bool Print_Nmea_Line(const std::shared_ptr<Rtklib_Solver>& pvt_data, bool print_average_values);
|
||||
|
||||
/*!
|
||||
* \brief Default destructor.
|
||||
@@ -72,7 +72,7 @@ private:
|
||||
std::ofstream nmea_file_descriptor; // Output file stream for NMEA log file
|
||||
std::string nmea_devname;
|
||||
int nmea_dev_descriptor; // NMEA serial device descriptor (i.e. COM port)
|
||||
std::shared_ptr<rtklib_solver> d_PVT_data;
|
||||
std::shared_ptr<Rtklib_Solver> d_PVT_data;
|
||||
int init_serial(const std::string& serial_device); //serial port control
|
||||
void close_serial();
|
||||
std::string get_GPGGA(); // fix data
|
||||
|
||||
@@ -67,4 +67,7 @@ Pvt_Conf::Pvt_Conf()
|
||||
kml_output_path = std::string(".");
|
||||
xml_output_path = std::string(".");
|
||||
rtcm_output_file_path = std::string(".");
|
||||
|
||||
monitor_enabled = false;
|
||||
udp_port = 0;
|
||||
}
|
||||
|
||||
@@ -37,8 +37,6 @@
|
||||
#include <boost/date_time/posix_time/posix_time.hpp>
|
||||
#include <deque>
|
||||
|
||||
const unsigned int PVT_MAX_CHANNELS = 90;
|
||||
const unsigned int PVT_MAX_PRN = 127; // 126 is SBAS
|
||||
|
||||
/*!
|
||||
* \brief Base class for a PVT solution
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -186,17 +186,17 @@ public:
|
||||
/*!
|
||||
* \brief Generates the Mixed (GPS L1 C/A /GLONASS) Observation data header. Example: galileo_bands("1C"), galileo_bands("1B 5X"), galileo_bands("5X"), ... Default: "1B".
|
||||
*/
|
||||
void rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string& glo_bands = "1C");
|
||||
void rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string& glonass_bands = "1C");
|
||||
|
||||
/*!
|
||||
* \brief Generates the Mixed (Galileo/GLONASS) Observation data header. Example: galileo_bands("1C"), galileo_bands("1B 5X"), galileo_bands("5X"), ... Default: "1B".
|
||||
*/
|
||||
void rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& galileo_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string& galileo_bands = "1B", const std::string& glo_bands = "1C");
|
||||
void rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& galileo_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string& galileo_bands = "1B", const std::string& glonass_bands = "1C");
|
||||
|
||||
/*!
|
||||
* \brief Generates the Mixed (GPS L2C/GLONASS) Observation data header. Example: galileo_bands("1G")... Default: "1G".
|
||||
*/
|
||||
void rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris& gps_cnav_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string& glo_bands = "1G");
|
||||
void rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris& gps_cnav_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string& glonass_bands = "1G");
|
||||
|
||||
/*!
|
||||
* \brief Generates the a Beidou B1I Observation data header. Example: beidou_bands("B1")
|
||||
@@ -351,12 +351,12 @@ public:
|
||||
/*!
|
||||
* \brief Writes Mixed GPS L2C - GLONASS observables into the RINEX file
|
||||
*/
|
||||
void log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& gps_cnav_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double gps_obs_time, const std::map<int32_t, Gnss_Synchro>& observables);
|
||||
void log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& gps_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double gps_obs_time, const std::map<int32_t, Gnss_Synchro>& observables);
|
||||
|
||||
/*!
|
||||
* \brief Writes Mixed Galileo/GLONASS observables into the RINEX file
|
||||
*/
|
||||
void log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& galileo_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double gps_obs_time, const std::map<int32_t, Gnss_Synchro>& observables);
|
||||
void log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& galileo_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double galileo_obs_time, const std::map<int32_t, Gnss_Synchro>& observables);
|
||||
|
||||
/*!
|
||||
* \brief Writes BDS B1I observables into the RINEX file
|
||||
@@ -374,7 +374,7 @@ public:
|
||||
*/
|
||||
//void log_rinex_sbs(std::fstream & out, const Sbas_Raw_Msg & sbs_message);
|
||||
|
||||
void update_nav_header(std::fstream& out, const Gps_Utc_Model& gps_utc, const Gps_Iono& gps_iono);
|
||||
void update_nav_header(std::fstream& out, const Gps_Utc_Model& utc_model, const Gps_Iono& gps_iono);
|
||||
|
||||
void update_nav_header(std::fstream& out, const Gps_CNAV_Utc_Model& utc_model, const Gps_CNAV_Iono& iono);
|
||||
|
||||
@@ -388,11 +388,11 @@ public:
|
||||
|
||||
void update_nav_header(std::fstream& out, const Gps_Iono& gps_iono, const Gps_Utc_Model& gps_utc, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac);
|
||||
|
||||
void update_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps_cnav_iono, const Gps_CNAV_Utc_Model& gps_cnav_utc, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac);
|
||||
void update_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps_iono, const Gps_CNAV_Utc_Model& gps_utc_model, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac);
|
||||
|
||||
void update_nav_header(std::fstream& out, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& galileo_utc_model, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac);
|
||||
|
||||
void update_nav_header(std::fstream& out, const Beidou_Dnav_Utc_Model& beidou_dnav_utc, const Beidou_Dnav_Iono& beidou_dnav_iono);
|
||||
void update_nav_header(std::fstream& out, const Beidou_Dnav_Utc_Model& utc_model, const Beidou_Dnav_Iono& beidou_dnav_iono);
|
||||
|
||||
void update_obs_header(std::fstream& out, const Gps_Utc_Model& utc_model);
|
||||
|
||||
@@ -676,8 +676,15 @@ inline std::string Rinex_Printer::doub2for(const double& d,
|
||||
short exponentLength = expLen;
|
||||
|
||||
/* Validate the assumptions regarding the input arguments */
|
||||
if (exponentLength < 0) exponentLength = 1;
|
||||
if (exponentLength > 3 && checkSwitch) exponentLength = 3;
|
||||
if (exponentLength < 0)
|
||||
{
|
||||
exponentLength = 1;
|
||||
}
|
||||
|
||||
if (exponentLength > 3 && checkSwitch)
|
||||
{
|
||||
exponentLength = 3;
|
||||
}
|
||||
|
||||
std::string toReturn = doub2sci(d, length, exponentLength, true, checkSwitch);
|
||||
sci2for(toReturn, 0, length, exponentLength, checkSwitch);
|
||||
@@ -696,8 +703,15 @@ inline std::string Rinex_Printer::doub2sci(const double& d,
|
||||
short exponentLength = expLen;
|
||||
|
||||
/* Validate the assumptions regarding the input arguments */
|
||||
if (exponentLength < 0) exponentLength = 1;
|
||||
if (exponentLength > 3 && checkSwitch) exponentLength = 3;
|
||||
if (exponentLength < 0)
|
||||
{
|
||||
exponentLength = 1;
|
||||
}
|
||||
|
||||
if (exponentLength > 3 && checkSwitch)
|
||||
{
|
||||
exponentLength = 3;
|
||||
}
|
||||
|
||||
std::stringstream c;
|
||||
c.setf(std::ios::scientific, std::ios::floatfield);
|
||||
@@ -709,7 +723,10 @@ inline std::string Rinex_Printer::doub2sci(const double& d,
|
||||
// an extra -1 for '-' or ' ' if it's positive or negative
|
||||
int expSize = 0;
|
||||
if (showSign)
|
||||
expSize = 1;
|
||||
{
|
||||
expSize = 1;
|
||||
}
|
||||
|
||||
c.precision(length - 3 - exponentLength - 1 - expSize);
|
||||
c << d;
|
||||
c >> toReturn;
|
||||
@@ -751,7 +768,9 @@ inline std::string& Rinex_Printer::sci2for(std::string& aStr,
|
||||
aStr[idx - 1] = '.';
|
||||
// Only add one to the exponent if the number is non-zero
|
||||
if (asDouble(aStr.substr(startPos, length)) != 0.0)
|
||||
expAdd = 1;
|
||||
{
|
||||
expAdd = 1;
|
||||
}
|
||||
}
|
||||
|
||||
idx = aStr.find('e', startPos);
|
||||
@@ -766,9 +785,13 @@ inline std::string& Rinex_Printer::sci2for(std::string& aStr,
|
||||
|
||||
// Change the exponent character to D normally, or E of checkSwitch is false.
|
||||
if (checkSwitch)
|
||||
aStr[idx] = 'D';
|
||||
{
|
||||
aStr[idx] = 'D';
|
||||
}
|
||||
else
|
||||
aStr[idx] = 'E';
|
||||
{
|
||||
aStr[idx] = 'E';
|
||||
}
|
||||
|
||||
// Change the exponent itself
|
||||
if (redoexp)
|
||||
@@ -784,7 +807,10 @@ inline std::string& Rinex_Printer::sci2for(std::string& aStr,
|
||||
iexp -= iexp * 2;
|
||||
}
|
||||
else
|
||||
aStr += "+";
|
||||
{
|
||||
aStr += "+";
|
||||
}
|
||||
|
||||
aStr += Rinex_Printer::rightJustify(asString(iexp), expLen, '0');
|
||||
}
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
#include <boost/filesystem/path_traits.hpp> // for filesystem
|
||||
#include <glog/logging.h>
|
||||
#include <cstdint>
|
||||
#include <exception>
|
||||
#include <fcntl.h> // for O_RDWR
|
||||
#include <iomanip>
|
||||
#include <termios.h> // for tcgetattr
|
||||
@@ -190,13 +191,30 @@ Rtcm_Printer::~Rtcm_Printer()
|
||||
{
|
||||
int64_t pos;
|
||||
pos = rtcm_file_descriptor.tellp();
|
||||
rtcm_file_descriptor.close();
|
||||
try
|
||||
{
|
||||
rtcm_file_descriptor.close();
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
std::cerr << e.what() << '\n';
|
||||
}
|
||||
if (pos == 0)
|
||||
{
|
||||
if (remove(rtcm_filename.c_str()) != 0) LOG(INFO) << "Error deleting temporary RTCM file";
|
||||
if (remove(rtcm_filename.c_str()) != 0)
|
||||
{
|
||||
LOG(INFO) << "Error deleting temporary RTCM file";
|
||||
}
|
||||
}
|
||||
}
|
||||
close_serial();
|
||||
try
|
||||
{
|
||||
close_serial();
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
std::cerr << e.what() << '\n';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -353,10 +371,16 @@ int Rtcm_Printer::init_serial(const std::string& serial_device)
|
||||
int64_t PARITY;
|
||||
|
||||
fd = open(serial_device.c_str(), O_RDWR | O_NOCTTY | O_NDELAY | O_CLOEXEC);
|
||||
if (fd == -1) return fd; // failed to open TTY port
|
||||
if (fd == -1)
|
||||
{
|
||||
return fd; // failed to open TTY port
|
||||
}
|
||||
|
||||
if (fcntl(fd, F_SETFL, 0) == -1) LOG(INFO) << "Error enabling direct I/O"; // clear all flags on descriptor, enable direct I/O
|
||||
tcgetattr(fd, &options); // read serial port options
|
||||
if (fcntl(fd, F_SETFL, 0) == -1)
|
||||
{
|
||||
LOG(INFO) << "Error enabling direct I/O"; // clear all flags on descriptor, enable direct I/O
|
||||
}
|
||||
tcgetattr(fd, &options); // read serial port options
|
||||
|
||||
BAUD = B9600;
|
||||
//BAUD = B38400;
|
||||
|
||||
@@ -48,7 +48,7 @@ public:
|
||||
/*!
|
||||
* \brief Default constructor.
|
||||
*/
|
||||
Rtcm_Printer(const std::string& filename, bool flag_rtcm_file_dump, bool flag_rtcm_server, bool flag_rtcm_tty_port, uint16_t rtcm_tcp_port, uint16_t rtcm_station_id, const std::string& rtcm_dump_filename, bool time_tag_name = true, const std::string& base_path = ".");
|
||||
Rtcm_Printer(const std::string& filename, bool flag_rtcm_file_dump, bool flag_rtcm_server, bool flag_rtcm_tty_port, uint16_t rtcm_tcp_port, uint16_t rtcm_station_id, const std::string& rtcm_dump_devname, bool time_tag_name = true, const std::string& base_path = ".");
|
||||
|
||||
/*!
|
||||
* \brief Default destructor.
|
||||
@@ -112,7 +112,7 @@ public:
|
||||
* \param utc_model GLONASS GNAV Clock Information broadcast in string 5
|
||||
* \return true or false upon operation success
|
||||
*/
|
||||
bool Print_Rtcm_MT1020(const Glonass_Gnav_Ephemeris& glo_gnav_eph, const Glonass_Gnav_Utc_Model& utc_model);
|
||||
bool Print_Rtcm_MT1020(const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const Glonass_Gnav_Utc_Model& utc_model);
|
||||
|
||||
bool Print_Rtcm_MSM(uint32_t msm_number,
|
||||
const Gps_Ephemeris& gps_eph,
|
||||
|
||||
@@ -60,12 +60,13 @@
|
||||
#include "rtklib_solution.h"
|
||||
#include <glog/logging.h>
|
||||
#include <matio.h>
|
||||
#include <exception>
|
||||
#include <utility>
|
||||
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
rtklib_solver::rtklib_solver(int nchannels, std::string dump_filename, bool flag_dump_to_file, bool flag_dump_to_mat, const rtk_t &rtk)
|
||||
Rtklib_Solver::Rtklib_Solver(int nchannels, std::string dump_filename, bool flag_dump_to_file, bool flag_dump_to_mat, const rtk_t &rtk)
|
||||
{
|
||||
// init empty ephemeris for all the available GNSS channels
|
||||
d_nchannels = nchannels;
|
||||
@@ -75,7 +76,10 @@ rtklib_solver::rtklib_solver(int nchannels, std::string dump_filename, bool flag
|
||||
count_valid_position = 0;
|
||||
this->set_averaging_flag(false);
|
||||
rtk_ = rtk;
|
||||
for (double &i : dop_) i = 0.0;
|
||||
for (double &i : dop_)
|
||||
{
|
||||
i = 0.0;
|
||||
}
|
||||
pvt_sol = {{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};
|
||||
ssat_t ssat0 = {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}}}, {{}, {}}};
|
||||
for (auto &i : pvt_ssat)
|
||||
@@ -89,19 +93,48 @@ rtklib_solver::rtklib_solver(int nchannels, std::string dump_filename, bool flag
|
||||
{
|
||||
try
|
||||
{
|
||||
d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit);
|
||||
d_dump_file.exceptions(std::ofstream::failbit | std::ofstream::badbit);
|
||||
d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary);
|
||||
LOG(INFO) << "PVT lib dump enabled Log file: " << d_dump_filename.c_str();
|
||||
}
|
||||
catch (const std::ifstream::failure &e)
|
||||
catch (const std::ofstream::failure &e)
|
||||
{
|
||||
LOG(WARNING) << "Exception opening RTKLIB dump file " << e.what();
|
||||
}
|
||||
}
|
||||
}
|
||||
// PVT MONITOR
|
||||
monitor_pvt.TOW_at_current_symbol_ms = 0U;
|
||||
monitor_pvt.week = 0U;
|
||||
monitor_pvt.RX_time = 0.0;
|
||||
monitor_pvt.user_clk_offset = 0.0;
|
||||
monitor_pvt.pos_x = 0.0;
|
||||
monitor_pvt.pos_y = 0.0;
|
||||
monitor_pvt.pos_z = 0.0;
|
||||
monitor_pvt.vel_x = 0.0;
|
||||
monitor_pvt.vel_y = 0.0;
|
||||
monitor_pvt.vel_z = 0.0;
|
||||
monitor_pvt.cov_xx = 0.0;
|
||||
monitor_pvt.cov_yy = 0.0;
|
||||
monitor_pvt.cov_zz = 0.0;
|
||||
monitor_pvt.cov_xy = 0.0;
|
||||
monitor_pvt.cov_yz = 0.0;
|
||||
monitor_pvt.cov_zx = 0.0;
|
||||
monitor_pvt.latitude = 0.0;
|
||||
monitor_pvt.longitude = 0.0;
|
||||
monitor_pvt.height = 0.0;
|
||||
monitor_pvt.valid_sats = 0;
|
||||
monitor_pvt.solution_status = 0;
|
||||
monitor_pvt.solution_type = 0;
|
||||
monitor_pvt.AR_ratio_factor = 0.0;
|
||||
monitor_pvt.AR_ratio_threshold = 0.0;
|
||||
monitor_pvt.gdop = 0.0;
|
||||
monitor_pvt.pdop = 0.0;
|
||||
monitor_pvt.hdop = 0.0;
|
||||
monitor_pvt.vdop = 0.0;
|
||||
}
|
||||
|
||||
bool rtklib_solver::save_matfile()
|
||||
bool Rtklib_Solver::save_matfile()
|
||||
{
|
||||
// READ DUMP FILE
|
||||
std::string dump_filename = d_dump_filename;
|
||||
@@ -397,7 +430,8 @@ bool rtklib_solver::save_matfile()
|
||||
return true;
|
||||
}
|
||||
|
||||
rtklib_solver::~rtklib_solver()
|
||||
|
||||
Rtklib_Solver::~Rtklib_Solver()
|
||||
{
|
||||
if (d_dump_file.is_open() == true)
|
||||
{
|
||||
@@ -412,40 +446,47 @@ rtklib_solver::~rtklib_solver()
|
||||
}
|
||||
if (d_flag_dump_mat_enabled)
|
||||
{
|
||||
save_matfile();
|
||||
try
|
||||
{
|
||||
save_matfile();
|
||||
}
|
||||
catch (const std::exception &ex)
|
||||
{
|
||||
LOG(WARNING) << "Exception in destructor saving the PVT .mat dump file " << ex.what();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
double rtklib_solver::get_gdop() const
|
||||
double Rtklib_Solver::get_gdop() const
|
||||
{
|
||||
return dop_[0];
|
||||
}
|
||||
|
||||
|
||||
double rtklib_solver::get_pdop() const
|
||||
double Rtklib_Solver::get_pdop() const
|
||||
{
|
||||
return dop_[1];
|
||||
}
|
||||
|
||||
|
||||
double rtklib_solver::get_hdop() const
|
||||
double Rtklib_Solver::get_hdop() const
|
||||
{
|
||||
return dop_[2];
|
||||
}
|
||||
|
||||
|
||||
double rtklib_solver::get_vdop() const
|
||||
double Rtklib_Solver::get_vdop() const
|
||||
{
|
||||
return dop_[3];
|
||||
}
|
||||
|
||||
Monitor_Pvt rtklib_solver::get_monitor_pvt() const
|
||||
Monitor_Pvt Rtklib_Solver::get_monitor_pvt() const
|
||||
{
|
||||
return monitor_pvt;
|
||||
}
|
||||
|
||||
bool rtklib_solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_map, bool flag_averaging)
|
||||
bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_map, bool flag_averaging)
|
||||
{
|
||||
std::map<int, Gnss_Synchro>::const_iterator gnss_observables_iter;
|
||||
std::map<int, Galileo_Ephemeris>::const_iterator galileo_ephemeris_iter;
|
||||
@@ -496,7 +537,10 @@ bool rtklib_solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
|
||||
}
|
||||
}
|
||||
}
|
||||
if (band1 == true and band2 == true) gps_dual_band = true;
|
||||
if (band1 == true and band2 == true)
|
||||
{
|
||||
gps_dual_band = true;
|
||||
}
|
||||
|
||||
for (gnss_observables_iter = gnss_observables_map.cbegin();
|
||||
gnss_observables_iter != gnss_observables_map.cend();
|
||||
@@ -855,7 +899,10 @@ bool rtklib_solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
|
||||
}
|
||||
}
|
||||
|
||||
if (index_aux > 0) dops(index_aux, azel.data(), 0.0, dop_.data());
|
||||
if (index_aux > 0)
|
||||
{
|
||||
dops(index_aux, azel.data(), 0.0, dop_.data());
|
||||
}
|
||||
this->set_valid_position(true);
|
||||
arma::vec rx_position_and_time(4);
|
||||
rx_position_and_time(0) = pvt_sol.rr[0]; // [m]
|
||||
@@ -869,7 +916,7 @@ bool rtklib_solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
|
||||
}
|
||||
else
|
||||
{
|
||||
rx_position_and_time(3) = pvt_sol.dtr[0] / GPS_C_m_s; // the receiver clock offset is expressed in [meters], so we convert it into [s]
|
||||
rx_position_and_time(3) = pvt_sol.dtr[0] / GPS_C_M_S; // the receiver clock offset is expressed in [meters], so we convert it into [s]
|
||||
}
|
||||
this->set_rx_pos(rx_position_and_time.rows(0, 2)); // save ECEF position for the next iteration
|
||||
|
||||
@@ -884,7 +931,10 @@ bool rtklib_solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
|
||||
if (ground_speed_ms >= 1.0)
|
||||
{
|
||||
new_cog = atan2(enuv[0], enuv[1]) * R2D;
|
||||
if (new_cog < 0.0) new_cog += 360.0;
|
||||
if (new_cog < 0.0)
|
||||
{
|
||||
new_cog += 360.0;
|
||||
}
|
||||
this->set_course_over_ground(new_cog);
|
||||
}
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
/*!
|
||||
* \brief This class implements a simple PVT Least Squares solution
|
||||
*/
|
||||
class rtklib_solver : public Pvt_Solution
|
||||
class Rtklib_Solver : public Pvt_Solution
|
||||
{
|
||||
private:
|
||||
rtk_t rtk_;
|
||||
@@ -91,8 +91,8 @@ private:
|
||||
public:
|
||||
sol_t pvt_sol;
|
||||
ssat_t pvt_ssat[MAXSAT];
|
||||
rtklib_solver(int nchannels, std::string dump_filename, bool flag_dump_to_file, bool flag_dump_to_mat, const rtk_t& rtk);
|
||||
~rtklib_solver();
|
||||
Rtklib_Solver(int nchannels, std::string dump_filename, bool flag_dump_to_file, bool flag_dump_to_mat, const rtk_t& rtk);
|
||||
~Rtklib_Solver();
|
||||
|
||||
bool get_PVT(const std::map<int, Gnss_Synchro>& gnss_observables_map, bool flag_averaging);
|
||||
double get_hdop() const;
|
||||
|
||||
@@ -91,25 +91,38 @@ list(SORT ACQ_ADAPTER_SOURCES)
|
||||
|
||||
source_group(Headers FILES ${ACQ_ADAPTER_HEADERS})
|
||||
|
||||
add_library(acq_adapters ${ACQ_ADAPTER_SOURCES} ${ACQ_ADAPTER_HEADERS})
|
||||
add_library(acquisition_adapters ${ACQ_ADAPTER_SOURCES} ${ACQ_ADAPTER_HEADERS})
|
||||
|
||||
target_link_libraries(acq_adapters
|
||||
target_link_libraries(acquisition_adapters
|
||||
PUBLIC
|
||||
gnss_sp_libs
|
||||
gnss_sdr_flags
|
||||
acq_gr_blocks
|
||||
rx_core_lib
|
||||
Gnuradio::blocks
|
||||
gnss_system_parameters
|
||||
algorithms_libs
|
||||
gnss_sdr_flags
|
||||
acquisition_gr_blocks
|
||||
core_system_parameters
|
||||
PRIVATE
|
||||
Boost::boost
|
||||
Gflags::gflags
|
||||
Glog::glog
|
||||
Volkgnsssdr::volkgnsssdr
|
||||
acquisition_lib
|
||||
acquisition_libs
|
||||
)
|
||||
|
||||
set_property(TARGET acq_adapters
|
||||
target_include_directories(acquisition_adapters
|
||||
PUBLIC
|
||||
${CMAKE_SOURCE_DIR}/src/core/interfaces
|
||||
)
|
||||
|
||||
if(ENABLE_CLANG_TIDY)
|
||||
if(CLANG_TIDY_EXE)
|
||||
set_target_properties(acquisition_adapters
|
||||
PROPERTIES
|
||||
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set_property(TARGET acquisition_adapters
|
||||
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
)
|
||||
|
||||
@@ -68,7 +68,10 @@ BeidouB1iPcpsAcquisition::BeidouB1iPcpsAcquisition(
|
||||
blocking_ = configuration_->property(role + ".blocking", true);
|
||||
acq_parameters.blocking = blocking_;
|
||||
doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
|
||||
if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max;
|
||||
if (FLAGS_doppler_max != 0)
|
||||
{
|
||||
doppler_max_ = FLAGS_doppler_max;
|
||||
}
|
||||
acq_parameters.doppler_max = doppler_max_;
|
||||
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1);
|
||||
acq_parameters.sampled_ms = sampled_ms_;
|
||||
@@ -81,7 +84,7 @@ BeidouB1iPcpsAcquisition::BeidouB1iPcpsAcquisition(
|
||||
dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename);
|
||||
acq_parameters.dump_filename = dump_filename_;
|
||||
//--- Find number of samples per spreading code -------------------------
|
||||
code_length_ = static_cast<unsigned int>(std::round(static_cast<double>(fs_in_) / (BEIDOU_B1I_CODE_RATE_HZ / BEIDOU_B1I_CODE_LENGTH_CHIPS)));
|
||||
code_length_ = static_cast<uint32_t>(std::round(static_cast<double>(fs_in_) / (BEIDOU_B1I_CODE_RATE_HZ / BEIDOU_B1I_CODE_LENGTH_CHIPS)));
|
||||
|
||||
vector_length_ = code_length_ * sampled_ms_;
|
||||
|
||||
@@ -144,7 +147,7 @@ void BeidouB1iPcpsAcquisition::stop_acquisition()
|
||||
{
|
||||
}
|
||||
|
||||
void BeidouB1iPcpsAcquisition::set_channel(unsigned int channel)
|
||||
void BeidouB1iPcpsAcquisition::set_channel(uint32_t channel)
|
||||
{
|
||||
channel_ = channel;
|
||||
acquisition_->set_channel(channel_);
|
||||
@@ -170,7 +173,7 @@ void BeidouB1iPcpsAcquisition::set_threshold(float threshold)
|
||||
}
|
||||
|
||||
|
||||
void BeidouB1iPcpsAcquisition::set_doppler_max(unsigned int doppler_max)
|
||||
void BeidouB1iPcpsAcquisition::set_doppler_max(uint32_t doppler_max)
|
||||
{
|
||||
doppler_max_ = doppler_max;
|
||||
|
||||
@@ -178,7 +181,7 @@ void BeidouB1iPcpsAcquisition::set_doppler_max(unsigned int doppler_max)
|
||||
}
|
||||
|
||||
|
||||
void BeidouB1iPcpsAcquisition::set_doppler_step(unsigned int doppler_step)
|
||||
void BeidouB1iPcpsAcquisition::set_doppler_step(uint32_t doppler_step)
|
||||
{
|
||||
doppler_step_ = doppler_step;
|
||||
|
||||
@@ -213,7 +216,7 @@ void BeidouB1iPcpsAcquisition::set_local_code()
|
||||
|
||||
beidou_b1i_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_, 0);
|
||||
|
||||
for (unsigned int i = 0; i < sampled_ms_; i++)
|
||||
for (uint32_t i = 0; i < sampled_ms_; i++)
|
||||
{
|
||||
memcpy(&(code_[i * code_length_]), code,
|
||||
sizeof(gr_complex) * code_length_);
|
||||
@@ -239,7 +242,7 @@ void BeidouB1iPcpsAcquisition::set_state(int state)
|
||||
float BeidouB1iPcpsAcquisition::calculate_threshold(float pfa)
|
||||
{
|
||||
//Calculate the threshold
|
||||
unsigned int frequency_bins = 0;
|
||||
uint32_t frequency_bins = 0;
|
||||
/*
|
||||
for (int doppler = (int)(-doppler_max_); doppler <= (int)doppler_max_; doppler += doppler_step_)
|
||||
{
|
||||
@@ -250,7 +253,7 @@ float BeidouB1iPcpsAcquisition::calculate_threshold(float pfa)
|
||||
frequency_bins = (2 * doppler_max_ + doppler_step_) / doppler_step_;
|
||||
|
||||
DLOG(INFO) << "Channel " << channel_ << " Pfa = " << pfa;
|
||||
unsigned int ncells = vector_length_ * frequency_bins;
|
||||
uint32_t ncells = vector_length_ * frequency_bins;
|
||||
double exponent = 1 / static_cast<double>(ncells);
|
||||
double val = pow(1.0 - pfa, exponent);
|
||||
auto lambda = static_cast<double>(vector_length_);
|
||||
@@ -315,7 +318,7 @@ gr::basic_block_sptr BeidouB1iPcpsAcquisition::get_left_block()
|
||||
{
|
||||
return acquisition_;
|
||||
}
|
||||
else if (item_type_ == "cshort")
|
||||
if (item_type_ == "cshort")
|
||||
{
|
||||
return acquisition_;
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
#include <gnuradio/blocks/float_to_complex.h>
|
||||
#include <gnuradio/blocks/stream_to_vector.h>
|
||||
#include <volk_gnsssdr/volk_gnsssdr.h>
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
|
||||
|
||||
@@ -92,7 +93,7 @@ public:
|
||||
/*!
|
||||
* \brief Set acquisition channel unique ID
|
||||
*/
|
||||
void set_channel(unsigned int channel) override;
|
||||
void set_channel(uint32_t channel) override;
|
||||
|
||||
/*!
|
||||
* \brief Set statistics threshold of PCPS algorithm
|
||||
@@ -102,12 +103,12 @@ public:
|
||||
/*!
|
||||
* \brief Set maximum Doppler off grid search
|
||||
*/
|
||||
void set_doppler_max(unsigned int doppler_max) override;
|
||||
void set_doppler_max(uint32_t doppler_max) override;
|
||||
|
||||
/*!
|
||||
* \brief Set Doppler steps for the grid search
|
||||
*/
|
||||
void set_doppler_step(unsigned int doppler_step) override;
|
||||
void set_doppler_step(uint32_t doppler_step) override;
|
||||
|
||||
/*!
|
||||
* \brief Initializes acquisition algorithm.
|
||||
@@ -153,25 +154,25 @@ private:
|
||||
complex_byte_to_float_x2_sptr cbyte_to_float_x2_;
|
||||
size_t item_size_;
|
||||
std::string item_type_;
|
||||
unsigned int vector_length_;
|
||||
unsigned int code_length_;
|
||||
uint32_t vector_length_;
|
||||
uint32_t code_length_;
|
||||
bool bit_transition_flag_;
|
||||
bool use_CFAR_algorithm_flag_;
|
||||
unsigned int channel_;
|
||||
uint32_t channel_;
|
||||
float threshold_;
|
||||
unsigned int doppler_max_;
|
||||
unsigned int doppler_step_;
|
||||
unsigned int sampled_ms_;
|
||||
unsigned int max_dwells_;
|
||||
long fs_in_;
|
||||
uint32_t doppler_max_;
|
||||
uint32_t doppler_step_;
|
||||
uint32_t sampled_ms_;
|
||||
uint32_t max_dwells_;
|
||||
int64_t fs_in_;
|
||||
bool dump_;
|
||||
bool blocking_;
|
||||
std::string dump_filename_;
|
||||
std::complex<float>* code_;
|
||||
Gnss_Synchro* gnss_synchro_;
|
||||
std::string role_;
|
||||
unsigned int in_streams_;
|
||||
unsigned int out_streams_;
|
||||
uint32_t in_streams_;
|
||||
uint32_t out_streams_;
|
||||
|
||||
float calculate_threshold(float pfa);
|
||||
};
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2015 (see AUTHORS file for a list of contributors)
|
||||
* Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
@@ -24,7 +24,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2015 (see AUTHORS file for a list of contributors)
|
||||
* Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
@@ -24,7 +24,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
@@ -61,7 +61,10 @@ GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition(
|
||||
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
||||
dump_ = configuration_->property(role + ".dump", false);
|
||||
doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
|
||||
if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max;
|
||||
if (FLAGS_doppler_max != 0)
|
||||
{
|
||||
doppler_max_ = FLAGS_doppler_max;
|
||||
}
|
||||
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 4);
|
||||
|
||||
if (sampled_ms_ % 4 != 0)
|
||||
@@ -79,7 +82,7 @@ GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition(
|
||||
|
||||
//--- Find number of samples per spreading code (4 ms) -----------------
|
||||
code_length_ = round(
|
||||
fs_in_ / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS));
|
||||
fs_in_ / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS));
|
||||
|
||||
vector_length_ = code_length_ * static_cast<int>(sampled_ms_ / 4);
|
||||
|
||||
@@ -145,7 +148,10 @@ void GalileoE1Pcps8msAmbiguousAcquisition::set_threshold(float threshold)
|
||||
{
|
||||
float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0);
|
||||
|
||||
if (pfa == 0.0) pfa = configuration_->property(role_ + ".pfa", 0.0);
|
||||
if (pfa == 0.0)
|
||||
{
|
||||
pfa = configuration_->property(role_ + ".pfa", 0.0);
|
||||
}
|
||||
|
||||
if (pfa == 0.0)
|
||||
{
|
||||
|
||||
@@ -62,7 +62,10 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition(
|
||||
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
||||
acq_parameters_.fs_in = fs_in_;
|
||||
doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
|
||||
if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max;
|
||||
if (FLAGS_doppler_max != 0)
|
||||
{
|
||||
doppler_max_ = FLAGS_doppler_max;
|
||||
}
|
||||
acq_parameters_.doppler_max = doppler_max_;
|
||||
acq_parameters_.ms_per_code = 4;
|
||||
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", acq_parameters_.ms_per_code);
|
||||
@@ -95,10 +98,10 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition(
|
||||
}
|
||||
if (acq_parameters_.use_automatic_resampler)
|
||||
{
|
||||
if (acq_parameters_.fs_in > Galileo_E1_OPT_ACQ_FS_HZ)
|
||||
if (acq_parameters_.fs_in > GALILEO_E1_OPT_ACQ_FS_HZ)
|
||||
{
|
||||
acq_parameters_.resampler_ratio = floor(static_cast<float>(acq_parameters_.fs_in) / Galileo_E1_OPT_ACQ_FS_HZ);
|
||||
uint32_t decimation = acq_parameters_.fs_in / Galileo_E1_OPT_ACQ_FS_HZ;
|
||||
acq_parameters_.resampler_ratio = floor(static_cast<float>(acq_parameters_.fs_in) / GALILEO_E1_OPT_ACQ_FS_HZ);
|
||||
uint32_t decimation = acq_parameters_.fs_in / GALILEO_E1_OPT_ACQ_FS_HZ;
|
||||
while (acq_parameters_.fs_in % decimation > 0)
|
||||
{
|
||||
decimation--;
|
||||
@@ -107,19 +110,19 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition(
|
||||
acq_parameters_.resampled_fs = acq_parameters_.fs_in / static_cast<int>(acq_parameters_.resampler_ratio);
|
||||
}
|
||||
//--- Find number of samples per spreading code (4 ms) -----------------
|
||||
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(acq_parameters_.resampled_fs) / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS)));
|
||||
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(acq_parameters_.resampled_fs) / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS)));
|
||||
acq_parameters_.samples_per_ms = static_cast<float>(acq_parameters_.resampled_fs) * 0.001;
|
||||
acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / Galileo_E1_CODE_CHIP_RATE_HZ) * static_cast<float>(acq_parameters_.resampled_fs)));
|
||||
acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / GALILEO_E1_CODE_CHIP_RATE_HZ) * static_cast<float>(acq_parameters_.resampled_fs)));
|
||||
}
|
||||
else
|
||||
{
|
||||
//--- Find number of samples per spreading code (4 ms) -----------------
|
||||
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(fs_in_) / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS)));
|
||||
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(fs_in_) / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS)));
|
||||
acq_parameters_.samples_per_ms = static_cast<float>(fs_in_) * 0.001;
|
||||
acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / Galileo_E1_CODE_CHIP_RATE_HZ) * static_cast<float>(acq_parameters_.fs_in)));
|
||||
acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / GALILEO_E1_CODE_CHIP_RATE_HZ) * static_cast<float>(acq_parameters_.fs_in)));
|
||||
}
|
||||
|
||||
acq_parameters_.samples_per_code = acq_parameters_.samples_per_ms * static_cast<float>(Galileo_E1_CODE_PERIOD_MS);
|
||||
acq_parameters_.samples_per_code = acq_parameters_.samples_per_ms * static_cast<float>(GALILEO_E1_CODE_PERIOD_MS);
|
||||
vector_length_ = sampled_ms_ * acq_parameters_.samples_per_ms;
|
||||
if (bit_transition_flag_)
|
||||
{
|
||||
@@ -187,7 +190,10 @@ void GalileoE1PcpsAmbiguousAcquisition::set_threshold(float threshold)
|
||||
{
|
||||
float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0);
|
||||
|
||||
if (pfa == 0.0) pfa = configuration_->property(role_ + ".pfa", 0.0);
|
||||
if (pfa == 0.0)
|
||||
{
|
||||
pfa = configuration_->property(role_ + ".pfa", 0.0);
|
||||
}
|
||||
|
||||
if (pfa == 0.0)
|
||||
{
|
||||
|
||||
@@ -89,7 +89,7 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga(
|
||||
// dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename);
|
||||
// acq_parameters.dump_filename = dump_filename_;
|
||||
//--- Find number of samples per spreading code (4 ms) -----------------
|
||||
auto code_length = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS)));
|
||||
auto code_length = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS)));
|
||||
//acq_parameters.samples_per_code = code_length_;
|
||||
//int samples_per_ms = static_cast<int>(std::round(static_cast<double>(fs_in_) * 0.001));
|
||||
//acq_parameters.samples_per_ms = samples_per_ms;
|
||||
@@ -101,8 +101,8 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga(
|
||||
// }
|
||||
|
||||
//printf("fs_in = %d\n", fs_in);
|
||||
//printf("Galileo_E1_B_CODE_LENGTH_CHIPS = %f\n", Galileo_E1_B_CODE_LENGTH_CHIPS);
|
||||
//printf("Galileo_E1_CODE_CHIP_RATE_HZ = %f\n", Galileo_E1_CODE_CHIP_RATE_HZ);
|
||||
//printf("GALILEO_E1_B_CODE_LENGTH_CHIPS = %f\n", GALILEO_E1_B_CODE_LENGTH_CHIPS);
|
||||
//printf("GALILEO_E1_CODE_CHIP_RATE_HZ = %f\n", GALILEO_E1_CODE_CHIP_RATE_HZ);
|
||||
//printf("acq adapter code_length = %d\n", code_length);
|
||||
acq_parameters.code_length = code_length;
|
||||
// The FPGA can only use FFT lengths that are a power of two.
|
||||
@@ -123,12 +123,12 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga(
|
||||
auto* fft_if = new gr::fft::fft_complex(nsamples_total, true); // Direct FFT
|
||||
auto* code = new std::complex<float>[nsamples_total]; // buffer for the local code
|
||||
auto* fft_codes_padded = static_cast<gr_complex*>(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
|
||||
d_all_fft_codes_ = new lv_16sc_t[nsamples_total * Galileo_E1_NUMBER_OF_CODES]; // memory containing all the possible fft codes for PRN 0 to 32
|
||||
d_all_fft_codes_ = new lv_16sc_t[nsamples_total * GALILEO_E1_NUMBER_OF_CODES]; // memory containing all the possible fft codes for PRN 0 to 32
|
||||
float max; // temporary maxima search
|
||||
|
||||
//int tmp_re, tmp_im;
|
||||
|
||||
for (unsigned int PRN = 1; PRN <= Galileo_E1_NUMBER_OF_CODES; PRN++)
|
||||
for (unsigned int PRN = 1; PRN <= GALILEO_E1_NUMBER_OF_CODES; PRN++)
|
||||
{
|
||||
//code_ = new gr_complex[vector_length_];
|
||||
|
||||
@@ -258,7 +258,7 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga(
|
||||
}
|
||||
|
||||
|
||||
// for (unsigned int PRN = 1; PRN <= Galileo_E1_NUMBER_OF_CODES; PRN++)
|
||||
// for (unsigned int PRN = 1; PRN <= GALILEO_E1_NUMBER_OF_CODES; PRN++)
|
||||
// {
|
||||
// // debug
|
||||
// char filename2[25];
|
||||
|
||||
@@ -60,7 +60,10 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition
|
||||
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
||||
dump_ = configuration_->property(role + ".dump", false);
|
||||
doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
|
||||
if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max;
|
||||
if (FLAGS_doppler_max != 0)
|
||||
{
|
||||
doppler_max_ = FLAGS_doppler_max;
|
||||
}
|
||||
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 4);
|
||||
|
||||
if (sampled_ms_ % 4 != 0)
|
||||
@@ -79,7 +82,7 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition
|
||||
//--- Find number of samples per spreading code (4 ms) -----------------
|
||||
|
||||
code_length_ = round(
|
||||
fs_in_ / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS));
|
||||
fs_in_ / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS));
|
||||
|
||||
vector_length_ = code_length_ * static_cast<int>(sampled_ms_ / 4);
|
||||
|
||||
|
||||
@@ -61,12 +61,15 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui
|
||||
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
||||
dump_ = configuration_->property(role + ".dump", false);
|
||||
doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
|
||||
if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max;
|
||||
if (FLAGS_doppler_max != 0)
|
||||
{
|
||||
doppler_max_ = FLAGS_doppler_max;
|
||||
}
|
||||
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 8);
|
||||
|
||||
/*--- Find number of samples per spreading code (4 ms) -----------------*/
|
||||
code_length_ = round(
|
||||
fs_in_ / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS));
|
||||
fs_in_ / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS));
|
||||
|
||||
int samples_per_ms = round(code_length_ / 4.0);
|
||||
|
||||
@@ -179,7 +182,10 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_threshold(float threshold)
|
||||
{
|
||||
float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0);
|
||||
|
||||
if (pfa == 0.0) pfa = configuration_->property(role_ + ".pfa", 0.0);
|
||||
if (pfa == 0.0)
|
||||
{
|
||||
pfa = configuration_->property(role_ + ".pfa", 0.0);
|
||||
}
|
||||
|
||||
if (pfa == 0.0)
|
||||
{
|
||||
|
||||
@@ -61,7 +61,10 @@ GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition(
|
||||
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
||||
dump_ = configuration_->property(role + ".dump", false);
|
||||
doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
|
||||
if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max;
|
||||
if (FLAGS_doppler_max != 0)
|
||||
{
|
||||
doppler_max_ = FLAGS_doppler_max;
|
||||
}
|
||||
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 4);
|
||||
|
||||
if (sampled_ms_ % 4 != 0)
|
||||
@@ -82,7 +85,7 @@ GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition(
|
||||
//--- Find number of samples per spreading code (4 ms) -----------------
|
||||
|
||||
code_length_ = round(
|
||||
fs_in_ / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS));
|
||||
fs_in_ / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS));
|
||||
|
||||
vector_length_ = code_length_ * static_cast<int>(sampled_ms_ / 4);
|
||||
|
||||
@@ -149,7 +152,10 @@ void GalileoE1PcpsTongAmbiguousAcquisition::set_threshold(float threshold)
|
||||
{
|
||||
float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0);
|
||||
|
||||
if (pfa == 0.0) pfa = configuration_->property(role_ + ".pfa", 0.0);
|
||||
if (pfa == 0.0)
|
||||
{
|
||||
pfa = configuration_->property(role_ + ".pfa", 0.0);
|
||||
}
|
||||
|
||||
if (pfa == 0.0)
|
||||
{
|
||||
|
||||
@@ -66,7 +66,10 @@ GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf(
|
||||
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
||||
dump_ = configuration_->property(role + ".dump", false);
|
||||
doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
|
||||
if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max;
|
||||
if (FLAGS_doppler_max != 0)
|
||||
{
|
||||
doppler_max_ = FLAGS_doppler_max;
|
||||
}
|
||||
CAF_window_hz_ = configuration_->property(role + ".CAF_window_hz", 0);
|
||||
Zero_padding = configuration_->property(role + ".Zero_padding", 0);
|
||||
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1);
|
||||
@@ -88,7 +91,7 @@ GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf(
|
||||
bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false);
|
||||
|
||||
//--- Find number of samples per spreading code (1ms)-------------------------
|
||||
code_length_ = round(static_cast<double>(fs_in_) / Galileo_E5a_CODE_CHIP_RATE_HZ * static_cast<double>(Galileo_E5a_CODE_LENGTH_CHIPS));
|
||||
code_length_ = round(static_cast<double>(fs_in_) / GALILEO_E5A_CODE_CHIP_RATE_HZ * static_cast<double>(GALILEO_E5A_CODE_LENGTH_CHIPS));
|
||||
|
||||
vector_length_ = code_length_ * sampled_ms_;
|
||||
|
||||
@@ -155,7 +158,10 @@ void GalileoE5aNoncoherentIQAcquisitionCaf::set_threshold(float threshold)
|
||||
{
|
||||
float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0);
|
||||
|
||||
if (pfa == 0.0) pfa = configuration_->property(role_ + ".pfa", 0.0);
|
||||
if (pfa == 0.0)
|
||||
{
|
||||
pfa = configuration_->property(role_ + ".pfa", 0.0);
|
||||
}
|
||||
|
||||
if (pfa == 0.0)
|
||||
{
|
||||
|
||||
@@ -70,7 +70,10 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* con
|
||||
acq_parameters_.dump = dump_;
|
||||
acq_parameters_.dump_channel = configuration_->property(role + ".dump_channel", 0);
|
||||
doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
|
||||
if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max;
|
||||
if (FLAGS_doppler_max != 0)
|
||||
{
|
||||
doppler_max_ = FLAGS_doppler_max;
|
||||
}
|
||||
acq_parameters_.doppler_max = doppler_max_;
|
||||
sampled_ms_ = 1;
|
||||
max_dwells_ = configuration_->property(role + ".max_dwells", 1);
|
||||
@@ -93,10 +96,10 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* con
|
||||
}
|
||||
if (acq_parameters_.use_automatic_resampler)
|
||||
{
|
||||
if (acq_parameters_.fs_in > Galileo_E5a_OPT_ACQ_FS_HZ)
|
||||
if (acq_parameters_.fs_in > GALILEO_E5A_OPT_ACQ_FS_HZ)
|
||||
{
|
||||
acq_parameters_.resampler_ratio = floor(static_cast<float>(acq_parameters_.fs_in) / Galileo_E5a_OPT_ACQ_FS_HZ);
|
||||
uint32_t decimation = acq_parameters_.fs_in / Galileo_E5a_OPT_ACQ_FS_HZ;
|
||||
acq_parameters_.resampler_ratio = floor(static_cast<float>(acq_parameters_.fs_in) / GALILEO_E5A_OPT_ACQ_FS_HZ);
|
||||
uint32_t decimation = acq_parameters_.fs_in / GALILEO_E5A_OPT_ACQ_FS_HZ;
|
||||
while (acq_parameters_.fs_in % decimation > 0)
|
||||
{
|
||||
decimation--;
|
||||
@@ -106,21 +109,21 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* con
|
||||
}
|
||||
|
||||
//--- Find number of samples per spreading code -------------------------
|
||||
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(acq_parameters_.resampled_fs) / (Galileo_E5a_CODE_CHIP_RATE_HZ / Galileo_E5a_CODE_LENGTH_CHIPS)));
|
||||
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(acq_parameters_.resampled_fs) / (GALILEO_E5A_CODE_CHIP_RATE_HZ / GALILEO_E5A_CODE_LENGTH_CHIPS)));
|
||||
acq_parameters_.samples_per_ms = static_cast<float>(acq_parameters_.resampled_fs) * 0.001;
|
||||
acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / Galileo_E5a_CODE_CHIP_RATE_HZ) * static_cast<float>(acq_parameters_.resampled_fs)));
|
||||
acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / GALILEO_E5A_CODE_CHIP_RATE_HZ) * static_cast<float>(acq_parameters_.resampled_fs)));
|
||||
}
|
||||
else
|
||||
{
|
||||
acq_parameters_.resampled_fs = fs_in_;
|
||||
//--- Find number of samples per spreading code -------------------------
|
||||
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(fs_in_) / (Galileo_E5a_CODE_CHIP_RATE_HZ / Galileo_E5a_CODE_LENGTH_CHIPS)));
|
||||
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(fs_in_) / (GALILEO_E5A_CODE_CHIP_RATE_HZ / GALILEO_E5A_CODE_LENGTH_CHIPS)));
|
||||
acq_parameters_.samples_per_ms = static_cast<float>(fs_in_) * 0.001;
|
||||
acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / Galileo_E5a_CODE_CHIP_RATE_HZ) * static_cast<float>(acq_parameters_.fs_in)));
|
||||
acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / GALILEO_E5A_CODE_CHIP_RATE_HZ) * static_cast<float>(acq_parameters_.fs_in)));
|
||||
}
|
||||
|
||||
//--- Find number of samples per spreading code (1ms)-------------------------
|
||||
code_length_ = static_cast<unsigned int>(std::round(static_cast<double>(fs_in_) / Galileo_E5a_CODE_CHIP_RATE_HZ * static_cast<double>(Galileo_E5a_CODE_LENGTH_CHIPS)));
|
||||
code_length_ = static_cast<unsigned int>(std::round(static_cast<double>(fs_in_) / GALILEO_E5A_CODE_CHIP_RATE_HZ * static_cast<double>(GALILEO_E5A_CODE_LENGTH_CHIPS)));
|
||||
vector_length_ = code_length_ * sampled_ms_;
|
||||
|
||||
code_ = new gr_complex[vector_length_];
|
||||
@@ -141,7 +144,7 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* con
|
||||
acq_parameters_.it_size = item_size_;
|
||||
acq_parameters_.sampled_ms = sampled_ms_;
|
||||
acq_parameters_.ms_per_code = 1;
|
||||
acq_parameters_.samples_per_code = acq_parameters_.samples_per_ms * static_cast<float>(GALILEO_E5a_CODE_PERIOD_MS);
|
||||
acq_parameters_.samples_per_code = acq_parameters_.samples_per_ms * static_cast<float>(GALILEO_E5A_CODE_PERIOD_MS);
|
||||
acq_parameters_.num_doppler_bins_step2 = configuration_->property(role + ".second_nbins", 4);
|
||||
acq_parameters_.doppler_step2 = configuration_->property(role + ".second_doppler_step", 125.0);
|
||||
acq_parameters_.make_2_steps = configuration_->property(role + ".make_two_steps", false);
|
||||
|
||||
@@ -89,7 +89,7 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf
|
||||
acq_pilot_ = false;
|
||||
}
|
||||
|
||||
auto code_length = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / Galileo_E5a_CODE_CHIP_RATE_HZ * static_cast<double>(Galileo_E5a_CODE_LENGTH_CHIPS)));
|
||||
auto code_length = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / GALILEO_E5A_CODE_CHIP_RATE_HZ * static_cast<double>(GALILEO_E5A_CODE_LENGTH_CHIPS)));
|
||||
acq_parameters.code_length = code_length;
|
||||
// The FPGA can only use FFT lengths that are a power of two.
|
||||
float nbits = ceilf(log2f((float)code_length));
|
||||
@@ -111,13 +111,13 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf
|
||||
auto* fft_if = new gr::fft::fft_complex(nsamples_total, true); // Direct FFT
|
||||
auto* code = new std::complex<float>[nsamples_total]; // buffer for the local code
|
||||
auto* fft_codes_padded = static_cast<gr_complex*>(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
|
||||
d_all_fft_codes_ = new lv_16sc_t[nsamples_total * Galileo_E5a_NUMBER_OF_CODES]; // memory containing all the possible fft codes for PRN 0 to 32
|
||||
d_all_fft_codes_ = new lv_16sc_t[nsamples_total * GALILEO_E5A_NUMBER_OF_CODES]; // memory containing all the possible fft codes for PRN 0 to 32
|
||||
float max; // temporary maxima search
|
||||
|
||||
//printf("creating the E5A acquisition CONT");
|
||||
//printf("nsamples_total = %d\n", nsamples_total);
|
||||
|
||||
for (unsigned int PRN = 1; PRN <= Galileo_E5a_NUMBER_OF_CODES; PRN++)
|
||||
for (unsigned int PRN = 1; PRN <= GALILEO_E5A_NUMBER_OF_CODES; PRN++)
|
||||
{
|
||||
// gr_complex* code = new gr_complex[code_length_];
|
||||
char signal_[3];
|
||||
|
||||
@@ -71,7 +71,10 @@ GlonassL1CaPcpsAcquisition::GlonassL1CaPcpsAcquisition(
|
||||
blocking_ = configuration_->property(role + ".blocking", true);
|
||||
acq_parameters.blocking = blocking_;
|
||||
doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
|
||||
if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max;
|
||||
if (FLAGS_doppler_max != 0)
|
||||
{
|
||||
doppler_max_ = FLAGS_doppler_max;
|
||||
}
|
||||
acq_parameters.doppler_max = doppler_max_;
|
||||
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1);
|
||||
acq_parameters.sampled_ms = sampled_ms_;
|
||||
|
||||
@@ -70,7 +70,10 @@ GlonassL2CaPcpsAcquisition::GlonassL2CaPcpsAcquisition(
|
||||
blocking_ = configuration_->property(role + ".blocking", true);
|
||||
acq_parameters.blocking = blocking_;
|
||||
doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
|
||||
if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max;
|
||||
if (FLAGS_doppler_max != 0)
|
||||
{
|
||||
doppler_max_ = FLAGS_doppler_max;
|
||||
}
|
||||
acq_parameters.doppler_max = doppler_max_;
|
||||
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1);
|
||||
bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false);
|
||||
|
||||
@@ -70,7 +70,10 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition(
|
||||
blocking_ = configuration_->property(role + ".blocking", true);
|
||||
acq_parameters_.blocking = blocking_;
|
||||
doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
|
||||
if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max;
|
||||
if (FLAGS_doppler_max != 0)
|
||||
{
|
||||
doppler_max_ = FLAGS_doppler_max;
|
||||
}
|
||||
acq_parameters_.doppler_max = doppler_max_;
|
||||
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1);
|
||||
acq_parameters_.sampled_ms = sampled_ms_;
|
||||
|
||||
@@ -67,7 +67,10 @@ GpsL1CaPcpsAcquisitionFineDoppler::GpsL1CaPcpsAcquisitionFineDoppler(
|
||||
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename);
|
||||
acq_parameters.dump_filename = dump_filename_;
|
||||
doppler_max_ = configuration->property(role + ".doppler_max", 5000);
|
||||
if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max;
|
||||
if (FLAGS_doppler_max != 0)
|
||||
{
|
||||
doppler_max_ = FLAGS_doppler_max;
|
||||
}
|
||||
acq_parameters.doppler_max = doppler_max_;
|
||||
sampled_ms_ = configuration->property(role + ".coherent_integration_time_ms", 1);
|
||||
acq_parameters.sampled_ms = sampled_ms_;
|
||||
|
||||
@@ -61,7 +61,10 @@ GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition(
|
||||
fs_in_ = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
||||
dump_ = configuration->property(role + ".dump", false);
|
||||
doppler_max_ = configuration->property(role + ".doppler_max", 5000);
|
||||
if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max;
|
||||
if (FLAGS_doppler_max != 0)
|
||||
{
|
||||
doppler_max_ = FLAGS_doppler_max;
|
||||
}
|
||||
doppler_min_ = configuration->property(role + ".doppler_min", -doppler_max_);
|
||||
sampled_ms_ = configuration->property(role + ".coherent_integration_time_ms", 1);
|
||||
max_dwells_ = configuration->property(role + ".max_dwells", 1);
|
||||
|
||||
@@ -61,7 +61,10 @@ GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition(
|
||||
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
||||
dump_ = configuration_->property(role + ".dump", false);
|
||||
doppler_max_ = configuration->property(role + ".doppler_max", 5000);
|
||||
if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max;
|
||||
if (FLAGS_doppler_max != 0)
|
||||
{
|
||||
doppler_max_ = FLAGS_doppler_max;
|
||||
}
|
||||
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 4);
|
||||
|
||||
//--- Find number of samples per spreading code -------------------------
|
||||
|
||||
@@ -61,7 +61,10 @@ GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition(
|
||||
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
||||
dump_ = configuration_->property(role + ".dump", false);
|
||||
doppler_max_ = configuration->property(role + ".doppler_max", 5000);
|
||||
if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max;
|
||||
if (FLAGS_doppler_max != 0)
|
||||
{
|
||||
doppler_max_ = FLAGS_doppler_max;
|
||||
}
|
||||
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1);
|
||||
|
||||
tong_init_val_ = configuration->property(role + ".tong_init_val", 1);
|
||||
|
||||
@@ -68,7 +68,10 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition(
|
||||
blocking_ = configuration_->property(role + ".blocking", true);
|
||||
acq_parameters_.blocking = blocking_;
|
||||
doppler_max_ = configuration->property(role + ".doppler_max", 5000);
|
||||
if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max;
|
||||
if (FLAGS_doppler_max != 0)
|
||||
{
|
||||
doppler_max_ = FLAGS_doppler_max;
|
||||
}
|
||||
acq_parameters_.doppler_max = doppler_max_;
|
||||
bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false);
|
||||
acq_parameters_.bit_transition_flag = bit_transition_flag_;
|
||||
|
||||
@@ -69,7 +69,10 @@ GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition(
|
||||
blocking_ = configuration_->property(role + ".blocking", true);
|
||||
acq_parameters_.blocking = blocking_;
|
||||
doppler_max_ = configuration->property(role + ".doppler_max", 5000);
|
||||
if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max;
|
||||
if (FLAGS_doppler_max != 0)
|
||||
{
|
||||
doppler_max_ = FLAGS_doppler_max;
|
||||
}
|
||||
acq_parameters_.doppler_max = doppler_max_;
|
||||
bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false);
|
||||
acq_parameters_.bit_transition_flag = bit_transition_flag_;
|
||||
@@ -118,20 +121,20 @@ GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition(
|
||||
}
|
||||
|
||||
//--- Find number of samples per spreading code -------------------------
|
||||
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(acq_parameters_.resampled_fs) / (GPS_L5i_CODE_RATE_HZ / GPS_L5i_CODE_LENGTH_CHIPS)));
|
||||
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(acq_parameters_.resampled_fs) / (GPS_L5I_CODE_RATE_HZ / GPS_L5I_CODE_LENGTH_CHIPS)));
|
||||
acq_parameters_.samples_per_ms = static_cast<float>(acq_parameters_.resampled_fs) * 0.001;
|
||||
acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / GPS_L5i_CODE_RATE_HZ) * static_cast<float>(acq_parameters_.resampled_fs)));
|
||||
acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / GPS_L5I_CODE_RATE_HZ) * static_cast<float>(acq_parameters_.resampled_fs)));
|
||||
}
|
||||
else
|
||||
{
|
||||
acq_parameters_.resampled_fs = fs_in_;
|
||||
//--- Find number of samples per spreading code -------------------------
|
||||
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(fs_in_) / (GPS_L5i_CODE_RATE_HZ / GPS_L5i_CODE_LENGTH_CHIPS)));
|
||||
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(fs_in_) / (GPS_L5I_CODE_RATE_HZ / GPS_L5I_CODE_LENGTH_CHIPS)));
|
||||
acq_parameters_.samples_per_ms = static_cast<float>(fs_in_) * 0.001;
|
||||
acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / GPS_L5i_CODE_RATE_HZ) * static_cast<float>(acq_parameters_.fs_in)));
|
||||
acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / GPS_L5I_CODE_RATE_HZ) * static_cast<float>(acq_parameters_.fs_in)));
|
||||
}
|
||||
|
||||
acq_parameters_.samples_per_code = acq_parameters_.samples_per_ms * static_cast<float>(GPS_L5i_PERIOD * 1000.0);
|
||||
acq_parameters_.samples_per_code = acq_parameters_.samples_per_ms * static_cast<float>(GPS_L5I_PERIOD * 1000.0);
|
||||
vector_length_ = std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2 : 1);
|
||||
code_ = new gr_complex[vector_length_];
|
||||
acquisition_ = pcps_make_acquisition(acq_parameters_);
|
||||
|
||||
@@ -89,7 +89,7 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga(
|
||||
//dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename);
|
||||
//acq_parameters.dump_filename = dump_filename_;
|
||||
//--- Find number of samples per spreading code -------------------------
|
||||
auto code_length = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / (GPS_L5i_CODE_RATE_HZ / static_cast<double>(GPS_L5i_CODE_LENGTH_CHIPS))));
|
||||
auto code_length = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / (GPS_L5I_CODE_RATE_HZ / static_cast<double>(GPS_L5I_CODE_LENGTH_CHIPS))));
|
||||
acq_parameters.code_length = code_length;
|
||||
// The FPGA can only use FFT lengths that are a power of two.
|
||||
float nbits = ceilf(log2f((float)code_length));
|
||||
|
||||
@@ -64,15 +64,15 @@ list(SORT ACQ_GR_BLOCKS_SOURCES)
|
||||
|
||||
source_group(Headers FILES ${ACQ_GR_BLOCKS_HEADERS})
|
||||
|
||||
add_library(acq_gr_blocks ${ACQ_GR_BLOCKS_SOURCES} ${ACQ_GR_BLOCKS_HEADERS})
|
||||
add_library(acquisition_gr_blocks ${ACQ_GR_BLOCKS_SOURCES} ${ACQ_GR_BLOCKS_HEADERS})
|
||||
|
||||
target_link_libraries(acq_gr_blocks
|
||||
target_link_libraries(acquisition_gr_blocks
|
||||
PUBLIC
|
||||
Gnuradio::runtime
|
||||
Gnuradio::fft
|
||||
Volk::volk
|
||||
gnss_system_parameters
|
||||
acquisition_lib
|
||||
acquisition_libs
|
||||
core_system_parameters
|
||||
${OPT_LIBRARIES}
|
||||
PRIVATE
|
||||
Boost::filesystem
|
||||
@@ -80,17 +80,30 @@ target_link_libraries(acq_gr_blocks
|
||||
Glog::glog
|
||||
Matio::matio
|
||||
Volkgnsssdr::volkgnsssdr
|
||||
gnss_sp_libs
|
||||
gnss_rx
|
||||
algorithms_libs
|
||||
)
|
||||
|
||||
target_include_directories(acquisition_gr_blocks
|
||||
PUBLIC
|
||||
${CMAKE_SOURCE_DIR}/src/algorithms/libs
|
||||
PRIVATE
|
||||
${CMAKE_SOURCE_DIR}/src/core/receiver
|
||||
)
|
||||
|
||||
if(OPENCL_FOUND)
|
||||
target_include_directories(acq_gr_blocks PUBLIC ${OPENCL_INCLUDE_DIRS})
|
||||
target_include_directories(acquisition_gr_blocks PUBLIC ${OPENCL_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
target_include_directories(acq_gr_blocks PUBLIC ${CMAKE_SOURCE_DIR}/src/algorithms/libs)
|
||||
if(ENABLE_CLANG_TIDY)
|
||||
if(CLANG_TIDY_EXE)
|
||||
set_target_properties(acquisition_gr_blocks
|
||||
PROPERTIES
|
||||
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set_property(TARGET acq_gr_blocks
|
||||
set_property(TARGET acquisition_gr_blocks
|
||||
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
)
|
||||
|
||||
@@ -36,11 +36,11 @@
|
||||
*/
|
||||
|
||||
#include "galileo_e5a_noncoherent_iq_acquisition_caf_cc.h"
|
||||
#include "control_message_factory.h"
|
||||
#include <glog/logging.h>
|
||||
#include <gnuradio/io_signature.h>
|
||||
#include <volk/volk.h>
|
||||
#include <volk_gnsssdr/volk_gnsssdr.h>
|
||||
#include <exception>
|
||||
#include <sstream>
|
||||
#include <utility>
|
||||
|
||||
@@ -214,9 +214,20 @@ galileo_e5a_noncoherentIQ_acquisition_caf_cc::~galileo_e5a_noncoherentIQ_acquisi
|
||||
delete d_fft_if;
|
||||
delete d_ifft;
|
||||
|
||||
if (d_dump)
|
||||
try
|
||||
{
|
||||
d_dump_file.close();
|
||||
if (d_dump)
|
||||
{
|
||||
d_dump_file.close();
|
||||
}
|
||||
}
|
||||
catch (const std::ofstream::failure &e)
|
||||
{
|
||||
std::cerr << "Problem closing Acquisition dump file: " << d_dump_filename << '\n';
|
||||
}
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
std::cerr << e.what() << '\n';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
|
||||
class galileo_e5a_noncoherentIQ_acquisition_caf_cc;
|
||||
|
||||
typedef boost::shared_ptr<galileo_e5a_noncoherentIQ_acquisition_caf_cc> galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr;
|
||||
using galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr = boost::shared_ptr<galileo_e5a_noncoherentIQ_acquisition_caf_cc>;
|
||||
|
||||
galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr
|
||||
galileo_e5a_noncoherentIQ_make_acquisition_caf_cc(unsigned int sampled_ms,
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
*/
|
||||
|
||||
#include "galileo_pcps_8ms_acquisition_cc.h"
|
||||
#include "control_message_factory.h"
|
||||
#include <glog/logging.h>
|
||||
#include <gnuradio/io_signature.h>
|
||||
#include <volk/volk.h>
|
||||
#include <volk_gnsssdr/volk_gnsssdr.h>
|
||||
#include <exception>
|
||||
#include <sstream>
|
||||
#include <utility>
|
||||
|
||||
@@ -54,6 +54,7 @@ galileo_pcps_8ms_acquisition_cc_sptr galileo_pcps_8ms_make_acquisition_cc(
|
||||
samples_per_code, dump, std::move(dump_filename)));
|
||||
}
|
||||
|
||||
|
||||
galileo_pcps_8ms_acquisition_cc::galileo_pcps_8ms_acquisition_cc(
|
||||
uint32_t sampled_ms,
|
||||
uint32_t max_dwells,
|
||||
@@ -126,9 +127,20 @@ galileo_pcps_8ms_acquisition_cc::~galileo_pcps_8ms_acquisition_cc()
|
||||
delete d_ifft;
|
||||
delete d_fft_if;
|
||||
|
||||
if (d_dump)
|
||||
try
|
||||
{
|
||||
d_dump_file.close();
|
||||
if (d_dump)
|
||||
{
|
||||
d_dump_file.close();
|
||||
}
|
||||
}
|
||||
catch (const std::ofstream::failure &e)
|
||||
{
|
||||
std::cerr << "Problem closing Acquisition dump file: " << d_dump_filename << '\n';
|
||||
}
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
std::cerr << e.what() << '\n';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
|
||||
class galileo_pcps_8ms_acquisition_cc;
|
||||
|
||||
typedef boost::shared_ptr<galileo_pcps_8ms_acquisition_cc> galileo_pcps_8ms_acquisition_cc_sptr;
|
||||
using galileo_pcps_8ms_acquisition_cc_sptr = boost::shared_ptr<galileo_pcps_8ms_acquisition_cc>;
|
||||
|
||||
galileo_pcps_8ms_acquisition_cc_sptr
|
||||
galileo_pcps_8ms_make_acquisition_cc(uint32_t sampled_ms,
|
||||
|
||||
@@ -317,7 +317,10 @@ void pcps_acquisition::init()
|
||||
d_num_doppler_bins = static_cast<uint32_t>(std::ceil(static_cast<double>(static_cast<int32_t>(acq_parameters.doppler_max) - static_cast<int32_t>(-acq_parameters.doppler_max)) / static_cast<double>(d_doppler_step)));
|
||||
|
||||
// Create the carrier Doppler wipeoff signals
|
||||
if (d_grid_doppler_wipeoffs == nullptr) d_grid_doppler_wipeoffs = new gr_complex*[d_num_doppler_bins];
|
||||
if (d_grid_doppler_wipeoffs == nullptr)
|
||||
{
|
||||
d_grid_doppler_wipeoffs = new gr_complex*[d_num_doppler_bins];
|
||||
}
|
||||
if (acq_parameters.make_2_steps && (d_grid_doppler_wipeoffs_step_two == nullptr))
|
||||
{
|
||||
d_grid_doppler_wipeoffs_step_two = new gr_complex*[d_num_doppler_bins_step2];
|
||||
@@ -629,7 +632,10 @@ float pcps_acquisition::first_vs_second_peak_statistic(uint32_t& indext, int32_t
|
||||
{
|
||||
d_tmp_buffer[idx] = 0.0;
|
||||
idx++;
|
||||
if (idx == static_cast<int32_t>(d_fft_size)) idx = 0;
|
||||
if (idx == static_cast<int32_t>(d_fft_size))
|
||||
{
|
||||
idx = 0;
|
||||
}
|
||||
}
|
||||
while (idx != excludeRangeIndex2);
|
||||
|
||||
@@ -842,7 +848,10 @@ void pcps_acquisition::acquisition_core(uint64_t samp_count)
|
||||
|
||||
if (d_num_noncoherent_integrations_counter == acq_parameters.max_dwells)
|
||||
{
|
||||
if (d_state != 0) send_negative_acquisition();
|
||||
if (d_state != 0)
|
||||
{
|
||||
send_negative_acquisition();
|
||||
}
|
||||
d_state = 0;
|
||||
d_active = false;
|
||||
d_step_two = false;
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
|
||||
class pcps_acquisition;
|
||||
|
||||
typedef boost::shared_ptr<pcps_acquisition> pcps_acquisition_sptr;
|
||||
using pcps_acquisition_sptr = boost::shared_ptr<pcps_acquisition>;
|
||||
|
||||
pcps_acquisition_sptr
|
||||
pcps_make_acquisition(const Acq_Conf& conf_);
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
|
||||
#include "pcps_acquisition_fine_doppler_cc.h"
|
||||
#include "GPS_L1_CA.h"
|
||||
#include "control_message_factory.h"
|
||||
#include "gnss_sdr_create_directory.h"
|
||||
#include "gps_sdr_signal_processing.h"
|
||||
#include <boost/filesystem/path.hpp>
|
||||
@@ -314,7 +313,10 @@ double pcps_acquisition_fine_doppler_cc::compute_CAF()
|
||||
{
|
||||
d_grid_data[index_doppler][idx] = 0.0;
|
||||
idx++;
|
||||
if (idx == static_cast<int>(d_fft_size)) idx = 0;
|
||||
if (idx == static_cast<int>(d_fft_size))
|
||||
{
|
||||
idx = 0;
|
||||
}
|
||||
}
|
||||
while (idx != excludeRangeIndex2);
|
||||
|
||||
|
||||
@@ -55,13 +55,13 @@
|
||||
#include <gnuradio/block.h>
|
||||
#include <gnuradio/fft/fft.h>
|
||||
#include <gnuradio/gr_complex.h>
|
||||
#include <cstdint>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
|
||||
class pcps_acquisition_fine_doppler_cc;
|
||||
|
||||
typedef boost::shared_ptr<pcps_acquisition_fine_doppler_cc>
|
||||
pcps_acquisition_fine_doppler_cc_sptr;
|
||||
using pcps_acquisition_fine_doppler_cc_sptr = boost::shared_ptr<pcps_acquisition_fine_doppler_cc>;
|
||||
|
||||
pcps_acquisition_fine_doppler_cc_sptr
|
||||
pcps_make_acquisition_fine_doppler_cc(const Acq_Conf& conf_);
|
||||
@@ -87,7 +87,7 @@ private:
|
||||
bool start();
|
||||
|
||||
Acq_Conf acq_parameters;
|
||||
long d_fs_in;
|
||||
int64_t d_fs_in;
|
||||
int d_samples_per_ms;
|
||||
int d_max_dwells;
|
||||
int d_gnuradio_forecast_samples;
|
||||
|
||||
@@ -33,16 +33,16 @@
|
||||
#include "pcps_assisted_acquisition_cc.h"
|
||||
#include "GPS_L1_CA.h"
|
||||
#include "concurrent_map.h"
|
||||
#include "control_message_factory.h"
|
||||
#include "gps_acq_assist.h"
|
||||
#include <glog/logging.h>
|
||||
#include <gnuradio/io_signature.h>
|
||||
#include <volk/volk.h>
|
||||
#include <volk_gnsssdr/volk_gnsssdr.h>
|
||||
#include <exception>
|
||||
#include <sstream>
|
||||
#include <utility>
|
||||
|
||||
extern concurrent_map<Gps_Acq_Assist> global_gps_acq_assist_map;
|
||||
extern Concurrent_Map<Gps_Acq_Assist> global_gps_acq_assist_map;
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
@@ -132,9 +132,20 @@ pcps_assisted_acquisition_cc::~pcps_assisted_acquisition_cc()
|
||||
volk_gnsssdr_free(d_fft_codes);
|
||||
delete d_ifft;
|
||||
delete d_fft_if;
|
||||
if (d_dump)
|
||||
try
|
||||
{
|
||||
d_dump_file.close();
|
||||
if (d_dump)
|
||||
{
|
||||
d_dump_file.close();
|
||||
}
|
||||
}
|
||||
catch (const std::ofstream::failure &e)
|
||||
{
|
||||
std::cerr << "Problem closing Acquisition dump file: " << d_dump_filename << '\n';
|
||||
}
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
std::cerr << e.what() << '\n';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -381,7 +392,10 @@ int pcps_assisted_acquisition_cc::general_work(int noutput_items,
|
||||
switch (d_state)
|
||||
{
|
||||
case 0: // S0. StandBy
|
||||
if (d_active == true) d_state = 1;
|
||||
if (d_active == true)
|
||||
{
|
||||
d_state = 1;
|
||||
}
|
||||
d_sample_counter += static_cast<uint64_t>(ninput_items[0]); // sample counter
|
||||
consume_each(ninput_items[0]);
|
||||
break;
|
||||
|
||||
@@ -57,8 +57,7 @@
|
||||
|
||||
class pcps_assisted_acquisition_cc;
|
||||
|
||||
typedef boost::shared_ptr<pcps_assisted_acquisition_cc>
|
||||
pcps_assisted_acquisition_cc_sptr;
|
||||
using pcps_assisted_acquisition_cc_sptr = boost::shared_ptr<pcps_assisted_acquisition_cc>;
|
||||
|
||||
pcps_assisted_acquisition_cc_sptr
|
||||
pcps_make_assisted_acquisition_cc(
|
||||
|
||||
@@ -36,11 +36,11 @@
|
||||
|
||||
#include "pcps_cccwsr_acquisition_cc.h"
|
||||
#include "GPS_L1_CA.h" // GPS_TWO_PI
|
||||
#include "control_message_factory.h"
|
||||
#include <glog/logging.h>
|
||||
#include <gnuradio/io_signature.h>
|
||||
#include <volk/volk.h>
|
||||
#include <volk_gnsssdr/volk_gnsssdr.h>
|
||||
#include <exception>
|
||||
#include <sstream>
|
||||
#include <utility>
|
||||
|
||||
@@ -118,6 +118,7 @@ pcps_cccwsr_acquisition_cc::pcps_cccwsr_acquisition_cc(
|
||||
d_channel = 0;
|
||||
}
|
||||
|
||||
|
||||
pcps_cccwsr_acquisition_cc::~pcps_cccwsr_acquisition_cc()
|
||||
{
|
||||
if (d_num_doppler_bins > 0)
|
||||
@@ -140,12 +141,24 @@ pcps_cccwsr_acquisition_cc::~pcps_cccwsr_acquisition_cc()
|
||||
delete d_ifft;
|
||||
delete d_fft_if;
|
||||
|
||||
if (d_dump)
|
||||
try
|
||||
{
|
||||
d_dump_file.close();
|
||||
if (d_dump)
|
||||
{
|
||||
d_dump_file.close();
|
||||
}
|
||||
}
|
||||
catch (const std::ofstream::failure &e)
|
||||
{
|
||||
std::cerr << "Problem closing Acquisition dump file: " << d_dump_filename << '\n';
|
||||
}
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
std::cerr << e.what() << '\n';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void pcps_cccwsr_acquisition_cc::set_local_code(std::complex<float> *code_data,
|
||||
std::complex<float> *code_pilot)
|
||||
{
|
||||
@@ -166,6 +179,7 @@ void pcps_cccwsr_acquisition_cc::set_local_code(std::complex<float> *code_data,
|
||||
volk_32fc_conjugate_32fc(d_fft_code_pilot, d_fft_if->get_outbuf(), d_fft_size);
|
||||
}
|
||||
|
||||
|
||||
void pcps_cccwsr_acquisition_cc::init()
|
||||
{
|
||||
d_gnss_synchro->Flag_valid_acquisition = false;
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
|
||||
class pcps_cccwsr_acquisition_cc;
|
||||
|
||||
typedef boost::shared_ptr<pcps_cccwsr_acquisition_cc> pcps_cccwsr_acquisition_cc_sptr;
|
||||
using pcps_cccwsr_acquisition_cc_sptr = boost::shared_ptr<pcps_cccwsr_acquisition_cc>;
|
||||
|
||||
pcps_cccwsr_acquisition_cc_sptr
|
||||
pcps_cccwsr_make_acquisition_cc(
|
||||
|
||||
@@ -50,7 +50,6 @@
|
||||
|
||||
#include "pcps_opencl_acquisition_cc.h"
|
||||
#include "GPS_L1_CA.h" //GPS_TWO_PI
|
||||
#include "control_message_factory.h"
|
||||
#include "opencl/fft_base_kernels.h"
|
||||
#include "opencl/fft_internal.h"
|
||||
#include <glog/logging.h>
|
||||
@@ -58,6 +57,7 @@
|
||||
#include <volk/volk.h>
|
||||
#include <volk_gnsssdr/volk_gnsssdr.h>
|
||||
#include <algorithm>
|
||||
#include <exception>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
@@ -187,9 +187,20 @@ pcps_opencl_acquisition_cc::~pcps_opencl_acquisition_cc()
|
||||
delete d_fft_if;
|
||||
}
|
||||
|
||||
if (d_dump)
|
||||
try
|
||||
{
|
||||
d_dump_file.close();
|
||||
if (d_dump)
|
||||
{
|
||||
d_dump_file.close();
|
||||
}
|
||||
}
|
||||
catch (const std::ofstream::failure &e)
|
||||
{
|
||||
std::cerr << "Problem closing Acquisition dump file: " << d_dump_filename << '\n';
|
||||
}
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
std::cerr << e.what() << '\n';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,12 +30,12 @@
|
||||
|
||||
#include "pcps_quicksync_acquisition_cc.h"
|
||||
#include "GPS_L1_CA.h"
|
||||
#include "control_message_factory.h"
|
||||
#include <glog/logging.h>
|
||||
#include <gnuradio/io_signature.h>
|
||||
#include <volk/volk.h>
|
||||
#include <volk_gnsssdr/volk_gnsssdr.h>
|
||||
#include <cmath>
|
||||
#include <exception>
|
||||
#include <sstream>
|
||||
#include <utility>
|
||||
|
||||
@@ -159,11 +159,21 @@ pcps_quicksync_acquisition_cc::~pcps_quicksync_acquisition_cc()
|
||||
delete d_corr_output_f;
|
||||
delete[] d_code_folded;
|
||||
|
||||
if (d_dump)
|
||||
try
|
||||
{
|
||||
d_dump_file.close();
|
||||
if (d_dump)
|
||||
{
|
||||
d_dump_file.close();
|
||||
}
|
||||
}
|
||||
catch (const std::ofstream::failure& e)
|
||||
{
|
||||
std::cerr << "Problem closing Acquisition dump file: " << d_dump_filename << '\n';
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
std::cerr << e.what() << '\n';
|
||||
}
|
||||
// DLOG(INFO) << "END DESTROYER";
|
||||
}
|
||||
|
||||
|
||||
@@ -208,7 +218,10 @@ void pcps_quicksync_acquisition_cc::init()
|
||||
d_mag = 0.0;
|
||||
d_input_power = 0.0;
|
||||
|
||||
if (d_doppler_step == 0) d_doppler_step = 250;
|
||||
if (d_doppler_step == 0)
|
||||
{
|
||||
d_doppler_step = 250;
|
||||
}
|
||||
|
||||
// Count the number of bins
|
||||
d_num_doppler_bins = 0;
|
||||
@@ -535,7 +548,10 @@ int pcps_quicksync_acquisition_cc::general_work(int noutput_items,
|
||||
DLOG(INFO) << "test statistics threshold " << d_threshold;
|
||||
DLOG(INFO) << "folding factor " << d_folding_factor;
|
||||
DLOG(INFO) << "possible delay correlation output";
|
||||
for (int32_t i = 0; i < static_cast<int32_t>(d_folding_factor); i++) DLOG(INFO) << d_possible_delay[i] << "\t\t\t" << d_corr_output_f[i];
|
||||
for (int32_t i = 0; i < static_cast<int32_t>(d_folding_factor); i++)
|
||||
{
|
||||
DLOG(INFO) << d_possible_delay[i] << "\t\t\t" << d_corr_output_f[i];
|
||||
}
|
||||
DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples;
|
||||
DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz;
|
||||
DLOG(INFO) << "magnitude folded " << d_mag;
|
||||
@@ -564,7 +580,10 @@ int pcps_quicksync_acquisition_cc::general_work(int noutput_items,
|
||||
DLOG(INFO) << "test statistics threshold " << d_threshold;
|
||||
DLOG(INFO) << "folding factor " << d_folding_factor;
|
||||
DLOG(INFO) << "possible delay corr output";
|
||||
for (int32_t i = 0; i < static_cast<int32_t>(d_folding_factor); i++) DLOG(INFO) << d_possible_delay[i] << "\t\t\t" << d_corr_output_f[i];
|
||||
for (int32_t i = 0; i < static_cast<int32_t>(d_folding_factor); i++)
|
||||
{
|
||||
DLOG(INFO) << d_possible_delay[i] << "\t\t\t" << d_corr_output_f[i];
|
||||
}
|
||||
DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples;
|
||||
DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz;
|
||||
DLOG(INFO) << "magnitude folded " << d_mag;
|
||||
|
||||
@@ -63,8 +63,7 @@
|
||||
|
||||
class pcps_quicksync_acquisition_cc;
|
||||
|
||||
typedef boost::shared_ptr<pcps_quicksync_acquisition_cc>
|
||||
pcps_quicksync_acquisition_cc_sptr;
|
||||
using pcps_quicksync_acquisition_cc_sptr = boost::shared_ptr<pcps_quicksync_acquisition_cc>;
|
||||
|
||||
pcps_quicksync_acquisition_cc_sptr
|
||||
pcps_quicksync_make_acquisition_cc(
|
||||
|
||||
@@ -50,11 +50,11 @@
|
||||
|
||||
#include "pcps_tong_acquisition_cc.h"
|
||||
#include "GPS_L1_CA.h" // for GPS_TWO_PI
|
||||
#include "control_message_factory.h"
|
||||
#include <glog/logging.h>
|
||||
#include <gnuradio/io_signature.h>
|
||||
#include <volk/volk.h>
|
||||
#include <volk_gnsssdr/volk_gnsssdr.h>
|
||||
#include <exception>
|
||||
#include <sstream>
|
||||
#include <utility>
|
||||
|
||||
@@ -76,6 +76,7 @@ pcps_tong_acquisition_cc_sptr pcps_tong_make_acquisition_cc(
|
||||
tong_init_val, tong_max_val, tong_max_dwells, dump, std::move(dump_filename)));
|
||||
}
|
||||
|
||||
|
||||
pcps_tong_acquisition_cc::pcps_tong_acquisition_cc(
|
||||
uint32_t sampled_ms,
|
||||
uint32_t doppler_max,
|
||||
@@ -153,12 +154,24 @@ pcps_tong_acquisition_cc::~pcps_tong_acquisition_cc()
|
||||
delete d_ifft;
|
||||
delete d_fft_if;
|
||||
|
||||
if (d_dump)
|
||||
try
|
||||
{
|
||||
d_dump_file.close();
|
||||
if (d_dump)
|
||||
{
|
||||
d_dump_file.close();
|
||||
}
|
||||
}
|
||||
catch (const std::ofstream::failure &e)
|
||||
{
|
||||
std::cerr << "Problem closing Acquisition dump file: " << d_dump_filename << '\n';
|
||||
}
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
std::cerr << e.what() << '\n';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void pcps_tong_acquisition_cc::set_local_code(std::complex<float> *code)
|
||||
{
|
||||
memcpy(d_fft_if->get_inbuf(), code, sizeof(gr_complex) * d_fft_size);
|
||||
@@ -169,6 +182,7 @@ void pcps_tong_acquisition_cc::set_local_code(std::complex<float> *code)
|
||||
volk_32fc_conjugate_32fc(d_fft_codes, d_fft_if->get_outbuf(), d_fft_size);
|
||||
}
|
||||
|
||||
|
||||
void pcps_tong_acquisition_cc::init()
|
||||
{
|
||||
d_gnss_synchro->Flag_valid_acquisition = false;
|
||||
@@ -213,6 +227,7 @@ void pcps_tong_acquisition_cc::init()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void pcps_tong_acquisition_cc::set_state(int32_t state)
|
||||
{
|
||||
d_state = state;
|
||||
@@ -245,6 +260,7 @@ void pcps_tong_acquisition_cc::set_state(int32_t state)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int pcps_tong_acquisition_cc::general_work(int noutput_items,
|
||||
gr_vector_int &ninput_items, gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items __attribute__((unused)))
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
|
||||
class pcps_tong_acquisition_cc;
|
||||
|
||||
typedef boost::shared_ptr<pcps_tong_acquisition_cc> pcps_tong_acquisition_cc_sptr;
|
||||
using pcps_tong_acquisition_cc_sptr = boost::shared_ptr<pcps_tong_acquisition_cc>;
|
||||
|
||||
pcps_tong_acquisition_cc_sptr
|
||||
pcps_tong_make_acquisition_cc(
|
||||
|
||||
@@ -29,24 +29,32 @@ list(SORT ACQUISITION_LIB_SOURCES)
|
||||
|
||||
source_group(Headers FILES ${ACQUISITION_LIB_HEADERS})
|
||||
|
||||
add_library(acquisition_lib
|
||||
add_library(acquisition_libs
|
||||
${ACQUISITION_LIB_SOURCES}
|
||||
${ACQUISITION_LIB_HEADERS}
|
||||
)
|
||||
|
||||
target_link_libraries(acquisition_lib
|
||||
target_link_libraries(acquisition_libs
|
||||
PUBLIC
|
||||
Volk::volk
|
||||
Gnuradio::fft
|
||||
PRIVATE
|
||||
Gflags::gflags
|
||||
Glog::glog
|
||||
gnss_system_parameters
|
||||
gnss_rx
|
||||
gnss_sp_libs
|
||||
algorithms_libs
|
||||
core_system_parameters
|
||||
)
|
||||
|
||||
set_property(TARGET acquisition_lib
|
||||
if(ENABLE_CLANG_TIDY)
|
||||
if(CLANG_TIDY_EXE)
|
||||
set_target_properties(acquisition_libs
|
||||
PROPERTIES
|
||||
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set_property(TARGET acquisition_libs
|
||||
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
)
|
||||
|
||||
@@ -29,14 +29,27 @@ source_group(Headers FILES ${CHANNEL_ADAPTER_HEADERS})
|
||||
target_link_libraries(channel_adapters
|
||||
PUBLIC
|
||||
Gnuradio::runtime
|
||||
channel_fsm
|
||||
gnss_rx
|
||||
channel_libs
|
||||
PRIVATE
|
||||
Gflags::gflags
|
||||
Glog::glog
|
||||
gnss_sdr_flags
|
||||
)
|
||||
|
||||
target_include_directories(channel_adapters
|
||||
PUBLIC
|
||||
${CMAKE_SOURCE_DIR}/src/core/interfaces
|
||||
)
|
||||
|
||||
if(ENABLE_CLANG_TIDY)
|
||||
if(CLANG_TIDY_EXE)
|
||||
set_target_properties(channel_adapters
|
||||
PROPERTIES
|
||||
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set_property(TARGET channel_adapters
|
||||
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
|
||||
@@ -75,14 +75,23 @@ Channel::Channel(ConfigurationInterface* configuration, uint32_t channel, std::s
|
||||
// IMPORTANT: Do not change the order between set_doppler_step and set_threshold
|
||||
|
||||
uint32_t doppler_step = configuration->property("Acquisition_" + implementation_ + std::to_string(channel_) + ".doppler_step", 0);
|
||||
if (doppler_step == 0) doppler_step = configuration->property("Acquisition_" + implementation_ + ".doppler_step", 500);
|
||||
if (FLAGS_doppler_step != 0) doppler_step = static_cast<uint32_t>(FLAGS_doppler_step);
|
||||
if (doppler_step == 0)
|
||||
{
|
||||
doppler_step = configuration->property("Acquisition_" + implementation_ + ".doppler_step", 500);
|
||||
}
|
||||
if (FLAGS_doppler_step != 0)
|
||||
{
|
||||
doppler_step = static_cast<uint32_t>(FLAGS_doppler_step);
|
||||
}
|
||||
DLOG(INFO) << "Channel " << channel_ << " Doppler_step = " << doppler_step;
|
||||
|
||||
acq_->set_doppler_step(doppler_step);
|
||||
|
||||
float threshold = configuration->property("Acquisition_" + implementation_ + std::to_string(channel_) + ".threshold", 0.0);
|
||||
if (threshold == 0.0) threshold = configuration->property("Acquisition_" + implementation_ + ".threshold", 0.0);
|
||||
if (threshold == 0.0)
|
||||
{
|
||||
threshold = configuration->property("Acquisition_" + implementation_ + ".threshold", 0.0);
|
||||
}
|
||||
|
||||
acq_->set_threshold(threshold);
|
||||
|
||||
|
||||
@@ -31,18 +31,28 @@ list(SORT CHANNEL_FSM_SOURCES)
|
||||
|
||||
source_group(Headers FILES ${CHANNEL_FSM_HEADERS})
|
||||
|
||||
add_library(channel_fsm ${CHANNEL_FSM_SOURCES} ${CHANNEL_FSM_HEADERS})
|
||||
add_library(channel_libs ${CHANNEL_FSM_SOURCES} ${CHANNEL_FSM_HEADERS})
|
||||
|
||||
target_link_libraries(channel_fsm
|
||||
target_link_libraries(channel_libs
|
||||
PUBLIC
|
||||
gnss_rx
|
||||
Gnuradio::runtime
|
||||
core_system_parameters
|
||||
PRIVATE
|
||||
Gflags::gflags
|
||||
Glog::glog
|
||||
core_receiver
|
||||
)
|
||||
|
||||
set_property(TARGET channel_fsm
|
||||
if(ENABLE_CLANG_TIDY)
|
||||
if(CLANG_TIDY_EXE)
|
||||
set_target_properties(channel_libs
|
||||
PROPERTIES
|
||||
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set_property(TARGET channel_libs
|
||||
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
)
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
class channel_msg_receiver_cc;
|
||||
|
||||
typedef boost::shared_ptr<channel_msg_receiver_cc> channel_msg_receiver_cc_sptr;
|
||||
using channel_msg_receiver_cc_sptr = boost::shared_ptr<channel_msg_receiver_cc>;
|
||||
|
||||
channel_msg_receiver_cc_sptr channel_msg_receiver_make_cc(std::shared_ptr<ChannelFsm> channel_fsm, bool repeat);
|
||||
|
||||
|
||||
@@ -36,13 +36,26 @@ add_library(conditioner_adapters ${COND_ADAPTER_SOURCES} ${COND_ADAPTER_HEADERS}
|
||||
|
||||
target_link_libraries(conditioner_adapters
|
||||
PUBLIC
|
||||
gnss_rx
|
||||
Gnuradio::runtime
|
||||
PRIVATE
|
||||
Gflags::gflags
|
||||
Glog::glog
|
||||
)
|
||||
|
||||
target_include_directories(conditioner_adapters
|
||||
PUBLIC
|
||||
${CMAKE_SOURCE_DIR}/src/core/interfaces
|
||||
)
|
||||
|
||||
if(ENABLE_CLANG_TIDY)
|
||||
if(CLANG_TIDY_EXE)
|
||||
set_target_properties(conditioner_adapters
|
||||
PROPERTIES
|
||||
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set_property(TARGET conditioner_adapters
|
||||
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
|
||||
@@ -40,30 +40,39 @@ list(SORT DATATYPE_ADAPTER_SOURCES)
|
||||
|
||||
source_group(Headers FILES ${DATATYPE_ADAPTER_HEADERS})
|
||||
|
||||
add_library(datatype_adapters
|
||||
add_library(data_type_adapters
|
||||
${DATATYPE_ADAPTER_SOURCES}
|
||||
${DATATYPE_ADAPTER_HEADERS}
|
||||
)
|
||||
|
||||
target_link_libraries(datatype_adapters
|
||||
target_link_libraries(data_type_adapters
|
||||
PUBLIC
|
||||
Gnuradio::blocks
|
||||
gnss_system_parameters
|
||||
gnss_rx
|
||||
data_type_gr_blocks
|
||||
gnss_sp_libs
|
||||
algorithms_libs
|
||||
core_system_parameters
|
||||
PRIVATE
|
||||
Gflags::gflags
|
||||
Glog::glog
|
||||
Volk::volk
|
||||
)
|
||||
|
||||
target_include_directories(datatype_adapters
|
||||
target_include_directories(data_type_adapters
|
||||
PUBLIC
|
||||
${CMAKE_SOURCE_DIR}/src/algorithms/libs
|
||||
${CMAKE_SOURCE_DIR}/src/core/interfaces
|
||||
)
|
||||
|
||||
set_property(TARGET datatype_adapters
|
||||
if(ENABLE_CLANG_TIDY)
|
||||
if(CLANG_TIDY_EXE)
|
||||
set_target_properties(data_type_adapters
|
||||
PROPERTIES
|
||||
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set_property(TARGET data_type_adapters
|
||||
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
)
|
||||
|
||||
@@ -43,7 +43,7 @@ target_link_libraries(data_type_gr_blocks
|
||||
PUBLIC
|
||||
Gnuradio::runtime
|
||||
Boost::boost
|
||||
gnss_sp_libs
|
||||
algorithms_libs
|
||||
PRIVATE
|
||||
Volk::volk
|
||||
)
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
class interleaved_byte_to_complex_byte;
|
||||
|
||||
typedef boost::shared_ptr<interleaved_byte_to_complex_byte> interleaved_byte_to_complex_byte_sptr;
|
||||
using interleaved_byte_to_complex_byte_sptr = boost::shared_ptr<interleaved_byte_to_complex_byte>;
|
||||
|
||||
interleaved_byte_to_complex_byte_sptr make_interleaved_byte_to_complex_byte();
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
class interleaved_byte_to_complex_short;
|
||||
|
||||
typedef boost::shared_ptr<interleaved_byte_to_complex_short> interleaved_byte_to_complex_short_sptr;
|
||||
using interleaved_byte_to_complex_short_sptr = boost::shared_ptr<interleaved_byte_to_complex_short>;
|
||||
|
||||
interleaved_byte_to_complex_short_sptr make_interleaved_byte_to_complex_short();
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
class interleaved_short_to_complex_short;
|
||||
|
||||
typedef boost::shared_ptr<interleaved_short_to_complex_short> interleaved_short_to_complex_short_sptr;
|
||||
using interleaved_short_to_complex_short_sptr = boost::shared_ptr<interleaved_short_to_complex_short>;
|
||||
|
||||
interleaved_short_to_complex_short_sptr make_interleaved_short_to_complex_short();
|
||||
|
||||
|
||||
@@ -49,20 +49,32 @@ target_link_libraries(input_filter_adapters
|
||||
Gnuradio::blocks
|
||||
Gnuradio::filter
|
||||
input_filter_gr_blocks
|
||||
gnss_sp_libs
|
||||
gnss_rx
|
||||
algorithms_libs
|
||||
PRIVATE
|
||||
Gflags::gflags
|
||||
Glog::glog
|
||||
Volk::volk
|
||||
)
|
||||
|
||||
target_include_directories(input_filter_adapters
|
||||
PUBLIC ${CMAKE_SOURCE_DIR}/src/algorithms/libs
|
||||
PUBLIC
|
||||
${CMAKE_SOURCE_DIR}/src/algorithms/libs
|
||||
${CMAKE_SOURCE_DIR}/src/core/interfaces
|
||||
)
|
||||
|
||||
if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4")
|
||||
target_compile_definitions(input_filter_adapters PUBLIC -DGR_GREATER_38=1)
|
||||
endif()
|
||||
|
||||
if(ENABLE_CLANG_TIDY)
|
||||
if(CLANG_TIDY_EXE)
|
||||
set_target_properties(input_filter_adapters
|
||||
PROPERTIES
|
||||
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set_property(TARGET input_filter_adapters
|
||||
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
|
||||
@@ -67,7 +67,7 @@ BeamformerFilter::BeamformerFilter(
|
||||
file_sink_ = gr::blocks::file_sink::make(item_size_, dump_filename_.c_str());
|
||||
DLOG(INFO) << "file_sink(" << file_sink_->unique_id() << ")";
|
||||
}
|
||||
samples_ = 0;
|
||||
samples_ = 0ULL;
|
||||
if (in_stream_ > 8)
|
||||
{
|
||||
LOG(ERROR) << "This implementation only supports eight input streams";
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
|
||||
#include "gnss_block_interface.h"
|
||||
#include <gnuradio/hier_block2.h>
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
|
||||
class ConfigurationInterface;
|
||||
@@ -78,7 +79,7 @@ private:
|
||||
unsigned int out_stream_;
|
||||
std::string item_type_;
|
||||
size_t item_size_;
|
||||
unsigned long long samples_;
|
||||
uint64_t samples_;
|
||||
bool dump_;
|
||||
std::string dump_filename_;
|
||||
gr::block_sptr beamformer_;
|
||||
|
||||
@@ -299,11 +299,8 @@ gr::basic_block_sptr FirFilter::get_left_block()
|
||||
{
|
||||
return cshort_to_float_x2_;
|
||||
}
|
||||
else
|
||||
{
|
||||
return nullptr;
|
||||
LOG(ERROR) << " Unknown item type conversion";
|
||||
}
|
||||
LOG(WARNING) << "Unknown item type conversion";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
@@ -329,11 +326,8 @@ gr::basic_block_sptr FirFilter::get_right_block()
|
||||
{
|
||||
return float_to_complex_;
|
||||
}
|
||||
else
|
||||
{
|
||||
return nullptr;
|
||||
LOG(ERROR) << " unknown input filter item type";
|
||||
}
|
||||
LOG(WARNING) << "Unknown input filter taps item type";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -339,7 +339,7 @@ gr::basic_block_sptr FreqXlatingFirFilter::get_left_block()
|
||||
{
|
||||
return gr_char_to_short_;
|
||||
}
|
||||
else if ((taps_item_type_ == "float") && (input_item_type_ == "byte") && (output_item_type_ == "cbyte"))
|
||||
if ((taps_item_type_ == "float") && (input_item_type_ == "byte") && (output_item_type_ == "cbyte"))
|
||||
{
|
||||
return gr_char_to_short_;
|
||||
}
|
||||
@@ -373,7 +373,7 @@ gr::basic_block_sptr FreqXlatingFirFilter::get_right_block()
|
||||
{
|
||||
return freq_xlating_fir_filter_scf_;
|
||||
}
|
||||
else if ((taps_item_type_ == "float") && (input_item_type_ == "byte") && (output_item_type_ == "cbyte"))
|
||||
if ((taps_item_type_ == "float") && (input_item_type_ == "byte") && (output_item_type_ == "cbyte"))
|
||||
{
|
||||
return complex_to_complex_byte_;
|
||||
}
|
||||
|
||||
@@ -46,11 +46,18 @@ target_link_libraries(input_filter_gr_blocks
|
||||
Gnuradio::filter
|
||||
Volkgnsssdr::volkgnsssdr
|
||||
PRIVATE
|
||||
Gflags::gflags
|
||||
Glog::glog
|
||||
Log4cpp::log4cpp
|
||||
)
|
||||
|
||||
if(ENABLE_CLANG_TIDY)
|
||||
if(CLANG_TIDY_EXE)
|
||||
set_target_properties(input_filter_gr_blocks
|
||||
PROPERTIES
|
||||
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set_property(TARGET input_filter_gr_blocks
|
||||
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include <gnuradio/sync_block.h>
|
||||
|
||||
class beamformer;
|
||||
typedef boost::shared_ptr<beamformer> beamformer_sptr;
|
||||
using beamformer_sptr = boost::shared_ptr<beamformer>;
|
||||
|
||||
beamformer_sptr make_beamformer();
|
||||
|
||||
|
||||
@@ -30,13 +30,11 @@
|
||||
|
||||
#include "notch_cc.h"
|
||||
#include <boost/math/distributions/chi_squared.hpp>
|
||||
#include <glog/logging.h>
|
||||
#include <gnuradio/io_signature.h>
|
||||
#include <volk/volk.h>
|
||||
#include <cmath>
|
||||
#include <cstring>
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
notch_sptr make_notch_filter(float pfa, float p_c_factor,
|
||||
int32_t length_, int32_t n_segments_est, int32_t n_segments_reset)
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
class Notch;
|
||||
|
||||
typedef boost::shared_ptr<Notch> notch_sptr;
|
||||
using notch_sptr = boost::shared_ptr<Notch>;
|
||||
|
||||
notch_sptr make_notch_filter(float pfa, float p_c_factor,
|
||||
int32_t length_, int32_t n_segments_est, int32_t n_segments_reset);
|
||||
|
||||
@@ -30,13 +30,11 @@
|
||||
|
||||
#include "notch_lite_cc.h"
|
||||
#include <boost/math/distributions/chi_squared.hpp>
|
||||
#include <glog/logging.h>
|
||||
#include <gnuradio/io_signature.h>
|
||||
#include <volk/volk.h>
|
||||
#include <cmath>
|
||||
#include <cstring>
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
notch_lite_sptr make_notch_filter_lite(float p_c_factor, float pfa, int32_t length_, int32_t n_segments_est, int32_t n_segments_reset, int32_t n_segments_coeff)
|
||||
{
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
class NotchLite;
|
||||
|
||||
typedef boost::shared_ptr<NotchLite> notch_lite_sptr;
|
||||
using notch_lite_sptr = boost::shared_ptr<NotchLite>;
|
||||
|
||||
notch_lite_sptr make_notch_filter_lite(float p_c_factor, float pfa, int32_t length_, int32_t n_segments_est, int32_t n_segments_reset, int32_t n_segments_coeff);
|
||||
|
||||
|
||||
@@ -30,12 +30,10 @@
|
||||
|
||||
#include "pulse_blanking_cc.h"
|
||||
#include <boost/math/distributions/chi_squared.hpp>
|
||||
#include <glog/logging.h>
|
||||
#include <gnuradio/io_signature.h>
|
||||
#include <volk/volk.h>
|
||||
#include <cmath>
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
pulse_blanking_cc_sptr make_pulse_blanking_cc(float pfa, int32_t length_,
|
||||
int32_t n_segments_est, int32_t n_segments_reset)
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
class pulse_blanking_cc;
|
||||
|
||||
typedef boost::shared_ptr<pulse_blanking_cc> pulse_blanking_cc_sptr;
|
||||
using pulse_blanking_cc_sptr = boost::shared_ptr<pulse_blanking_cc>;
|
||||
|
||||
pulse_blanking_cc_sptr make_pulse_blanking_cc(float pfa, int32_t length_, int32_t n_segments_est, int32_t n_segments_reset);
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@ set(GNSS_SPLIBS_SOURCES
|
||||
gps_l2c_signal.cc
|
||||
gps_l5_signal.cc
|
||||
galileo_e1_signal_processing.cc
|
||||
gnss_sdr_valve.cc
|
||||
gnss_sdr_sample_counter.cc
|
||||
gnss_signal_processing.cc
|
||||
gps_sdr_signal_processing.cc
|
||||
@@ -42,13 +41,13 @@ set(GNSS_SPLIBS_SOURCES
|
||||
conjugate_ic.cc
|
||||
gnss_sdr_create_directory.cc
|
||||
geofunctions.cc
|
||||
rtcm.cc
|
||||
)
|
||||
|
||||
set(GNSS_SPLIBS_HEADERS
|
||||
gps_l2c_signal.h
|
||||
gps_l5_signal.h
|
||||
galileo_e1_signal_processing.h
|
||||
gnss_sdr_valve.h
|
||||
gnss_sdr_sample_counter.h
|
||||
gnss_signal_processing.h
|
||||
gps_sdr_signal_processing.h
|
||||
@@ -69,6 +68,7 @@ set(GNSS_SPLIBS_HEADERS
|
||||
gnss_sdr_create_directory.h
|
||||
gnss_circular_deque.h
|
||||
geofunctions.h
|
||||
rtcm.h
|
||||
)
|
||||
|
||||
if(ENABLE_FPGA)
|
||||
@@ -107,35 +107,57 @@ list(SORT GNSS_SPLIBS_SOURCES)
|
||||
|
||||
source_group(Headers FILES ${GNSS_SPLIBS_HEADERS})
|
||||
|
||||
add_library(gnss_sp_libs ${GNSS_SPLIBS_SOURCES} ${GNSS_SPLIBS_HEADERS})
|
||||
add_library(algorithms_libs ${GNSS_SPLIBS_SOURCES} ${GNSS_SPLIBS_HEADERS})
|
||||
|
||||
target_link_libraries(gnss_sp_libs
|
||||
target_link_libraries(algorithms_libs
|
||||
PUBLIC
|
||||
Armadillo::armadillo
|
||||
Boost::boost
|
||||
Gflags::gflags
|
||||
Armadillo::armadillo
|
||||
Gnuradio::runtime
|
||||
Gnuradio::blocks
|
||||
Volk::volk ${ORC_LIBRARIES}
|
||||
Volkgnsssdr::volkgnsssdr
|
||||
gnss_system_parameters
|
||||
core_system_parameters
|
||||
${OPT_LIBRARIES}
|
||||
PRIVATE
|
||||
Boost::filesystem
|
||||
Gflags::gflags
|
||||
Glog::glog
|
||||
gnss_rx
|
||||
)
|
||||
|
||||
target_compile_definitions(gnss_sp_libs
|
||||
target_include_directories(algorithms_libs
|
||||
PUBLIC
|
||||
${CMAKE_SOURCE_DIR}/src/core/interfaces
|
||||
${CMAKE_SOURCE_DIR}/src/core/receiver
|
||||
)
|
||||
|
||||
target_compile_definitions(algorithms_libs
|
||||
PUBLIC -DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}"
|
||||
)
|
||||
|
||||
set_property(TARGET gnss_sp_libs
|
||||
set_property(TARGET algorithms_libs
|
||||
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
)
|
||||
|
||||
if(OS_IS_MACOSX)
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") # not AppleClang
|
||||
target_compile_definitions(algorithms_libs
|
||||
PUBLIC
|
||||
-DBOOST_ASIO_HAS_STD_STRING_VIEW
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(ENABLE_CLANG_TIDY)
|
||||
if(CLANG_TIDY_EXE)
|
||||
set_target_properties(algorithms_libs
|
||||
PROPERTIES
|
||||
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
|
||||
@@ -158,6 +180,15 @@ target_compile_definitions(gnss_sdr_flags
|
||||
PRIVATE -DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}"
|
||||
)
|
||||
|
||||
if(ENABLE_CLANG_TIDY)
|
||||
if(CLANG_TIDY_EXE)
|
||||
set_target_properties(gnss_sdr_flags
|
||||
PROPERTIES
|
||||
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set_property(TARGET gnss_sdr_flags
|
||||
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2015 (see AUTHORS file for a list of contributors)
|
||||
* Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
@@ -32,33 +32,35 @@
|
||||
|
||||
#include "beidou_b1i_signal_processing.h"
|
||||
|
||||
auto auxCeil = [](float x) { return static_cast<int>(static_cast<long>((x) + 1)); };
|
||||
auto auxCeil = [](float x) { return static_cast<int32_t>(static_cast<int64_t>((x) + 1)); };
|
||||
|
||||
void beidou_b1i_code_gen_int(int* _dest, signed int _prn, unsigned int _chip_shift)
|
||||
void beidou_b1i_code_gen_int(int32_t* _dest, int32_t _prn, uint32_t _chip_shift)
|
||||
{
|
||||
const unsigned int _code_length = 2046;
|
||||
const uint32_t _code_length = 2046;
|
||||
bool G1[_code_length];
|
||||
bool G2[_code_length];
|
||||
bool G1_register[11] = {false, true, false, true, false, true, false, true, false, true, false};
|
||||
bool G2_register[11] = {false, true, false, true, false, true, false, true, false, true, false};
|
||||
bool feedback1, feedback2;
|
||||
bool aux;
|
||||
unsigned int lcv, lcv2;
|
||||
unsigned int delay;
|
||||
signed int prn_idx;
|
||||
uint32_t lcv, lcv2;
|
||||
uint32_t delay;
|
||||
int32_t prn_idx;
|
||||
/* G2 Delays as defined in GPS-ISD-200D */
|
||||
const signed int delays[33] = {712 /*PRN1*/, 1581, 1414, 1550, 581, 771, 1311, 1043, 1549, 359, 710, 1579, 1548, 1103, 579, 769, 358, 709, 1411, 1547,
|
||||
const int32_t delays[33] = {712 /*PRN1*/, 1581, 1414, 1550, 581, 771, 1311, 1043, 1549, 359, 710, 1579, 1548, 1103, 579, 769, 358, 709, 1411, 1547,
|
||||
1102, 578, 357, 1577, 1410, 1546, 1101, 707, 1576, 1409, 1545, 354 /*PRN32*/,
|
||||
705};
|
||||
const signed int phase1[37] = {1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 8, 8, 8, 9, 9, 10};
|
||||
const signed int phase2[37] = {3, 4, 5, 6, 8, 9, 10, 11, 7, 4, 5, 6, 8, 9, 10, 11, 5, 6, 8, 9, 10, 11, 6, 8, 9, 10, 11, 8, 9, 10, 11, 9, 10, 11, 10, 11, 11};
|
||||
const int32_t phase1[37] = {1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 8, 8, 8, 9, 9, 10};
|
||||
const int32_t phase2[37] = {3, 4, 5, 6, 8, 9, 10, 11, 7, 4, 5, 6, 8, 9, 10, 11, 5, 6, 8, 9, 10, 11, 6, 8, 9, 10, 11, 8, 9, 10, 11, 9, 10, 11, 10, 11, 11};
|
||||
|
||||
// compute delay array index for given PRN number
|
||||
prn_idx = _prn - 1;
|
||||
|
||||
/* A simple error check */
|
||||
if ((prn_idx < 0) || (prn_idx > 51))
|
||||
return;
|
||||
if ((prn_idx < 0) || (prn_idx > 32))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/*for (lcv = 0; lcv < 11; lcv++)
|
||||
{
|
||||
@@ -110,28 +112,28 @@ void beidou_b1i_code_gen_int(int* _dest, signed int _prn, unsigned int _chip_shi
|
||||
}
|
||||
|
||||
|
||||
void beidou_b1i_code_gen_float(float* _dest, signed int _prn, unsigned int _chip_shift)
|
||||
void beidou_b1i_code_gen_float(float* _dest, int32_t _prn, uint32_t _chip_shift)
|
||||
{
|
||||
unsigned int _code_length = 2046;
|
||||
int b1i_code_int[_code_length];
|
||||
uint32_t _code_length = 2046;
|
||||
int32_t b1i_code_int[_code_length];
|
||||
|
||||
beidou_b1i_code_gen_int(b1i_code_int, _prn, _chip_shift);
|
||||
|
||||
for (unsigned int ii = 0; ii < _code_length; ++ii)
|
||||
for (uint32_t ii = 0; ii < _code_length; ++ii)
|
||||
{
|
||||
_dest[ii] = static_cast<float>(b1i_code_int[ii]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void beidou_b1i_code_gen_complex(std::complex<float>* _dest, signed int _prn, unsigned int _chip_shift)
|
||||
void beidou_b1i_code_gen_complex(std::complex<float>* _dest, int32_t _prn, uint32_t _chip_shift)
|
||||
{
|
||||
unsigned int _code_length = 2046;
|
||||
int b1i_code_int[_code_length];
|
||||
uint32_t _code_length = 2046;
|
||||
int32_t b1i_code_int[_code_length];
|
||||
|
||||
beidou_b1i_code_gen_int(b1i_code_int, _prn, _chip_shift);
|
||||
|
||||
for (unsigned int ii = 0; ii < _code_length; ++ii)
|
||||
for (uint32_t ii = 0; ii < _code_length; ++ii)
|
||||
{
|
||||
_dest[ii] = std::complex<float>(static_cast<float>(b1i_code_int[ii]), 0.0f);
|
||||
}
|
||||
@@ -141,26 +143,26 @@ void beidou_b1i_code_gen_complex(std::complex<float>* _dest, signed int _prn, un
|
||||
/*
|
||||
* Generates complex GPS L1 C/A code for the desired SV ID and sampled to specific sampling frequency
|
||||
*/
|
||||
void beidou_b1i_code_gen_complex_sampled(std::complex<float>* _dest, unsigned int _prn, int _fs, unsigned int _chip_shift)
|
||||
void beidou_b1i_code_gen_complex_sampled(std::complex<float>* _dest, uint32_t _prn, int32_t _fs, uint32_t _chip_shift)
|
||||
{
|
||||
// This function is based on the GNU software GPS for MATLAB in the Kay Borre book
|
||||
std::complex<float> _code[2046];
|
||||
signed int _samplesPerCode, _codeValueIndex;
|
||||
int32_t _samplesPerCode, _codeValueIndex;
|
||||
float _ts;
|
||||
float _tc;
|
||||
float aux;
|
||||
const signed int _codeFreqBasis = 2046000; //Hz
|
||||
const signed int _codeLength = 2046;
|
||||
const int32_t _codeFreqBasis = 2046000; //Hz
|
||||
const int32_t _codeLength = 2046;
|
||||
|
||||
//--- Find number of samples per spreading code ----------------------------
|
||||
_samplesPerCode = static_cast<signed int>(static_cast<double>(_fs) / static_cast<double>(_codeFreqBasis / _codeLength));
|
||||
_samplesPerCode = static_cast<int32_t>(static_cast<double>(_fs) / static_cast<double>(_codeFreqBasis / _codeLength));
|
||||
|
||||
//--- Find time constants --------------------------------------------------
|
||||
_ts = 1.0 / static_cast<float>(_fs); // Sampling period in sec
|
||||
_tc = 1.0 / static_cast<float>(_codeFreqBasis); // C/A chip period in sec
|
||||
beidou_b1i_code_gen_complex(_code, _prn, _chip_shift); //generate C/A code 1 sample per chip
|
||||
|
||||
for (signed int i = 0; i < _samplesPerCode; i++)
|
||||
for (int32_t i = 0; i < _samplesPerCode; i++)
|
||||
{
|
||||
//=== Digitizing =======================================================
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2015 (see AUTHORS file for a list of contributors)
|
||||
* Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
@@ -30,25 +30,26 @@
|
||||
* -------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef BEIDOU_B1I_SDR_SIGNAL_PROCESSING_H_
|
||||
#define BEIDOU_B1I_SDR_SIGNAL_PROCESSING_H_
|
||||
#ifndef GNSS_SDR_BEIDOU_B1I_SDR_SIGNAL_PROCESSING_H_
|
||||
#define GNSS_SDR_BEIDOU_B1I_SDR_SIGNAL_PROCESSING_H_
|
||||
|
||||
#include <complex>
|
||||
#include <cstdint>
|
||||
#include <iostream>
|
||||
|
||||
//!Generates int GPS L1 C/A code for the desired SV ID and code shift
|
||||
void beidou_b1i_code_gen_int(int* _dest, signed int _prn, unsigned int _chip_shift);
|
||||
//! Generates int32_t GPS L1 C/A code for the desired SV ID and code shift
|
||||
void beidou_b1i_code_gen_int(int32_t* _dest, int32_t _prn, uint32_t _chip_shift);
|
||||
|
||||
//!Generates float GPS L1 C/A code for the desired SV ID and code shift
|
||||
void beidou_b1i_code_gen_float(float* _dest, signed int _prn, unsigned int _chip_shift);
|
||||
//! Generates float GPS L1 C/A code for the desired SV ID and code shift
|
||||
void beidou_b1i_code_gen_float(float* _dest, int32_t _prn, uint32_t _chip_shift);
|
||||
|
||||
//!Generates complex GPS L1 C/A code for the desired SV ID and code shift, and sampled to specific sampling frequency
|
||||
void beidou_b1i_code_gen_complex(std::complex<float>* _dest, signed int _prn, unsigned int _chip_shift);
|
||||
//! Generates complex GPS L1 C/A code for the desired SV ID and code shift, and sampled to specific sampling frequency
|
||||
void beidou_b1i_code_gen_complex(std::complex<float>* _dest, int32_t _prn, uint32_t _chip_shift);
|
||||
|
||||
//! Generates N complex GPS L1 C/A codes for the desired SV ID and code shift
|
||||
void beidou_b1i_code_gen_complex_sampled(std::complex<float>* _dest, unsigned int _prn, int _fs, unsigned int _chip_shift, unsigned int _ncodes);
|
||||
void beidou_b1i_code_gen_complex_sampled(std::complex<float>* _dest, uint32_t _prn, int32_t _fs, uint32_t _chip_shift, uint32_t _ncodes);
|
||||
|
||||
//! Generates complex GPS L1 C/A code for the desired SV ID and code shift
|
||||
void beidou_b1i_code_gen_complex_sampled(std::complex<float>* _dest, unsigned int _prn, int _fs, unsigned int _chip_shift);
|
||||
void beidou_b1i_code_gen_complex_sampled(std::complex<float>* _dest, uint32_t _prn, int32_t _fs, uint32_t _chip_shift);
|
||||
|
||||
#endif /* BEIDOU_B1I_SDR_SIGNAL_PROCESSING_H_ */
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
class byte_x2_to_complex_byte;
|
||||
|
||||
typedef boost::shared_ptr<byte_x2_to_complex_byte> byte_x2_to_complex_byte_sptr;
|
||||
using byte_x2_to_complex_byte_sptr = boost::shared_ptr<byte_x2_to_complex_byte>;
|
||||
|
||||
byte_x2_to_complex_byte_sptr make_byte_x2_to_complex_byte();
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
class complex_byte_to_float_x2;
|
||||
|
||||
typedef boost::shared_ptr<complex_byte_to_float_x2> complex_byte_to_float_x2_sptr;
|
||||
using complex_byte_to_float_x2_sptr = boost::shared_ptr<complex_byte_to_float_x2>;
|
||||
|
||||
complex_byte_to_float_x2_sptr make_complex_byte_to_float_x2();
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
class complex_float_to_complex_byte;
|
||||
|
||||
typedef boost::shared_ptr<complex_float_to_complex_byte> complex_float_to_complex_byte_sptr;
|
||||
using complex_float_to_complex_byte_sptr = boost::shared_ptr<complex_float_to_complex_byte>;
|
||||
|
||||
complex_float_to_complex_byte_sptr make_complex_float_to_complex_byte();
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user