ekf2: optical flow don't compute innovation variance twice

- collapse updateOptFlow() and startFlowFusion() to avoid recomputing H
 - this is a relatively expensive call we can easily avoid with the
   right structure
This commit is contained in:
Daniel Agar
2024-07-09 10:10:01 -04:00
parent f709ed409d
commit 8bf15b01c4
3 changed files with 64 additions and 92 deletions
+1 -3
View File
@@ -833,7 +833,6 @@ private:
#if defined(CONFIG_EKF2_OPTICAL_FLOW)
// control fusion of optical flow observations
void controlOpticalFlowFusion(const imuSample &imu_delayed);
void startFlowFusion();
void resetFlowFusion();
void stopFlowFusion();
@@ -850,8 +849,7 @@ private:
Vector2f predictFlow(const Vector3f &flow_gyro) const;
// fuse optical flow line of sight rate measurements
void updateOptFlow(estimator_aid_source2d_s &aid_src, const flowSample &flow_sample);
bool fuseOptFlow(bool update_terrain);
bool fuseOptFlow(VectorState &H, bool update_terrain);
#endif // CONFIG_EKF2_OPTICAL_FLOW