Add fusion trajectory replay view
Ubuntu build / build-and-test (ubuntu-22.04) (push) Has been cancelled
Ubuntu build / build-and-test (ubuntu-24.04) (push) Has been cancelled

This commit is contained in:
2026-07-16 23:49:55 +03:00
parent 2856c5a560
commit 851642296a
10 changed files with 348 additions and 29 deletions
+40 -2
View File
@@ -12,6 +12,7 @@
#include <QTableView>
#include <QTabWidget>
#include <QSplitter>
#include <QTemporaryFile>
#include <cassert>
@@ -99,11 +100,48 @@ int main(int argc, char **argv)
sendLine(window, QStringLiteral("NAV solve done"));
flushUpdates(window);
assert(table->model()->rowCount() == 1);
assert(table->model()->data(table->model()->index(0, 1)).toString()
== QStringLiteral("40.78925034214206846173"));
assert(table->model()->data(table->model()->index(0, 2)).toString()
== QStringLiteral("40.78925034214206846173"));
assert(table->model()->data(table->model()->index(0, 3)).toString()
== QStringLiteral("29.46277530841727809729"));
sendLine(window, QStringLiteral(
"[LOCATION] source=gps lat=40.1 lon=29.1 height=100 gdop=2 pdop=1.5 "
"hdop=1 vdop=1.2 tdop=0.8 tracked=5 used=5"));
sendLine(window, QStringLiteral(
"[LOCATION] source=imu_corrected lat=40.10001 lon=29.10001 height=100.2 "
"gdop=2 pdop=1.5 hdop=1 vdop=1.2 tdop=0.8 tracked=5 used=5"));
flushUpdates(window);
assert(table->model()->rowCount() == 3);
assert(table->model()->data(table->model()->index(1, 1)).toString()
== QStringLiteral("GPS"));
assert(table->model()->data(table->model()->index(2, 1)).toString()
== QStringLiteral("IMU corrected"));
sendLine(window, QStringLiteral(
"[LOCATION] source=trajectory lat=40.10002 lon=29.10002 height=100 tracked=4 used=4"));
flushUpdates(window);
assert(table->model()->rowCount() == 4);
assert(table->model()->data(table->model()->index(3, 1)).toString()
== QStringLiteral("Trajectory (truth)"));
QTemporaryFile replayLog;
assert(replayLog.open());
replayLog.write(
"[LOCATION] source=trajectory lat=40.0 lon=29.0 height=100 tracked=4 used=4\n"
"[LOCATION] source=gps lat=40.0001 lon=29.0001 height=104 tracked=4 used=4\n"
"[LOCATION] source=imu_corrected lat=40.00002 lon=29.00002 height=101 tracked=4 used=4\n");
replayLog.flush();
assert(window.loadTelemetryLog(replayLog.fileName()));
assert(table->model()->rowCount() == 3);
assert(table->model()->data(table->model()->index(0, 1)).toString()
== QStringLiteral("Trajectory (truth)"));
assert(QMetaObject::invokeMethod(&window, "clearPoints", Qt::DirectConnection));
sendLine(window, QStringLiteral(
"lat=40.78925034214206846173 long=29.46277530841727809729"));
flushUpdates(window);
assert(table->model()->rowCount() == 1);
referenceLatInput->setText(QStringLiteral("40.78925034214206846173"));
referenceLonInput->setText(QStringLiteral("29.46277530841727809729"));
const bool referenceUpdated = QMetaObject::invokeMethod(