Browse Source

AP_NavEKF2: move global state to be on the stack

zr-v5.1
Peter Barker 4 years ago committed by Peter Barker
parent
commit
400ba7a9df
  1. 2
      libraries/AP_NavEKF2/AP_NavEKF2_Measurements.cpp
  2. 1
      libraries/AP_NavEKF2/AP_NavEKF2_core.cpp
  3. 1
      libraries/AP_NavEKF2/AP_NavEKF2_core.h

2
libraries/AP_NavEKF2/AP_NavEKF2_Measurements.cpp

@ -504,7 +504,7 @@ void NavEKF2_core::readGpsData() @@ -504,7 +504,7 @@ void NavEKF2_core::readGpsData()
gpsCheckStatus.bad_fix = false;
// store fix time from previous read
secondLastGpsTime_ms = lastTimeGpsReceived_ms;
const uint32_t secondLastGpsTime_ms = lastTimeGpsReceived_ms;
// get current fix time
lastTimeGpsReceived_ms = gps.last_message_time_ms(gps.primary_sensor());

1
libraries/AP_NavEKF2/AP_NavEKF2_core.cpp

@ -133,7 +133,6 @@ void NavEKF2_core::InitialiseVariables() @@ -133,7 +133,6 @@ void NavEKF2_core::InitialiseVariables()
lastTasPassTime_ms = 0;
lastYawTime_ms = imuSampleTime_ms;
lastTimeGpsReceived_ms = 0;
secondLastGpsTime_ms = 0;
lastDecayTime_ms = imuSampleTime_ms;
timeAtLastAuxEKF_ms = imuSampleTime_ms;
flowValidMeaTime_ms = imuSampleTime_ms;

1
libraries/AP_NavEKF2/AP_NavEKF2_core.h

@ -872,7 +872,6 @@ private: @@ -872,7 +872,6 @@ private:
uint32_t lastTasPassTime_ms; // time stamp when airspeed measurement last passed innovation consistency check (msec)
uint32_t lastTimeGpsReceived_ms;// last time we received GPS data
uint32_t timeAtLastAuxEKF_ms; // last time the auxiliary filter was run to fuse range or optical flow measurements
uint32_t secondLastGpsTime_ms; // time of second last GPS fix used to determine how long since last update
uint32_t lastHealthyMagTime_ms; // time the magnetometer was last declared healthy
bool allMagSensorsFailed; // true if all magnetometer sensors have timed out on this flight and we are no longer using magnetometer data
uint32_t lastYawTime_ms; // time stamp when yaw observation was last fused (msec)

Loading…
Cancel
Save