1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

Fixed Lat/Lon scaling in the GetHomeLocation functions.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2832 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
pip 2011-02-21 13:50:31 +00:00 committed by pip
parent 9b10842f5d
commit 5e501f3cae

View File

@ -145,8 +145,8 @@ int UAVObjectUtilManager::getHomeLocation(bool &set, double LLA[3])
set = obj->getField("Set")->getValue().toBool();
LLA[0] = obj->getField("Latitude")->getDouble();
LLA[1] = obj->getField("Longitude")->getDouble();
LLA[0] = obj->getField("Latitude")->getDouble() * 1e-7;
LLA[1] = obj->getField("Longitude")->getDouble() * 1e-7;
LLA[2] = obj->getField("Altitude")->getDouble();
return 0; // OK
@ -176,8 +176,8 @@ int UAVObjectUtilManager::getHomeLocation(bool &set, double LLA[3], double ECEF[
set = obj->getField("Set")->getValue().toBool();
LLA[0] = obj->getField("Latitude")->getDouble();
LLA[1] = obj->getField("Longitude")->getDouble();
LLA[0] = obj->getField("Latitude")->getDouble() * 1e-7;
LLA[1] = obj->getField("Longitude")->getDouble() * 1e-7;
LLA[2] = obj->getField("Altitude")->getDouble();
for (int i = 0; i < 3; i++)
@ -208,8 +208,8 @@ int UAVObjectUtilManager::getGPSPosition(double LLA[3])
UAVDataObject *obj = dynamic_cast<UAVDataObject*>(obm->getObject(QString("GPSPosition")));
if (!obj) return -3;
LLA[0] = obj->getField(QString("Latitude"))->getDouble() * 1E-7;
LLA[1] = obj->getField(QString("Longitude"))->getDouble() * 1E-7;
LLA[0] = obj->getField(QString("Latitude"))->getDouble() * 1e-7;
LLA[1] = obj->getField(QString("Longitude"))->getDouble() * 1e-7;
LLA[2] = obj->getField(QString("Altitude"))->getDouble();
if (LLA[0] != LLA[0]) LLA[0] = 0; // nan detection