Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Flow aiding - Reset state when flow is enabled only if it is the only position/velocity aiding sensor #637

Merged
merged 1 commit into from
Sep 3, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions EKF/control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,20 +465,19 @@ void Ekf::controlOpticalFlowFusion()
_control_status.flags.opt_flow = true;
_time_last_of_fuse = _time_last_imu;

// if we are not using GPS then the velocity and position states and covariances need to be set
if (!_control_status.flags.gps || !_control_status.flags.ev_pos) {
// if we are not using GPS or external vision aiding, then the velocity and position states and covariances need to be set
const bool flow_aid_only = !(_control_status.flags.gps || _control_status.flags.ev_pos);
if (flow_aid_only) {
resetVelocity();
resetPosition();

// align the output observer to the EKF states
alignOutputFilter();

}
}

} else if (!(_params.fusion_mode & MASK_USE_OF)) {
_control_status.flags.opt_flow = false;

}

// handle the case when we have optical flow, are reliant on it, but have not been using it for an extended period
Expand Down