1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-07-07 12:14:20 +00:00
This commit is contained in:
Carles Fernandez 2019-02-14 23:45:23 +01:00
commit 754ae9e61d
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
13 changed files with 85 additions and 11 deletions

View File

@ -34,6 +34,7 @@
#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 (const auto& address : addresses)
@ -41,9 +42,38 @@ Monitor_Pvt_Udp_Sink::Monitor_Pvt_Udp_Sink(std::vector<std::string> addresses, c
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};

View File

@ -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;

View File

@ -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;
}

View File

@ -103,6 +103,35 @@ rtklib_solver::rtklib_solver(int nchannels, std::string dump_filename, bool flag
}
}
}
// 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()

View File

@ -57,7 +57,7 @@ void beidou_b1i_code_gen_int(int32_t* _dest, int32_t _prn, uint32_t _chip_shift)
prn_idx = _prn - 1;
/* A simple error check */
if ((prn_idx < 0) || (prn_idx > 51))
if ((prn_idx < 0) || (prn_idx > 32))
{
return;
}

View File

@ -388,6 +388,7 @@ alm_t alm_to_rtklib(const Gps_Almanac& gps_alm)
rtklib_alm.week = gps_alm.i_WNa;
gtime_t toa;
toa.time = gps_alm.i_Toa;
toa.sec = 0.0;
rtklib_alm.toa = toa;
rtklib_alm.A = gps_alm.d_sqrt_A * gps_alm.d_sqrt_A;
rtklib_alm.e = gps_alm.d_e_eccentricity;
@ -416,6 +417,7 @@ alm_t alm_to_rtklib(const Galileo_Almanac& gal_alm)
rtklib_alm.week = gal_alm.i_WNa;
gtime_t toa;
toa.time = gal_alm.i_Toa;
toa.sec = 0.0;
rtklib_alm.toa = toa;
rtklib_alm.A = 5440.588203494 + gal_alm.d_Delta_sqrt_A;
rtklib_alm.A = rtklib_alm.A * rtklib_alm.A;

View File

@ -123,6 +123,7 @@ beidou_b1i_telemetry_decoder_cc::beidou_b1i_telemetry_decoder_cc(
d_preamble_index = 0;
d_flag_frame_sync = false;
d_TOW_at_current_symbol_ms = 0;
d_TOW_at_Preamble_ms = 0U;
Flag_valid_word = false;
d_CRC_error_counter = 0;
d_flag_preamble = false;

View File

@ -99,6 +99,7 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(const Dll_Pll_Conf &conf_) : gr::bl
d_secondary_code_length = 0U;
d_secondary_code_string = nullptr;
d_preambles_symbols = nullptr;
d_preamble_length_symbols = 0;
signal_type = std::string(trk_parameters.signal);
std::map<std::string, std::string> map_signal_pretty_name;

View File

@ -879,7 +879,7 @@ std::vector<std::pair<int, Gnss_Satellite>> ControlThread::get_visible_sats(time
// 2. Compute rx GPS time from UTC time
gtime_t utc_gtime;
utc_gtime.time = rx_utc_time;
utc_gtime.sec = 0;
utc_gtime.sec = 0.0;
gtime_t gps_gtime = utc2gpst(utc_gtime);
// 3. loop through all the available ephemeris or almanac and compute satellite positions and elevations
@ -950,6 +950,7 @@ std::vector<std::pair<int, Gnss_Satellite>> ControlThread::get_visible_sats(time
double clock_bias_s;
gtime_t aux_gtime;
aux_gtime.time = fmod(utc2gpst(gps_gtime).time + 345600, 604800);
aux_gtime.sec = 0.0;
alm2pos(aux_gtime, &rtklib_alm, &r_sat[0], &clock_bias_s);
double Az, El, dist_m;
arma::vec r_sat_eb_e = arma::vec{r_sat[0], r_sat[1], r_sat[2]};
@ -977,6 +978,7 @@ std::vector<std::pair<int, Gnss_Satellite>> ControlThread::get_visible_sats(time
double clock_bias_s;
gtime_t gal_gtime;
gal_gtime.time = fmod(utc2gpst(gps_gtime).time + 345600, 604800);
gal_gtime.sec = 0.0;
alm2pos(gal_gtime, &rtklib_alm, &r_sat[0], &clock_bias_s);
double Az, El, dist_m;
arma::vec r_sat_eb_e = arma::vec{r_sat[0], r_sat[1], r_sat[2]};

View File

@ -418,7 +418,7 @@ void GNSSFlowgraph::connect()
{
decimation--;
};
double acq_fs = fs / decimation;
double acq_fs = static_cast<double>(fs) / static_cast<double>(decimation);
if (decimation > 1)
{

View File

@ -831,7 +831,7 @@ int32_t Beidou_Dnav_Navigation_Message::d2_subframe_decoder(std::string const& s
d_eccentricity_msb = static_cast<double>(read_navigation_unsigned(subframe_bits, D2_E_MSB));
d_eccentricity_msb_bits = (read_navigation_unsigned(subframe_bits, D2_E_MSB));
// Adjust for lsb in next page (shift number of lsb to the left)
d_eccentricity_msb = static_cast<double>((static_cast<int>(d_eccentricity_msb) << 22));
d_eccentricity_msb = d_eccentricity_msb << 22;
d_eccentricity_msb_bits = d_eccentricity_msb_bits << 22;
// Set system flags for message reception

View File

@ -115,6 +115,7 @@ void Gps_Navigation_Message::reset()
d_beta1 = 0.0;
d_beta2 = 0.0;
d_beta3 = 0.0;
d_A2 = 0.0;
d_A1 = 0.0;
d_A0 = 0.0;
d_t_OT = 0;

View File

@ -132,17 +132,22 @@ int main(int argc, char** argv)
}
}
std::unique_ptr<ControlThread> control_thread(new ControlThread());
// record startup time
std::chrono::time_point<std::chrono::system_clock> start, end;
start = std::chrono::system_clock::now();
int return_code;
int return_code = 0;
try
{
std::unique_ptr<ControlThread> control_thread(new ControlThread());
// record startup time
start = std::chrono::system_clock::now();
return_code = control_thread->run();
}
catch (const boost::thread_resource_error& e)
{
std::cout << "Failed to create boost thread." << std::endl;
google::ShutDownCommandLineFlags();
return 1;
}
catch (const boost::exception& e)
{
if (GOOGLE_STRIP_LOG == 0)