LPE with Optic flow won't go into Position control during flight

I’m trying to get a copter flying with Optic flow only (LPE_GPS_ON is set to 0) in position control mode. Yesterday was working fine, this morning I upgraded QGC, let QGC upgrade my PX4 firmware (see that problem in previous post I made), and now things aren’t working so great.

When I hold the copter in my hand (disarmed) high enough above the ground that the flow quality threshold is happy, I can put the copter in position control mode with no problem.

Then I put it down on the ground (quality goes below threshold), arm and take it off, flip it into altitude control mode (good so far). After this, if I try to put it into position control mode, it gives me the good ole’ “position control rejected” verbal feedback. Looking at my QGC live log, I can see that the quality is above the “happy threshold” when it’s in the air, and it should be able to switch (as it did yesterday)

Here’s a log munch. Any clues? Has anything changed in the new firmware that could cause this?

One more thing: I recall that before the FW upgrade, going into the “Analyze” tab in QGC would have some parameters to watch the flow output – and they don’t seem to be there anymore.

That ‘Reject’ voice haunts me… I don’t have an answer for you, other than I don’t get that reject when going to Pos Control with GPS off, with the Optical Flow camera on. However, the drone doesn’t seem to use the data as it drifts all over the place… but that is a new topic I am starting.

In the log you posted the flow quality is always 0, so it wouldn’t be fused into local position. Are you sure you were seeing good quality in QGC analyze for this flight?

Did you fixed this problem? I have exact same issue

I for sure had this working on 1.4.2, but that was quite some time ago. Have you tried using a different estimator?

IIRC, typically the issue is that the state estimator is not publishing the vehicle_local_position_ned message, which has to appear regularly and with the xy_valid flag set to true, otherwise the commander will reject position control.

Furthermore, I think the mavlink message which corresponds to this topic, named LOCAL_POSITION_NED, is only published if the xy_valid flag is set to true. You could try and monitor the mavlink for these messages.

I think its worth trying this with EKF2 - that was the estimator that I used last. You will have to change the EKF2_AID_MASK parameter accordingly to enable optical flow fusion and disable GPS.

This is a very common problem that people have… I myself struggled with it for a week or two last year. Unfortunately, the docs on control modes doesn’t help with debugging this issue. I had to dive into the code for the commander, estimators, and mavlink module to work it out for myself.