From 85eb221e4c9344a5c135789691e8e0500aa51482 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Harald=20Sch=C3=A4fer?= Date: Wed, 28 Feb 2024 19:55:57 -0800 Subject: [PATCH] GpsLocation: Rename accuracy to horizontal accuracy (#31629) * Rename accuracy to horizontal accuracy * typo in cereal --- cereal | 2 +- selfdrive/locationd/locationd.cc | 4 ++-- system/ubloxd/tests/print_gps_stats.py | 2 +- system/ubloxd/ublox_msg.cc | 2 +- tools/plotjuggler/layouts/gps_vs_llk.xml | 2 +- tools/plotjuggler/layouts/ublox-debug.xml | 2 +- tools/sim/lib/simulated_sensors.py | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cereal b/cereal index 2012d9fd16..2ad942be5b 160000 --- a/cereal +++ b/cereal @@ -1 +1 @@ -Subproject commit 2012d9fd16f62c737951ce2d1eb19d39f0c7615f +Subproject commit 2ad942be5b42532d7919c2127cb531e7178cbd2b diff --git a/selfdrive/locationd/locationd.cc b/selfdrive/locationd/locationd.cc index 1050d68b9b..26999cd684 100644 --- a/selfdrive/locationd/locationd.cc +++ b/selfdrive/locationd/locationd.cc @@ -310,7 +310,7 @@ void Localizer::input_fake_gps_observations(double current_time) { void Localizer::handle_gps(double current_time, const cereal::GpsLocationData::Reader& log, const double sensor_time_offset) { // ignore the message if the fix is invalid bool gps_invalid_flag = (log.getFlags() % 2 == 0); - bool gps_unreasonable = (Vector2d(log.getAccuracy(), log.getVerticalAccuracy()).norm() >= SANE_GPS_UNCERTAINTY); + bool gps_unreasonable = (Vector2d(log.getHorizontalAccuracy(), log.getVerticalAccuracy()).norm() >= SANE_GPS_UNCERTAINTY); bool gps_accuracy_insane = ((log.getVerticalAccuracy() <= 0) || (log.getSpeedAccuracy() <= 0) || (log.getBearingAccuracyDeg() <= 0)); bool gps_lat_lng_alt_insane = ((std::abs(log.getLatitude()) > 90) || (std::abs(log.getLongitude()) > 180) || (std::abs(log.getAltitude()) > ALTITUDE_SANITY_CHECK)); bool gps_vel_insane = (floatlist2vector(log.getVNED()).norm() > TRANS_SANITY_CHECK); @@ -331,7 +331,7 @@ void Localizer::handle_gps(double current_time, const cereal::GpsLocationData::R VectorXd ecef_pos = this->converter->ned2ecef({ 0.0, 0.0, 0.0 }).to_vector(); VectorXd ecef_vel = this->converter->ned2ecef({ log.getVNED()[0], log.getVNED()[1], log.getVNED()[2] }).to_vector() - ecef_pos; - float ecef_pos_std = std::sqrt(this->gps_variance_factor * std::pow(log.getAccuracy(), 2) + this->gps_vertical_variance_factor * std::pow(log.getVerticalAccuracy(), 2)); + float ecef_pos_std = std::sqrt(this->gps_variance_factor * std::pow(log.getHorizontalAccuracy(), 2) + this->gps_vertical_variance_factor * std::pow(log.getVerticalAccuracy(), 2)); MatrixXdr ecef_pos_R = Vector3d::Constant(std::pow(this->gps_std_factor * ecef_pos_std, 2)).asDiagonal(); MatrixXdr ecef_vel_R = Vector3d::Constant(std::pow(this->gps_std_factor * log.getSpeedAccuracy(), 2)).asDiagonal(); diff --git a/system/ubloxd/tests/print_gps_stats.py b/system/ubloxd/tests/print_gps_stats.py index cfddb7f8b8..edf94c060a 100755 --- a/system/ubloxd/tests/print_gps_stats.py +++ b/system/ubloxd/tests/print_gps_stats.py @@ -13,7 +13,7 @@ if __name__ == "__main__": cnos = [] for m in ug.measurementReport.measurements: cnos.append(m.cno) - print("Sats: %d Accuracy: %.2f m cnos" % (ug.measurementReport.numMeas, gle.accuracy), sorted(cnos)) + print("Sats: %d Accuracy: %.2f m cnos" % (ug.measurementReport.numMeas, gle.horizontalAccuracy), sorted(cnos)) except Exception: pass sm.update() diff --git a/system/ubloxd/ublox_msg.cc b/system/ubloxd/ublox_msg.cc index 7b4505dc81..eb1a1e4b19 100644 --- a/system/ubloxd/ublox_msg.cc +++ b/system/ubloxd/ublox_msg.cc @@ -132,7 +132,7 @@ kj::Array UbloxMsgParser::gen_nav_pvt(ubx_t::nav_pvt_t *msg) { gpsLoc.setAltitude(msg->height() * 1e-03); gpsLoc.setSpeed(msg->g_speed() * 1e-03); gpsLoc.setBearingDeg(msg->head_mot() * 1e-5); - gpsLoc.setAccuracy(msg->h_acc() * 1e-03); + gpsLoc.setHorizontalAccuracy(msg->h_acc() * 1e-03); std::tm timeinfo = std::tm(); timeinfo.tm_year = msg->year() - 1900; timeinfo.tm_mon = msg->month() - 1; diff --git a/tools/plotjuggler/layouts/gps_vs_llk.xml b/tools/plotjuggler/layouts/gps_vs_llk.xml index 44980712ed..69b8f20058 100644 --- a/tools/plotjuggler/layouts/gps_vs_llk.xml +++ b/tools/plotjuggler/layouts/gps_vs_llk.xml @@ -32,7 +32,7 @@ - + diff --git a/tools/plotjuggler/layouts/ublox-debug.xml b/tools/plotjuggler/layouts/ublox-debug.xml index d595a9ecc7..ea4dd35535 100644 --- a/tools/plotjuggler/layouts/ublox-debug.xml +++ b/tools/plotjuggler/layouts/ublox-debug.xml @@ -8,7 +8,7 @@ - + diff --git a/tools/sim/lib/simulated_sensors.py b/tools/sim/lib/simulated_sensors.py index df6a0aeeff..e78f984736 100644 --- a/tools/sim/lib/simulated_sensors.py +++ b/tools/sim/lib/simulated_sensors.py @@ -55,7 +55,7 @@ class SimulatedSensors: dat.gpsLocationExternal = { "unixTimestampMillis": int(time.time() * 1000), "flags": 1, # valid fix - "accuracy": 1.0, + "horizontalAccuracy": 1.0, "verticalAccuracy": 1.0, "speedAccuracy": 0.1, "bearingAccuracyDeg": 0.1,