From b8450d4a073756da5784193776c9fb6ee9475468 Mon Sep 17 00:00:00 2001 From: Werner Backes Date: Tue, 31 Jul 2012 00:18:10 +0200 Subject: [PATCH 1/3] Fixed World Magnetic Model to accept altitude in meters instead of kilometers --- flight/Libraries/WorldMagModel.c | 2 +- ground/openpilotgcs/src/libs/utils/worldmagmodel.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/flight/Libraries/WorldMagModel.c b/flight/Libraries/WorldMagModel.c index cae0ec106..83f413200 100644 --- a/flight/Libraries/WorldMagModel.c +++ b/flight/Libraries/WorldMagModel.c @@ -242,7 +242,7 @@ int WMM_GetMagVector(float Lat, float Lon, float AltEllipsoid, uint16_t Month, u { CoordGeodetic->lambda = Lon; CoordGeodetic->phi = Lat; - CoordGeodetic->HeightAboveEllipsoid = AltEllipsoid; + CoordGeodetic->HeightAboveEllipsoid = AltEllipsoid/1000.0; // convert to km // Convert from geodeitic to Spherical Equations: 17-18, WMM Technical report if (WMM_GeodeticToSpherical(CoordGeodetic, CoordSpherical) < 0) diff --git a/ground/openpilotgcs/src/libs/utils/worldmagmodel.cpp b/ground/openpilotgcs/src/libs/utils/worldmagmodel.cpp index ce8201ece..207d4b051 100644 --- a/ground/openpilotgcs/src/libs/utils/worldmagmodel.cpp +++ b/ground/openpilotgcs/src/libs/utils/worldmagmodel.cpp @@ -158,7 +158,7 @@ namespace Utils { { double Lat = LLA[0]; double Lon = LLA[1]; - double AltEllipsoid = LLA[2]; + double AltEllipsoid = LLA[2]/1000.0; // convert to km // *********** // range check supplied params From e32152386a7dfd242f39cebf603eb36c361ddd2d Mon Sep 17 00:00:00 2001 From: Werner Backes Date: Tue, 31 Jul 2012 11:10:23 +0200 Subject: [PATCH 2/3] Increased stack for PIOS_SETS_HOMELOCATION case to avoid running into low stack warnings when settings the home location from GPS was actually used. --- flight/Modules/GPS/GPS.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flight/Modules/GPS/GPS.c b/flight/Modules/GPS/GPS.c index 5851ac10d..0428cb629 100644 --- a/flight/Modules/GPS/GPS.c +++ b/flight/Modules/GPS/GPS.c @@ -66,7 +66,7 @@ static float GravityAccel(float latitude, float longitude, float altitude); #ifdef PIOS_GPS_SETS_HOMELOCATION // Unfortunately need a good size stack for the WMM calculation - #define STACK_SIZE_BYTES 750 + #define STACK_SIZE_BYTES 784 #else #if defined(PIOS_GPS_MINIMAL) #define STACK_SIZE_BYTES 500 From 4d257860c8ccd358b9c773f5780f8007121bdd48 Mon Sep 17 00:00:00 2001 From: Ryan Hunter Date: Wed, 18 Jul 2012 17:08:22 -0400 Subject: [PATCH 3/3] Moved the matlab files to matlab folder for GCS plugin --- .../plugins/gcscontrol/Matlab => matlab/GCSPlugin}/GCSControl.m | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {ground/openpilotgcs/src/plugins/gcscontrol/Matlab => matlab/GCSPlugin}/GCSControl.m (100%) diff --git a/ground/openpilotgcs/src/plugins/gcscontrol/Matlab/GCSControl.m b/matlab/GCSPlugin/GCSControl.m similarity index 100% rename from ground/openpilotgcs/src/plugins/gcscontrol/Matlab/GCSControl.m rename to matlab/GCSPlugin/GCSControl.m