Browse Source

AP_NavEKF2: Publish the primary EKF index

master
Paul Riseborough 9 years ago committed by Andrew Tridgell
parent
commit
b24507d33c
  1. 12
      libraries/AP_NavEKF2/AP_NavEKF2.cpp
  2. 4
      libraries/AP_NavEKF2/AP_NavEKF2.h

12
libraries/AP_NavEKF2/AP_NavEKF2.cpp

@ -517,6 +517,18 @@ bool NavEKF2::healthy(void) const @@ -517,6 +517,18 @@ bool NavEKF2::healthy(void) const
return core[primary].healthy();
}
// returns the index of the primary core
// return false if no primary core selected
bool NavEKF2::getPrimaryCoreIndex(uint8_t index) const
{
if (!core) {
return false;
}
index = primary;
return true;
}
// Return the last calculated NED position relative to the reference point (m).
// If a calculated solution is not available, use the best available data and return false
// If false returned, do not use for flight control

4
libraries/AP_NavEKF2/AP_NavEKF2.h

@ -57,6 +57,10 @@ public: @@ -57,6 +57,10 @@ public:
// Check basic filter health metrics and return a consolidated health status
bool healthy(void) const;
// returns the index of the primary core
// return false if no primary core selected
bool getPrimaryCoreIndex(uint8_t index) const;
// Return the last calculated NED position relative to the reference point (m).
// If a calculated solution is not available, use the best available data and return false
// If false returned, do not use for flight control

Loading…
Cancel
Save