mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-29 14:52:12 +01:00
Added some pieces that had been lost during rebase
This commit is contained in:
parent
5776981436
commit
d0b7dc0012
@ -35,8 +35,6 @@
|
||||
|
||||
//#include <stdbool.h>
|
||||
|
||||
#include "NMEA.h"
|
||||
|
||||
#include "gpsposition.h"
|
||||
#include "homelocation.h"
|
||||
#include "gpstime.h"
|
||||
@ -47,6 +45,9 @@
|
||||
#include "CoordinateConversions.h"
|
||||
#include "hwsettings.h"
|
||||
|
||||
#include "NMEA.h"
|
||||
#include "UBX.h"
|
||||
|
||||
|
||||
// ****************
|
||||
// Private functions
|
||||
@ -140,6 +141,17 @@ int32_t GPSInitialize(void)
|
||||
gpsEnabled = false;
|
||||
#endif
|
||||
|
||||
#if defined(REVOLUTION)
|
||||
// Revolution expects these objects to always be defined. Not doing so will fail some
|
||||
// queue connections in navigation
|
||||
GPSPositionInitialize();
|
||||
GPSVelocityInitialize();
|
||||
GPSTimeInitialize();
|
||||
GPSSatellitesInitialize();
|
||||
HomeLocationInitialize();
|
||||
updateSettings();
|
||||
|
||||
#else
|
||||
if (gpsPort && gpsEnabled) {
|
||||
GPSPositionInitialize();
|
||||
GPSVelocityInitialize();
|
||||
@ -151,6 +163,8 @@ int32_t GPSInitialize(void)
|
||||
HomeLocationInitialize();
|
||||
#endif
|
||||
updateSettings();
|
||||
}
|
||||
#endif
|
||||
|
||||
if (gpsPort && gpsEnabled) {
|
||||
GPSSettingsInitialize();
|
||||
@ -295,14 +309,6 @@ static void setHomeLocation(GPSPositionData * gpsData)
|
||||
|
||||
// Compute home ECEF coordinates and the rotation matrix into NED
|
||||
double LLA[3] = { ((double)home.Latitude) / 10e6, ((double)home.Longitude) / 10e6, ((double)home.Altitude) };
|
||||
double ECEF[3];
|
||||
RneFromLLA(LLA, (float (*)[3])home.RNE);
|
||||
LLA2ECEF(LLA, ECEF);
|
||||
// TODO: Currently UAVTalk only supports float but these conversions use double
|
||||
// need to find out if they require that precision and if so extend UAVTAlk
|
||||
home.ECEF[0] = (int32_t) (ECEF[0] * 100);
|
||||
home.ECEF[1] = (int32_t) (ECEF[1] * 100);
|
||||
home.ECEF[2] = (int32_t) (ECEF[2] * 100);
|
||||
|
||||
// Compute magnetic flux direction at home location
|
||||
if (WMM_GetMagVector(LLA[0], LLA[1], LLA[2], gps.Month, gps.Day, gps.Year, &home.Be[0]) >= 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user