mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-22 07:44:03 -04:00
AP_NavEKF3: Add public accessor for state variances
This commit is contained in:
parent
9f97cbfc3b
commit
2b97d0f5c9
@ -1087,6 +1087,15 @@ void NavEKF3::getVariances(int8_t instance, float &velVar, float &posVar, float
|
||||
}
|
||||
}
|
||||
|
||||
// return the diagonals from the covariance matrix for the specified instance
|
||||
void NavEKF3::getStateVariances(int8_t instance, float stateVar[24])
|
||||
{
|
||||
if (instance < 0 || instance >= num_cores) instance = primary;
|
||||
if (core) {
|
||||
core[instance].getStateVariances(stateVar);
|
||||
}
|
||||
}
|
||||
|
||||
// should we use the compass? This is public so it can be used for
|
||||
// reporting via ahrs.use_compass()
|
||||
bool NavEKF3::use_compass(void) const
|
||||
|
@ -183,6 +183,9 @@ public:
|
||||
// An out of range instance (eg -1) returns data for the the primary instance
|
||||
void getVariances(int8_t instance, float &velVar, float &posVar, float &hgtVar, Vector3f &magVar, float &tasVar, Vector2f &offset);
|
||||
|
||||
// return the diagonals from the covariance matrix for the specified instance
|
||||
void getStateVariances(int8_t instance, float stateVar[24]);
|
||||
|
||||
// should we use the compass? This is public so it can be used for
|
||||
// reporting via ahrs.use_compass()
|
||||
bool use_compass(void) const;
|
||||
|
@ -451,6 +451,13 @@ void NavEKF3_core::getVariances(float &velVar, float &posVar, float &hgtVar, Ve
|
||||
offset = posResetNE;
|
||||
}
|
||||
|
||||
// return the diagonals from the covariance matrix
|
||||
void NavEKF3_core::getStateVariances(float stateVar[24])
|
||||
{
|
||||
for (uint8_t i=0; i<24; i++) {
|
||||
stateVar[i] = P[i][i];
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
return the filter fault status as a bitmasked integer
|
||||
|
@ -189,6 +189,9 @@ public:
|
||||
// return the innovation consistency test ratios for the velocity, position, magnetometer and true airspeed measurements
|
||||
void getVariances(float &velVar, float &posVar, float &hgtVar, Vector3f &magVar, float &tasVar, Vector2f &offset) const;
|
||||
|
||||
// return the diagonals from the covariance matrix
|
||||
void getStateVariances(float stateVar[24]);
|
||||
|
||||
// should we use the compass? This is public so it can be used for
|
||||
// reporting via ahrs.use_compass()
|
||||
bool use_compass(void) const;
|
||||
|
Loading…
Reference in New Issue
Block a user