mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-02 10:24:11 +01:00
fixed bugs in GPS, corrected zeroing of updated flags in stateestimation
This commit is contained in:
parent
87b1b4873c
commit
6c25e82633
@ -72,7 +72,7 @@ static void setPositionSensor(GPSPositionSensorData *gpsData);
|
|||||||
|
|
||||||
#ifdef PIOS_GPS_SETS_HOMELOCATION
|
#ifdef PIOS_GPS_SETS_HOMELOCATION
|
||||||
// Unfortunately need a good size stack for the WMM calculation
|
// Unfortunately need a good size stack for the WMM calculation
|
||||||
#define STACK_SIZE_BYTES 850
|
#define STACK_SIZE_BYTES 1024
|
||||||
#else
|
#else
|
||||||
#if defined(PIOS_GPS_MINIMAL)
|
#if defined(PIOS_GPS_MINIMAL)
|
||||||
#define STACK_SIZE_BYTES 500
|
#define STACK_SIZE_BYTES 500
|
||||||
@ -349,11 +349,11 @@ static void setPositionSensor(GPSPositionSensorData *gpsData)
|
|||||||
float ECEF[3];
|
float ECEF[3];
|
||||||
float Rne[3][3];
|
float Rne[3][3];
|
||||||
{
|
{
|
||||||
float LLA[3] = { home.Latitude, home.Longitude, home.Altitude };
|
float LLA[3] = { (home.Latitude) / 10e6f, (home.Longitude) / 10e6f, (home.Altitude) };
|
||||||
LLA2ECEF(LLA, ECEF);
|
LLA2ECEF(LLA, ECEF);
|
||||||
RneFromLLA(LLA, Rne);
|
RneFromLLA(LLA, Rne);
|
||||||
}
|
}
|
||||||
{ float LLA[3] = { gpsData->Latitude, gpsData->Longitude, gpsData->Altitude + gpsData->GeoidSeparation };
|
{ float LLA[3] = { (gpsData->Latitude) / 10e6f, (gpsData->Longitude) / 10e6f, gpsData->Altitude + gpsData->GeoidSeparation };
|
||||||
float NED[3];
|
float NED[3];
|
||||||
LLA2Base(LLA, ECEF, Rne, NED);
|
LLA2Base(LLA, ECEF, Rne, NED);
|
||||||
pos.North = NED[0];
|
pos.North = NED[0];
|
||||||
|
@ -377,8 +377,8 @@ static void StateEstimationCb(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// read updated sensor UAVObjects and set initial state
|
// read updated sensor UAVObjects and set initial state
|
||||||
states.updated = updatedSensors;
|
states.updated = updatedSensors;
|
||||||
updatedSensors ^= states.updated;
|
updatedSensors = 0;
|
||||||
|
|
||||||
// fetch sensors, check values, and load into state struct
|
// fetch sensors, check values, and load into state struct
|
||||||
FETCH_SENSOR_FROM_UAVOBJECT_CHECK_AND_LOAD_TO_STATE_3_DIMENSIONS(GyroSensor, gyro, x, y, z);
|
FETCH_SENSOR_FROM_UAVOBJECT_CHECK_AND_LOAD_TO_STATE_3_DIMENSIONS(GyroSensor, gyro, x, y, z);
|
||||||
|
Loading…
Reference in New Issue
Block a user