1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-15 20:50:33 +00:00

Fix computation of CEP and bias accuracy

This commit is contained in:
Carles Fernandez 2018-09-02 09:22:52 +02:00
parent 5ffa5aba8e
commit 6ef9c51a3d
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
3 changed files with 37 additions and 25 deletions

View File

@ -35,21 +35,34 @@ bool rtklib_solver_dump_reader::read_binary_obs()
{ {
try try
{ {
d_dump_file.read(reinterpret_cast<char *>(&TOW_at_current_symbol_ms), sizeof(TOW_at_current_symbol_ms)); d_dump_file.read(reinterpret_cast<char *>(&TOW_at_current_symbol_ms), sizeof(uint32_t));
d_dump_file.read(reinterpret_cast<char *>(&week), sizeof(week)); d_dump_file.read(reinterpret_cast<char *>(&week), sizeof(uint32_t));
d_dump_file.read(reinterpret_cast<char *>(&RX_time), sizeof(RX_time)); d_dump_file.read(reinterpret_cast<char *>(&RX_time), sizeof(double));
d_dump_file.read(reinterpret_cast<char *>(&clk_offset_s), sizeof(clk_offset_s)); d_dump_file.read(reinterpret_cast<char *>(&clk_offset_s), sizeof(double));
d_dump_file.read(reinterpret_cast<char *>(&rr[0]), sizeof(rr)); d_dump_file.read(reinterpret_cast<char *>(&rr[0]), sizeof(double));
d_dump_file.read(reinterpret_cast<char *>(&qr[0]), sizeof(qr)); d_dump_file.read(reinterpret_cast<char *>(&rr[1]), sizeof(double));
d_dump_file.read(reinterpret_cast<char *>(&latitude), sizeof(latitude)); d_dump_file.read(reinterpret_cast<char *>(&rr[2]), sizeof(double));
d_dump_file.read(reinterpret_cast<char *>(&longitude), sizeof(longitude)); d_dump_file.read(reinterpret_cast<char *>(&rr[3]), sizeof(double));
d_dump_file.read(reinterpret_cast<char *>(&height), sizeof(height)); d_dump_file.read(reinterpret_cast<char *>(&rr[4]), sizeof(double));
d_dump_file.read(reinterpret_cast<char *>(&ns), sizeof(ns)); d_dump_file.read(reinterpret_cast<char *>(&rr[5]), sizeof(double));
d_dump_file.read(reinterpret_cast<char *>(&status), sizeof(status)); d_dump_file.read(reinterpret_cast<char *>(&qr[0]), sizeof(double));
d_dump_file.read(reinterpret_cast<char *>(&type), sizeof(type)); d_dump_file.read(reinterpret_cast<char *>(&qr[1]), sizeof(double));
d_dump_file.read(reinterpret_cast<char *>(&AR_ratio), sizeof(AR_ratio)); d_dump_file.read(reinterpret_cast<char *>(&qr[2]), sizeof(double));
d_dump_file.read(reinterpret_cast<char *>(&AR_thres), sizeof(AR_thres)); d_dump_file.read(reinterpret_cast<char *>(&qr[3]), sizeof(double));
d_dump_file.read(reinterpret_cast<char *>(&dop[0]), sizeof(dop)); d_dump_file.read(reinterpret_cast<char *>(&qr[4]), sizeof(double));
d_dump_file.read(reinterpret_cast<char *>(&qr[5]), sizeof(double));
d_dump_file.read(reinterpret_cast<char *>(&latitude), sizeof(double));
d_dump_file.read(reinterpret_cast<char *>(&longitude), sizeof(double));
d_dump_file.read(reinterpret_cast<char *>(&height), sizeof(double));
d_dump_file.read(reinterpret_cast<char *>(&ns), sizeof(uint8_t));
d_dump_file.read(reinterpret_cast<char *>(&status), sizeof(uint8_t));
d_dump_file.read(reinterpret_cast<char *>(&type), sizeof(uint8_t));
d_dump_file.read(reinterpret_cast<char *>(&AR_ratio), sizeof(float));
d_dump_file.read(reinterpret_cast<char *>(&AR_thres), sizeof(float));
d_dump_file.read(reinterpret_cast<char *>(&dop[0]), sizeof(double));
d_dump_file.read(reinterpret_cast<char *>(&dop[1]), sizeof(double));
d_dump_file.read(reinterpret_cast<char *>(&dop[2]), sizeof(double));
d_dump_file.read(reinterpret_cast<char *>(&dop[3]), sizeof(double));
} }
catch (const std::ifstream::failure &e) catch (const std::ifstream::failure &e)
{ {
@ -77,8 +90,7 @@ bool rtklib_solver_dump_reader::restart()
int64_t rtklib_solver_dump_reader::num_epochs() int64_t rtklib_solver_dump_reader::num_epochs()
{ {
std::ifstream::pos_type size; std::ifstream::pos_type size;
int epoch_size_bytes = sizeof(TOW_at_current_symbol_ms) + sizeof(week) + sizeof(RX_time) + sizeof(clk_offset_s) + sizeof(rr) + sizeof(qr) + sizeof(latitude) + sizeof(longitude) + sizeof(height) + sizeof(ns) + sizeof(status) + sizeof(type) + sizeof(AR_ratio) + sizeof(AR_thres) + sizeof(dop); int epoch_size_bytes = 2 * sizeof(uint32_t) + 21 * sizeof(double) + 3 * sizeof(uint8_t) + 2 * sizeof(float);
std::ifstream tmpfile(d_dump_filename.c_str(), std::ios::binary | std::ios::ate); std::ifstream tmpfile(d_dump_filename.c_str(), std::ios::binary | std::ios::ate);
if (tmpfile.is_open()) if (tmpfile.is_open())
{ {

View File

@ -45,7 +45,7 @@ public:
int64_t num_epochs(); int64_t num_epochs();
bool open_obs_file(std::string out_file); bool open_obs_file(std::string out_file);
//rtklib_solver dump variables // rtklib_solver dump variables
// TOW // TOW
uint32_t TOW_at_current_symbol_ms; uint32_t TOW_at_current_symbol_ms;
// WEEK // WEEK
@ -57,7 +57,7 @@ public:
// ECEF POS X,Y,X [m] + ECEF VEL X,Y,X [m/s] (6 x double) // ECEF POS X,Y,X [m] + ECEF VEL X,Y,X [m/s] (6 x double)
double rr[6]; double rr[6];
// position variance/covariance (m^2) {c_xx,c_yy,c_zz,c_xy,c_yz,c_zx} (6 x double) // position variance/covariance (m^2) {c_xx,c_yy,c_zz,c_xy,c_yz,c_zx} (6 x double)
float qr[6]; double qr[6];
// GEO user position Latitude [deg] // GEO user position Latitude [deg]
double latitude; double latitude;
@ -72,12 +72,12 @@ public:
uint8_t status; uint8_t status;
// RTKLIB solution type (0:xyz-ecef,1:enu-baseline) // RTKLIB solution type (0:xyz-ecef,1:enu-baseline)
uint8_t type; uint8_t type;
//AR ratio factor for validation // AR ratio factor for validation
float AR_ratio; float AR_ratio;
//AR ratio threshold for validation // AR ratio threshold for validation
float AR_thres; float AR_thres;
//GDOP//PDOP//HDOP//VDOP // GDOP / PDOP / HDOP / VDOP
double dop[4]; double dop[4];
private: private:

View File

@ -614,13 +614,13 @@ void StaticPositionSystemTest::check_results()
stm << "---- ACCURACY ----" << std::endl; stm << "---- ACCURACY ----" << std::endl;
stm << "2DRMS = " << 2 * sqrt(sigma_E_2_accuracy + sigma_N_2_accuracy) << " [m]" << std::endl; stm << "2DRMS = " << 2 * sqrt(sigma_E_2_accuracy + sigma_N_2_accuracy) << " [m]" << std::endl;
stm << "DRMS = " << sqrt(sigma_E_2_accuracy + sigma_N_2_accuracy) << " [m]" << std::endl; stm << "DRMS = " << sqrt(sigma_E_2_accuracy + sigma_N_2_accuracy) << " [m]" << std::endl;
stm << "CEP = " << 0.62 * compute_stdev_accuracy(pos_n, 0.0) + 0.56 * compute_stdev_accuracy(pos_e, 0.0) << " [m]" << std::endl; stm << "CEP = " << 0.62 * compute_stdev_accuracy(pos_n, ref_n) + 0.56 * compute_stdev_accuracy(pos_e, ref_e) << " [m]" << std::endl;
stm << "99% SAS = " << 1.122 * (sigma_E_2_accuracy + sigma_N_2_accuracy + sigma_U_2_accuracy) << " [m]" << std::endl; stm << "99% SAS = " << 1.122 * (sigma_E_2_accuracy + sigma_N_2_accuracy + sigma_U_2_accuracy) << " [m]" << std::endl;
stm << "90% SAS = " << 0.833 * (sigma_E_2_accuracy + sigma_N_2_accuracy + sigma_U_2_accuracy) << " [m]" << std::endl; stm << "90% SAS = " << 0.833 * (sigma_E_2_accuracy + sigma_N_2_accuracy + sigma_U_2_accuracy) << " [m]" << std::endl;
stm << "MRSE = " << sqrt(sigma_E_2_accuracy + sigma_N_2_accuracy + sigma_U_2_accuracy) << " [m]" << std::endl; stm << "MRSE = " << sqrt(sigma_E_2_accuracy + sigma_N_2_accuracy + sigma_U_2_accuracy) << " [m]" << std::endl;
stm << "SEP = " << 0.51 * (sigma_E_2_accuracy + sigma_N_2_accuracy + sigma_U_2_accuracy) << " [m]" << std::endl; stm << "SEP = " << 0.51 * (sigma_E_2_accuracy + sigma_N_2_accuracy + sigma_U_2_accuracy) << " [m]" << std::endl;
stm << "Bias 2D = " << sqrt(std::pow(mean__e, 2.0) + std::pow(mean__n, 2.0)) << " [m]" << std::endl; stm << "Bias 2D = " << sqrt(std::pow(abs(mean__e - ref_e), 2.0) + std::pow(abs(mean__n - ref_n), 2.0)) << " [m]" << std::endl;
stm << "Bias 3D = " << sqrt(std::pow(mean__e, 2.0) + std::pow(mean__n, 2.0) + std::pow(mean__u, 2.0)) << " [m]" << std::endl; stm << "Bias 3D = " << sqrt(std::pow(abs(mean__e - ref_e), 2.0) + std::pow(abs(mean__n - ref_n), 2.0) + std::pow(abs(mean__u - ref_u), 2.0)) << " [m]" << std::endl;
stm << std::endl; stm << std::endl;
} }