Browse Source

AP_NavEKF: allow initialisation before GPS lock to aid indoor testing

mission-4.1.18
Paul Riseborough 11 years ago committed by Andrew Tridgell
parent
commit
b4171853b1
  1. 4
      libraries/AP_AHRS/AP_AHRS_NavEKF.cpp
  2. 16
      libraries/AP_NavEKF/AP_NavEKF.cpp

4
libraries/AP_AHRS/AP_AHRS_NavEKF.cpp

@ -52,8 +52,8 @@ void AP_AHRS_NavEKF::update(void) @@ -52,8 +52,8 @@ void AP_AHRS_NavEKF::update(void)
_dcm_attitude(roll, pitch, yaw);
if (!ekf_started) {
// if we have GPS lock and a compass set we can start the EKF
if (get_compass() && _gps && _gps->status() >= GPS::GPS_OK_FIX_3D) {
// if we have a compass set we can start the EKF
if (get_compass()) {
if (start_time_ms == 0) {
start_time_ms = hal.scheduler->millis();
}

16
libraries/AP_NavEKF/AP_NavEKF.cpp

@ -383,9 +383,9 @@ void NavEKF::UpdateFilter() @@ -383,9 +383,9 @@ void NavEKF::UpdateFilter()
void NavEKF::SelectVelPosFusion()
{
// Command fusion of GPS measurements if new ones available
// Command fusion of GPS measurements if new ones available or in static mode
readGpsData();
if (newDataGps) {
if (newDataGps||staticMode) {
fuseVelData = true;
fusePosData = true;
// Calculate the scale factor to be applied to the measurement variance to account for
@ -398,9 +398,9 @@ void NavEKF::SelectVelPosFusion() @@ -398,9 +398,9 @@ void NavEKF::SelectVelPosFusion()
fuseVelData = false;
fusePosData = false;
}
// Command fusion of height measurements if new ones available
// Command fusion of height measurements if new ones available or in static mode
readHgtData();
if (newDataHgt)
if (newDataHgt||staticMode)
{
fuseHgtData = true;
// Calculate the scale factor to be applied to the measurement variance to account for
@ -1337,6 +1337,10 @@ void NavEKF::FuseVelPosNED() @@ -1337,6 +1337,10 @@ void NavEKF::FuseVelPosNED()
{
posHealth = true;
posFailTime = hal.scheduler->millis();
if (posTimeout)
{
ResetPosition();
}
}
else
{
@ -1360,6 +1364,10 @@ void NavEKF::FuseVelPosNED() @@ -1360,6 +1364,10 @@ void NavEKF::FuseVelPosNED()
{
hgtHealth = true;
hgtFailTime = hal.scheduler->millis();
if (hgtTimeout)
{
ResetPosition();
}
}
else
{

Loading…
Cancel
Save