Commit 4d7e63a8 authored by Don Gagne's avatar Don Gagne

Landing heading is from loiter to land

Not the other way around
parent 63b29b1c
......@@ -230,7 +230,7 @@ void FixedWingLandingComplexItem::_recalcLoiterCoordFromFacts(void)
QPointF originPoint(east, north);
north += _loiterToLandDistanceFact.rawValue().toDouble();
QPointF loiterPoint(east, north);
QPointF rotatedLoiterPoint = _rotatePoint(loiterPoint, originPoint, -_landingHeadingFact.rawValue().toDouble());
QPointF rotatedLoiterPoint = _rotatePoint(loiterPoint, originPoint, _landingHeadingFact.rawValue().toDouble());
convertNedToGeo(rotatedLoiterPoint.y(), rotatedLoiterPoint.x(), down, tangentOrigin, &_loiterCoordinate);
......@@ -273,7 +273,7 @@ void FixedWingLandingComplexItem::_recalcFactsFromCoords(void)
// Calc new heading
QPointF vector(eastLoiter - eastLand, northLoiter - northLand);
QPointF vector(eastLand - eastLoiter, northLand - northLoiter);
double radians = atan2(vector.y(), vector.x());
double degrees = qRadiansToDegrees(radians);
// Change angle to north up = 0 degrees
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment