Optical Flow Sensor Fusion

I successfully integrated MTF-02P optical sensor in my quadcopter using a switch to use both GPS and non-GPS based EKF fusion as described in the document (MTF-02P - Optical&Range Sensor - MicoAir Tech).
But my question is more basic. How do I know when switching between the two options if one or the other is working?
On the Yaapu screen I didn’t get any messages to confirm which sensor is being used (Optical flow or GPS)?
https://drive.google.com/file/d/1dtFKHW1YLFqmX_3QxJU8jusE5hMntyyZ/view?usp=drivesdk

There’s Lua scripts that will do that, but I haven’t been able to get them working with my MTF-01P. The sensor works great and just playing around with it I know it’s working (Note, they don’t work well over fresh snow on a bright sunny day).

If you’re in the Optical Flow/Range finder mode you will get Dead Reckoning warnings if you exceed the limits of the sensor.

It would be nice to have a message on the MP to acknowledge that which EK3 is in use. E.g. “EK3_SRC1 enabled (GPS)” or "EK3_SRC2 enabled (Opt_flow)"
At the moment all I get is relay6 low, medium, and high.

Can this messaging be added in the next build?

Is there an option to have the flight controller dynamically switch EKF sources instead of needing to be manually toggled?

I want to use optical flow whenever possible but use the GPS as well instead of it being a binary thing where it’s one or the other. Is that a thing? Can I do that?

Yes, If you’re running an H7 controller then Lua scripts can do that for you.

Here’s one example.

I commented earlier that I couldn’t get it to work, but that was my fault. I had the wrong script library in Github selected so I was getting script bindings that didn’t work in the version of Copter I was running.

1 Like

Dude that’s freaking awesome!

I’m going to try that right now.