Lock map tracking to corrected IMU output
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
#include <QTemporaryFile>
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -93,6 +94,27 @@ int main(int argc, char **argv)
|
||||
assert(toggleSerialAction != nullptr && !toggleSerialAction->shortcut().isEmpty());
|
||||
assert(rinexUpdateAction != nullptr && !rinexUpdateAction->shortcut().isEmpty());
|
||||
|
||||
QVector<TelemetryPoint> followPoints;
|
||||
TelemetryPoint gpsPoint;
|
||||
gpsPoint.source = LocationSource::Gps;
|
||||
gpsPoint.latitude = 40.0;
|
||||
gpsPoint.longitude = 29.0;
|
||||
followPoints.push_back(gpsPoint);
|
||||
TelemetryPoint correctedPoint = gpsPoint;
|
||||
correctedPoint.source = LocationSource::ImuCorrected;
|
||||
correctedPoint.latitude = 40.25;
|
||||
correctedPoint.longitude = 29.5;
|
||||
followPoints.push_back(correctedPoint);
|
||||
TelemetryPoint trajectoryPoint = gpsPoint;
|
||||
trajectoryPoint.source = LocationSource::Trajectory;
|
||||
trajectoryPoint.latitude = 41.0;
|
||||
trajectoryPoint.longitude = 30.0;
|
||||
followPoints.push_back(trajectoryPoint);
|
||||
map->setPoints(followPoints);
|
||||
assert(std::abs(map->centerCoordinate().x() - 40.25) < 0.000001);
|
||||
assert(std::abs(map->centerCoordinate().y() - 29.5) < 0.000001);
|
||||
map->clearPoints();
|
||||
|
||||
assert(QMetaObject::invokeMethod(map, "referenceLocationSelected", Qt::DirectConnection,
|
||||
Q_ARG(double, 40.25), Q_ARG(double, 29.5)));
|
||||
assert(referenceLatInput->text() == QStringLiteral("40.250000000000000"));
|
||||
|
||||
Reference in New Issue
Block a user