Monitor EKF status - await EKF initialized

Hi,

How do I monitor the state of the EKF? Specifically I want to check if it is done initializing such that we are ready to fly.

When booting the autopilot, the EKF needs some time to be ready to flight. If I try to arm it in this timespan, I get a human readable warning APM: PreArm: EKF2 still initialising. The question is then: How can I know know if the EKF is ready to arm through MAVROS? (or through Mavlink without MAVROS?)

I have tried two topics:
/mavros/estimator_status seems to be empty. No received messages.

/mavros/state has a field called system_status, but that seems to be set to 3 = STANDBY even when I get the error message APM: PreArm: EKF2 still initialising.

I don’t know if it is relevant, but I am trying to do GPS denied navigation, so the EKF initialization I am waiting for is the reinitialization after setting the origin with SET_GPS_GLOBAL_ORIGIN (mavrostopic: /mavros/global_position/set_gp_origin).

Any help would appreciated. :slight_smile:

Hello,

You can look on how we are doing it on the autotest : see here https://github.com/ArduPilot/ardupilot/blob/master/Tools/autotest/common.py#L3126 . I think that we also have test on copter to fly without GPS, so you will have an example !

Hi, thank you for the quick reply!

I see that autotest waits for some of the fields in the ESTIMATOR_STATUS message that mavros does not seem to publish any of ( on /mavros/estimator_status). Do you know if it is sent regularly?