Skip to content

Rover/AHRS: poor GPS may lead to fallback to DCM regardless of AHRS_OPTIONS #33388

@rmackay9

Description

@rmackay9

Bug Report

In Rover (at least) with a poor GPS signal, EK3_SRC_VELZ/POSZ = 3(GPS) and AHRS_OPTIONS = 3 (DisableDCMFallbackFW + DisableDCMFallbackVTOL) the AHRS may still fall back to DCM.

This was reported in this 4.7 beta testing thread.

"DCM Active" can be seen in both the video and the logs provided in the above linked report. Please also note that the AHRS appears to be switching back and forth between DCM and EKF.

The issue appears to be this line in the AHRS code that falls back to DCM if the vertical velocity and position are not available. We should change this so that for ground vehicles, "can_use_ekf" is true even if only the EKF's attitude is available.

        const bool can_use_dcm = dcm.yaw_source_available() || fly_forward;
        const bool can_use_ekf = filt_state.flags.attitude && filt_state.flags.vert_vel && filt_state.flags.vert_pos;
        if (!can_use_dcm && can_use_ekf) {
            // no choice - continue to use EKF
            return ret;
        } else if (!can_use_ekf) {
            // No choice - we have to use DCM
            return EKFType::DCM;
        }

Issue details

Please describe the problem

Version
4.8-dev but probably also present in 4.7

Platform
[ ] All
[ ] AntennaTracker
[ ] Copter
[ ] Plane
[x] Rover
[ ] Submarine

Airframe type
Rover

Logs
Logs are available in the thread linked above

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions