mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-03-04 18:48:17 +00:00
Merge branch 'next' of https://github.com/carlesfernandez/gnss-sdr into next
This commit is contained in:
commit
bc9080e1cd
@ -52,6 +52,7 @@ option(ENABLE_OPENCL "Enable building of processing blocks implemented with Open
|
||||
option(ENABLE_GENERIC_ARCH "Builds a portable binary" OFF)
|
||||
option(ENABLE_PACKAGING "Enable software packaging" OFF)
|
||||
option(ENABLE_OWN_GLOG "Download glog and link it to gflags" OFF)
|
||||
option(ENABLE_LOG "Enable logging" ON)
|
||||
if(ENABLE_PACKAGING)
|
||||
set(ENABLE_GENERIC_ARCH ON)
|
||||
endif(ENABLE_PACKAGING)
|
||||
@ -596,6 +597,11 @@ else(NOT GLOG_FOUND OR ${LOCAL_GFLAGS})
|
||||
set_property(TARGET glog-${glog_RELEASE} PROPERTY IMPORTED_LOCATION "${GLOG_LIBRARIES}")
|
||||
endif(NOT GLOG_FOUND OR ${LOCAL_GFLAGS})
|
||||
|
||||
if(NOT ENABLE_LOG)
|
||||
message(STATUS "Logging is not enabled")
|
||||
add_definitions(-DGOOGLE_STRIP_LOG=1)
|
||||
endif(NOT ENABLE_LOG)
|
||||
|
||||
|
||||
|
||||
################################################################################
|
||||
|
@ -101,7 +101,7 @@ int Nmea_Printer::init_serial (std::string serial_device)
|
||||
fd = open(serial_device.c_str(), O_RDWR | O_NOCTTY | O_NDELAY);
|
||||
if (fd == -1) return fd; //failed to open TTY port
|
||||
|
||||
fcntl(fd, F_SETFL, 0); // clear all flags on descriptor, enable direct I/O
|
||||
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;
|
||||
|
@ -513,7 +513,7 @@ inline std::string& Rinex_Printer::sci2for(std::string& aStr,
|
||||
long iexp;
|
||||
//If checkSwitch is false, always redo the exponential. Otherwise,
|
||||
//set it to false.
|
||||
bool redoexp=!checkSwitch;
|
||||
bool redoexp =! checkSwitch;
|
||||
|
||||
// Check for decimal place within specified boundaries
|
||||
if ((idx == 0) || (idx >= (startPos + length - expLen - 1)))
|
||||
@ -526,12 +526,12 @@ inline std::string& Rinex_Printer::sci2for(std::string& aStr,
|
||||
// account for the possibility of non-scientific
|
||||
// notation (more than one digit to the left of the
|
||||
// decimal)
|
||||
if (idx > startPos)
|
||||
if ((idx > startPos) && (idx >= 1))
|
||||
{
|
||||
redoexp = true;
|
||||
// Swap digit and decimal.
|
||||
aStr[idx] = aStr[idx-1];
|
||||
aStr[idx-1] = '.';
|
||||
aStr[idx] = aStr[idx - 1];
|
||||
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;
|
||||
|
@ -84,14 +84,16 @@ Rtcm_Printer::~Rtcm_Printer()
|
||||
long pos;
|
||||
rtcm_file_descriptor.close();
|
||||
pos = rtcm_file_descriptor.tellp();
|
||||
if (pos == 0) remove(rtcm_filename.c_str());
|
||||
if (pos == 0)
|
||||
{
|
||||
if(remove(rtcm_filename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file";
|
||||
}
|
||||
}
|
||||
close_serial();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int Rtcm_Printer::init_serial(std::string serial_device)
|
||||
{
|
||||
/*!
|
||||
@ -108,7 +110,7 @@ int Rtcm_Printer::init_serial(std::string serial_device)
|
||||
fd = open(serial_device.c_str(), O_RDWR | O_NOCTTY | O_NDELAY);
|
||||
if (fd == -1) return fd; // failed to open TTY port
|
||||
|
||||
fcntl(fd, F_SETFL, 0); // clear all flags on descriptor, enable direct I/O
|
||||
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;
|
||||
|
@ -103,7 +103,7 @@ galileo_e5a_noncoherentIQ_acquisition_caf_cc::galileo_e5a_noncoherentIQ_acquisit
|
||||
d_input_power = 0.0;
|
||||
d_num_doppler_bins = 0;
|
||||
d_bit_transition_flag = bit_transition_flag;
|
||||
d_buffer_count=0;
|
||||
d_buffer_count = 0;
|
||||
d_both_signal_components = both_signal_components_;
|
||||
d_CAF_window_hz = CAF_window_hz_;
|
||||
|
||||
@ -137,6 +137,20 @@ galileo_e5a_noncoherentIQ_acquisition_caf_cc::galileo_e5a_noncoherentIQ_acquisit
|
||||
// For dumping samples into a file
|
||||
d_dump = dump;
|
||||
d_dump_filename = dump_filename;
|
||||
|
||||
d_doppler_resolution = 0;
|
||||
d_threshold = 0;
|
||||
d_doppler_step = 250;
|
||||
d_grid_doppler_wipeoffs = 0;
|
||||
d_gnss_synchro = 0;
|
||||
d_code_phase = 0;
|
||||
d_doppler_freq = 0;
|
||||
d_test_statistics = 0;
|
||||
d_channel_internal_queue = 0;
|
||||
d_CAF_vector_I = 0;
|
||||
d_CAF_vector_Q = 0;
|
||||
d_channel = 0;
|
||||
d_gr_stream_buffer = 0;
|
||||
}
|
||||
|
||||
galileo_e5a_noncoherentIQ_acquisition_caf_cc::~galileo_e5a_noncoherentIQ_acquisition_caf_cc()
|
||||
@ -365,7 +379,7 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
|
||||
// If buffer will be full in next iteration
|
||||
if (d_buffer_count >= d_fft_size - d_gr_stream_buffer)
|
||||
{
|
||||
d_state=2;
|
||||
d_state = 2;
|
||||
}
|
||||
d_buffer_count += buff_increment;
|
||||
d_sample_counter += buff_increment; // sample counter
|
||||
|
@ -92,6 +92,17 @@ galileo_pcps_8ms_acquisition_cc::galileo_pcps_8ms_acquisition_cc(
|
||||
// For dumping samples into a file
|
||||
d_dump = dump;
|
||||
d_dump_filename = dump_filename;
|
||||
|
||||
d_doppler_resolution = 0;
|
||||
d_threshold = 0;
|
||||
d_doppler_step = 0;
|
||||
d_grid_doppler_wipeoffs = 0;
|
||||
d_gnss_synchro = 0;
|
||||
d_code_phase = 0;
|
||||
d_doppler_freq = 0;
|
||||
d_test_statistics = 0;
|
||||
d_channel_internal_queue = 0;
|
||||
d_channel = 0;
|
||||
}
|
||||
|
||||
galileo_pcps_8ms_acquisition_cc::~galileo_pcps_8ms_acquisition_cc()
|
||||
|
@ -126,5 +126,5 @@ void galileo_e5_a_code_gen_complex_sampled(std::complex<float>* _dest, char _Sig
|
||||
_dest[(i + delay) % _samplesPerCode] = _code[i];
|
||||
}
|
||||
|
||||
free(_code);
|
||||
delete[] _code;
|
||||
}
|
||||
|
@ -247,7 +247,7 @@ galileo_e5a_telemetry_decoder_cc::galileo_e5a_telemetry_decoder_cc(
|
||||
//
|
||||
d_sample_counter = 0;
|
||||
d_state = 0;
|
||||
d_preamble_lock=false;
|
||||
d_preamble_lock = false;
|
||||
d_preamble_index = 0;
|
||||
d_preamble_time_seconds = 0;
|
||||
d_flag_frame_sync = false;
|
||||
@ -260,6 +260,15 @@ galileo_e5a_telemetry_decoder_cc::galileo_e5a_telemetry_decoder_cc(
|
||||
|
||||
d_CRC_error_counter = 0;
|
||||
d_sign_init = 0;
|
||||
|
||||
d_flag_preamble = false;
|
||||
d_ephemeris_queue = 0;
|
||||
d_iono_queue = 0;
|
||||
d_utc_model_queue = 0;
|
||||
d_almanac_queue = 0;
|
||||
d_channel = 0;
|
||||
Prn_timestamp_at_preamble_ms = 0;
|
||||
flag_TOW_set = false;
|
||||
}
|
||||
|
||||
galileo_e5a_telemetry_decoder_cc::~galileo_e5a_telemetry_decoder_cc()
|
||||
|
@ -104,7 +104,7 @@ private:
|
||||
signed int d_preamble_bits[GALILEO_FNAV_PREAMBLE_LENGTH_BITS];
|
||||
// signed int d_page_symbols[GALILEO_FNAV_SYMBOLS_PER_PAGE + GALILEO_FNAV_PREAMBLE_LENGTH_BITS];
|
||||
double d_page_symbols[GALILEO_FNAV_SYMBOLS_PER_PAGE + GALILEO_FNAV_PREAMBLE_LENGTH_BITS];
|
||||
signed int *d_preamble_symbols;
|
||||
// signed int *d_preamble_symbols;
|
||||
double d_current_symbol;
|
||||
long unsigned int d_symbol_counter;
|
||||
int d_prompt_counter;
|
||||
|
@ -338,7 +338,11 @@ int Viterbi_Decoder::do_tb_and_decode(int traceback_length, int requested_decodi
|
||||
state = it->get_anchestor_state_of_current_state(state);
|
||||
t_out--;
|
||||
}
|
||||
indicator_metric /= n_im;
|
||||
if(n_im > 0)
|
||||
{
|
||||
indicator_metric /= n_im;
|
||||
}
|
||||
|
||||
VLOG(BLOCK) << "indicator metric: " << indicator_metric;
|
||||
// remove old states
|
||||
if (d_trellis_paths.begin() + traceback_length + overstep_length <= d_trellis_paths.end())
|
||||
|
@ -273,7 +273,7 @@ void Gnss_Satellite::set_block(const std::string& system_, unsigned int PRN_ )
|
||||
block = std::string("IIR-M"); //Plane A
|
||||
break;
|
||||
case 8 :
|
||||
block = std::string("UNKNOWN"); // Decommissioned
|
||||
block = std::string("IIA*"); // Decommissed
|
||||
break;
|
||||
case 9 :
|
||||
block = std::string("IIF"); //Plane F
|
||||
|
@ -34,6 +34,10 @@
|
||||
#define GNSS_SDR_VERSION "0.0.5"
|
||||
#endif
|
||||
|
||||
#ifndef GOOGLE_STRIP_LOG
|
||||
#define GOOGLE_STRIP_LOG 0
|
||||
#endif
|
||||
|
||||
#include <ctime>
|
||||
#include <cstdlib>
|
||||
#include <memory>
|
||||
@ -131,34 +135,37 @@ int main(int argc, char** argv)
|
||||
google::ParseCommandLineFlags(&argc, &argv, true);
|
||||
std::cout << "Initializing GNSS-SDR v" << gnss_sdr_version << " ... Please wait." << std::endl;
|
||||
|
||||
google::InitGoogleLogging(argv[0]);
|
||||
if (FLAGS_log_dir.empty())
|
||||
if(GOOGLE_STRIP_LOG == 0)
|
||||
{
|
||||
std::cout << "Logging will be done at "
|
||||
<< boost::filesystem::temp_directory_path()
|
||||
<< std::endl
|
||||
<< "Use gnss-sdr --log_dir=/path/to/log to change that."
|
||||
<< std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
const boost::filesystem::path p (FLAGS_log_dir);
|
||||
if (!boost::filesystem::exists(p))
|
||||
google::InitGoogleLogging(argv[0]);
|
||||
if (FLAGS_log_dir.empty())
|
||||
{
|
||||
std::cout << "The path "
|
||||
<< FLAGS_log_dir
|
||||
<< " does not exist, attempting to create it."
|
||||
std::cout << "Logging will be done at "
|
||||
<< boost::filesystem::temp_directory_path()
|
||||
<< std::endl
|
||||
<< "Use gnss-sdr --log_dir=/path/to/log to change that."
|
||||
<< std::endl;
|
||||
boost::system::error_code ec;
|
||||
boost::filesystem::create_directory(p, ec);
|
||||
if(ec != 0)
|
||||
{
|
||||
std::cout << "Could not create the " << FLAGS_log_dir << " folder. GNSS-SDR program ended." << std::endl;
|
||||
google::ShutDownCommandLineFlags();
|
||||
std::exit(0);
|
||||
}
|
||||
}
|
||||
std::cout << "Logging with be done at " << FLAGS_log_dir << std::endl;
|
||||
else
|
||||
{
|
||||
const boost::filesystem::path p (FLAGS_log_dir);
|
||||
if (!boost::filesystem::exists(p))
|
||||
{
|
||||
std::cout << "The path "
|
||||
<< FLAGS_log_dir
|
||||
<< " does not exist, attempting to create it."
|
||||
<< std::endl;
|
||||
boost::system::error_code ec;
|
||||
boost::filesystem::create_directory(p, ec);
|
||||
if(ec != 0)
|
||||
{
|
||||
std::cout << "Could not create the " << FLAGS_log_dir << " folder. GNSS-SDR program ended." << std::endl;
|
||||
google::ShutDownCommandLineFlags();
|
||||
std::exit(0);
|
||||
}
|
||||
}
|
||||
std::cout << "Logging with be done at " << FLAGS_log_dir << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
std::unique_ptr<ControlThread> control_thread(new ControlThread());
|
||||
@ -176,14 +183,14 @@ int main(int argc, char** argv)
|
||||
{
|
||||
LOG(FATAL) << "Boost exception: " << boost::diagnostic_information(e);
|
||||
}
|
||||
catch( boost::lock_error & le )
|
||||
{
|
||||
LOG(FATAL) << "Lock error exception: " << boost::diagnostic_information(le);
|
||||
}
|
||||
catch(std::exception const& ex)
|
||||
{
|
||||
LOG(FATAL) << "STD exception: " << ex.what();
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
LOG(INFO) << "Unexpected catch";
|
||||
}
|
||||
// report the elapsed time
|
||||
gettimeofday(&tv, NULL);
|
||||
long long int end = tv.tv_sec * 1000000 + tv.tv_usec;
|
||||
|
Loading…
x
Reference in New Issue
Block a user