1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-11-30 08:24:11 +01:00

Forgot to include altitude nan value prevention.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1985 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
pip 2010-10-17 20:24:23 +00:00 committed by pip
parent e9c0b9455f
commit e0f399e333

View File

@ -2282,7 +2282,10 @@ bool OPMapGadgetWidget::getUAV_LLA(double &latitude, double &longitude, double &
altitude = LLA[2];
if (latitude != latitude) latitude = 0; // nan detection
// if (isNan(latitude)) latitude = 0; // nan detection
else
// if (!isFinite(latitude)) latitude = 0;
// else
if (latitude > 90) latitude = 90;
else
if (latitude < -90) latitude = -90;
@ -2297,6 +2300,8 @@ bool OPMapGadgetWidget::getUAV_LLA(double &latitude, double &longitude, double &
else
if (longitude < -180) longitude = -180;
if (altitude != altitude) altitude = 0; // nan detection
return true;
}