GpsLocation: Rename accuracy to horizontal accuracy (#31629)

* Rename accuracy to horizontal accuracy

* typo in cereal
old-commit-hash: 85eb221e4c
This commit is contained in:
Harald Schäfer 2024-02-28 19:55:57 -08:00 committed by GitHub
parent ae2cfa285a
commit add26a5d1f
7 changed files with 8 additions and 8 deletions

2
cereal

@ -1 +1 @@
Subproject commit 2012d9fd16f62c737951ce2d1eb19d39f0c7615f
Subproject commit 2ad942be5b42532d7919c2127cb531e7178cbd2b

View File

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

View File

@ -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()

View File

@ -132,7 +132,7 @@ kj::Array<capnp::word> 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;

View File

@ -32,7 +32,7 @@
<plot mode="TimeSeries" style="Lines" flip_y="false" flip_x="false">
<range bottom="-0.449385" right="196.811937" left="76.646983" top="7.160833"/>
<limitY/>
<curve name="/gpsLocationExternal/accuracy" color="#ff7f0e"/>
<curve name="/gpsLocationExternal/horizontalAccuracy" color="#ff7f0e"/>
<curve name="/gpsLocationExternal/verticalAccuracy" color="#f14cc1"/>
<curve name="/gpsLocationExternal/speedAccuracy" color="#9467bd"/>
</plot>

View File

@ -8,7 +8,7 @@
<plot style="Lines" flip_x="false" flip_y="false" mode="TimeSeries">
<range right="134.825489" top="4402341.574525" bottom="-107369.555525" left="0.000000"/>
<limitY/>
<curve name="/gpsLocationExternal/accuracy" color="#1f77b4"/>
<curve name="/gpsLocationExternal/horizontalAccuracy" color="#1f77b4"/>
</plot>
</DockArea>
<DockArea name="...">

View File

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