Add fusion trajectory replay view
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -179,6 +179,34 @@ int main(int argc, char **argv)
|
||||
assert(closeTo(*parsed->hheight, 198.80186179187148809433));
|
||||
}
|
||||
|
||||
{
|
||||
const auto parsed = LocationParser::parseLine(QStringLiteral(
|
||||
"[LOCATION] source=imu_corrected lat=40.7356 lon=31.5985 height=812.7 "
|
||||
"gdop=4.7 pdop=4.1 hdop=2.7 vdop=3.0 tdop=2.3 tracked=6 used=5"));
|
||||
assert(parsed.has_value());
|
||||
assert(parsed->hasLocation());
|
||||
assert(parsed->source == LocationSource::ImuCorrected);
|
||||
assert(parsed->satellites == 6);
|
||||
assert(closeTo(*parsed->dop.hdop, 2.7));
|
||||
}
|
||||
|
||||
{
|
||||
const auto parsed = LocationParser::parseLine(QStringLiteral(
|
||||
"[LOCATION] source=gps lat=40.7357 lon=31.5986 height=811 tracked=5 used=5"));
|
||||
assert(parsed.has_value());
|
||||
assert(parsed->source == LocationSource::Gps);
|
||||
assert(parsed->satellites == 5);
|
||||
}
|
||||
|
||||
{
|
||||
const auto parsed = LocationParser::parseLine(QStringLiteral(
|
||||
"[LOCATION] source=trajectory lat=40.7358 lon=31.5987 height=810 tracked=4 used=4"));
|
||||
assert(parsed.has_value());
|
||||
assert(parsed->hasLocation());
|
||||
assert(parsed->source == LocationSource::Trajectory);
|
||||
assert(parsed->satellites == 4);
|
||||
}
|
||||
|
||||
const QString rinexPath = qEnvironmentVariable("LOCATION_PLOTTER_TEST_RINEX");
|
||||
if (!rinexPath.isEmpty()) {
|
||||
QFile file(rinexPath);
|
||||
|
||||
Reference in New Issue
Block a user