Fix missing bank and pitch interpolation

The multiplikation with -1 should not be required. Needs
to be checked. This is a workaround for the time being to
correct pitch/bank.
This commit is contained in:
Roland Winklmeier
2014-05-25 14:47:33 +02:00
committed by Klaus Basan
parent 12dedcbc6c
commit 83be80eea1

View File

@@ -98,6 +98,28 @@ namespace BlackCore
+ headingBegin,
headingBegin.getReferenceNorth()));
// Interpolate Pitch: Pitch = (PitchB - PitchA) * t + PitchA
CAngle pitchBegin = beginSituation.getPitch();
CAngle pitchEnd = endSituation.getPitch();
CAngle pitch = (pitchEnd - pitchBegin) * simulationTime + pitchBegin;
// TODO: According to the specification, pitch above horizon should be negative.
// But somehow we get positive pitches from the network.
pitch *= -1;
currentSituation.setPitch(pitch);
// Interpolate bank: Bank = (BankB - BankA) * t + BankA
CAngle bankBegin = beginSituation.getBank();
CAngle bankEnd = endSituation.getBank();
CAngle bank = (bankEnd - bankBegin) * simulationTime + bankBegin;
// TODO: According to the specification, banks to the right should be negative.
// But somehow we get positive banks from the network.
bank *= -1;
currentSituation.setBank(bank);
currentSituation.setGroundspeed((endSituation.getGroundSpeed() - beginSituation.getGroundSpeed())
* simulationTime
+ beginSituation.getGroundSpeed());