mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-05 15:00:33 +00:00
Merge branch 'next' of https://github.com/carlesfernandez/gnss-sdr into next
This commit is contained in:
commit
754ae9e61d
@ -34,6 +34,7 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
|
|
||||||
Monitor_Pvt_Udp_Sink::Monitor_Pvt_Udp_Sink(std::vector<std::string> addresses, const uint16_t& port) : socket{io_service}
|
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)
|
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);
|
boost::asio::ip::udp::endpoint endpoint(boost::asio::ip::address::from_string(address, error), port);
|
||||||
endpoints.push_back(endpoint);
|
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;
|
std::ostringstream archive_stream;
|
||||||
boost::archive::binary_oarchive oa{archive_stream};
|
boost::archive::binary_oarchive oa{archive_stream};
|
||||||
|
@ -39,7 +39,7 @@ class Monitor_Pvt_Udp_Sink
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Monitor_Pvt_Udp_Sink(std::vector<std::string> addresses, const uint16_t &port);
|
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:
|
private:
|
||||||
boost::asio::io_service io_service;
|
boost::asio::io_service io_service;
|
||||||
|
@ -67,4 +67,7 @@ Pvt_Conf::Pvt_Conf()
|
|||||||
kml_output_path = std::string(".");
|
kml_output_path = std::string(".");
|
||||||
xml_output_path = std::string(".");
|
xml_output_path = std::string(".");
|
||||||
rtcm_output_file_path = std::string(".");
|
rtcm_output_file_path = std::string(".");
|
||||||
|
|
||||||
|
monitor_enabled = false;
|
||||||
|
udp_port = 0;
|
||||||
}
|
}
|
||||||
|
@ -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()
|
bool rtklib_solver::save_matfile()
|
||||||
|
@ -57,7 +57,7 @@ void beidou_b1i_code_gen_int(int32_t* _dest, int32_t _prn, uint32_t _chip_shift)
|
|||||||
prn_idx = _prn - 1;
|
prn_idx = _prn - 1;
|
||||||
|
|
||||||
/* A simple error check */
|
/* A simple error check */
|
||||||
if ((prn_idx < 0) || (prn_idx > 51))
|
if ((prn_idx < 0) || (prn_idx > 32))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -388,6 +388,7 @@ alm_t alm_to_rtklib(const Gps_Almanac& gps_alm)
|
|||||||
rtklib_alm.week = gps_alm.i_WNa;
|
rtklib_alm.week = gps_alm.i_WNa;
|
||||||
gtime_t toa;
|
gtime_t toa;
|
||||||
toa.time = gps_alm.i_Toa;
|
toa.time = gps_alm.i_Toa;
|
||||||
|
toa.sec = 0.0;
|
||||||
rtklib_alm.toa = toa;
|
rtklib_alm.toa = toa;
|
||||||
rtklib_alm.A = gps_alm.d_sqrt_A * gps_alm.d_sqrt_A;
|
rtklib_alm.A = gps_alm.d_sqrt_A * gps_alm.d_sqrt_A;
|
||||||
rtklib_alm.e = gps_alm.d_e_eccentricity;
|
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;
|
rtklib_alm.week = gal_alm.i_WNa;
|
||||||
gtime_t toa;
|
gtime_t toa;
|
||||||
toa.time = gal_alm.i_Toa;
|
toa.time = gal_alm.i_Toa;
|
||||||
|
toa.sec = 0.0;
|
||||||
rtklib_alm.toa = toa;
|
rtklib_alm.toa = toa;
|
||||||
rtklib_alm.A = 5440.588203494 + gal_alm.d_Delta_sqrt_A;
|
rtklib_alm.A = 5440.588203494 + gal_alm.d_Delta_sqrt_A;
|
||||||
rtklib_alm.A = rtklib_alm.A * rtklib_alm.A;
|
rtklib_alm.A = rtklib_alm.A * rtklib_alm.A;
|
||||||
|
@ -123,6 +123,7 @@ beidou_b1i_telemetry_decoder_cc::beidou_b1i_telemetry_decoder_cc(
|
|||||||
d_preamble_index = 0;
|
d_preamble_index = 0;
|
||||||
d_flag_frame_sync = false;
|
d_flag_frame_sync = false;
|
||||||
d_TOW_at_current_symbol_ms = 0;
|
d_TOW_at_current_symbol_ms = 0;
|
||||||
|
d_TOW_at_Preamble_ms = 0U;
|
||||||
Flag_valid_word = false;
|
Flag_valid_word = false;
|
||||||
d_CRC_error_counter = 0;
|
d_CRC_error_counter = 0;
|
||||||
d_flag_preamble = false;
|
d_flag_preamble = false;
|
||||||
|
@ -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_length = 0U;
|
||||||
d_secondary_code_string = nullptr;
|
d_secondary_code_string = nullptr;
|
||||||
d_preambles_symbols = nullptr;
|
d_preambles_symbols = nullptr;
|
||||||
|
d_preamble_length_symbols = 0;
|
||||||
signal_type = std::string(trk_parameters.signal);
|
signal_type = std::string(trk_parameters.signal);
|
||||||
|
|
||||||
std::map<std::string, std::string> map_signal_pretty_name;
|
std::map<std::string, std::string> map_signal_pretty_name;
|
||||||
|
@ -879,7 +879,7 @@ std::vector<std::pair<int, Gnss_Satellite>> ControlThread::get_visible_sats(time
|
|||||||
// 2. Compute rx GPS time from UTC time
|
// 2. Compute rx GPS time from UTC time
|
||||||
gtime_t utc_gtime;
|
gtime_t utc_gtime;
|
||||||
utc_gtime.time = rx_utc_time;
|
utc_gtime.time = rx_utc_time;
|
||||||
utc_gtime.sec = 0;
|
utc_gtime.sec = 0.0;
|
||||||
gtime_t gps_gtime = utc2gpst(utc_gtime);
|
gtime_t gps_gtime = utc2gpst(utc_gtime);
|
||||||
|
|
||||||
// 3. loop through all the available ephemeris or almanac and compute satellite positions and elevations
|
// 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;
|
double clock_bias_s;
|
||||||
gtime_t aux_gtime;
|
gtime_t aux_gtime;
|
||||||
aux_gtime.time = fmod(utc2gpst(gps_gtime).time + 345600, 604800);
|
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);
|
alm2pos(aux_gtime, &rtklib_alm, &r_sat[0], &clock_bias_s);
|
||||||
double Az, El, dist_m;
|
double Az, El, dist_m;
|
||||||
arma::vec r_sat_eb_e = arma::vec{r_sat[0], r_sat[1], r_sat[2]};
|
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;
|
double clock_bias_s;
|
||||||
gtime_t gal_gtime;
|
gtime_t gal_gtime;
|
||||||
gal_gtime.time = fmod(utc2gpst(gps_gtime).time + 345600, 604800);
|
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);
|
alm2pos(gal_gtime, &rtklib_alm, &r_sat[0], &clock_bias_s);
|
||||||
double Az, El, dist_m;
|
double Az, El, dist_m;
|
||||||
arma::vec r_sat_eb_e = arma::vec{r_sat[0], r_sat[1], r_sat[2]};
|
arma::vec r_sat_eb_e = arma::vec{r_sat[0], r_sat[1], r_sat[2]};
|
||||||
|
@ -418,7 +418,7 @@ void GNSSFlowgraph::connect()
|
|||||||
{
|
{
|
||||||
decimation--;
|
decimation--;
|
||||||
};
|
};
|
||||||
double acq_fs = fs / decimation;
|
double acq_fs = static_cast<double>(fs) / static_cast<double>(decimation);
|
||||||
|
|
||||||
if (decimation > 1)
|
if (decimation > 1)
|
||||||
{
|
{
|
||||||
|
@ -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 = static_cast<double>(read_navigation_unsigned(subframe_bits, D2_E_MSB));
|
||||||
d_eccentricity_msb_bits = (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)
|
// 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;
|
d_eccentricity_msb_bits = d_eccentricity_msb_bits << 22;
|
||||||
|
|
||||||
// Set system flags for message reception
|
// Set system flags for message reception
|
||||||
|
@ -115,6 +115,7 @@ void Gps_Navigation_Message::reset()
|
|||||||
d_beta1 = 0.0;
|
d_beta1 = 0.0;
|
||||||
d_beta2 = 0.0;
|
d_beta2 = 0.0;
|
||||||
d_beta3 = 0.0;
|
d_beta3 = 0.0;
|
||||||
|
d_A2 = 0.0;
|
||||||
d_A1 = 0.0;
|
d_A1 = 0.0;
|
||||||
d_A0 = 0.0;
|
d_A0 = 0.0;
|
||||||
d_t_OT = 0;
|
d_t_OT = 0;
|
||||||
|
@ -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;
|
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||||
start = std::chrono::system_clock::now();
|
start = std::chrono::system_clock::now();
|
||||||
|
int return_code = 0;
|
||||||
int return_code;
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
std::unique_ptr<ControlThread> control_thread(new ControlThread());
|
||||||
|
// record startup time
|
||||||
|
start = std::chrono::system_clock::now();
|
||||||
return_code = control_thread->run();
|
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)
|
catch (const boost::exception& e)
|
||||||
{
|
{
|
||||||
if (GOOGLE_STRIP_LOG == 0)
|
if (GOOGLE_STRIP_LOG == 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user