High Altitude Optical Flow -- Testers needed!

Holybro X6 pixhawk.

Thanks!

Hi @Tangoviktor,

Thanks for helping out. Here’s a copter-4.7.0-dev binary for the Pixhawk6x with the high altitude optical flow feature added.

Hi @bcom,

Thanks for testing. One issue appears to be that the altitude above terrain is off by about 15m.

Here is a screenshot from the logs of the baro based altitude (in green) and then the alt-above-terrain in blue.

I wonder if you’re seeing a “Clamping” message after arming? If “yes” this is caused by the EKF’s initial altitude estimate being quite far off from the SRTM data’s expected altitude. This could happen if you’re taking off from a roof or if the GPS’s initial altitude is quite bad (e.g the vehicle was powered on indoors and then taken outside). One solution to this is to increase the TERRAIN_OFS_MAX parameter value to something very large like 100m.

By the way, any chance that you could enable the rangefinder? This will give us a better idea of how accurate the terrain altitude is. Also if you could set these two other parameters as well it would help with analysis:

  • LOG_DISARMED = 1
  • LOG_REPLAY = 1

Feel free to return these both to 0 after you’re done test. thanks again!

I did test flights and… seems to be working fine. However… pro tip: using OF over high grass beeing moved by the wind is not best idea. Skipping the moments when drone went crazy because “terrain” was moving it all seems to be fine. Will upload logs later.

Damn… I will have to probably repeat this test flight. Probably due to “terrain” lidar got a bit crazy…

Still was able to stay in loiter mode and not do some stupid things tho. (max range set to 6m)

Hi @rmackay9
Okay, I’m planning to conduct the test next week. Wait for my update.

@rmackay9 should the post title change to something like “Altitude test beyond rangefinder with optical flow - Testers needed!”?
SF30/D can do up to 200m measurement, GRF-500 can do up to 500m, for example.

Hi @Jai.GAY,

Oh, I think the title is fine.

.. but re optical flow working at very high altitudes, there are two parts to it I think. The long distance rangefinder (or the ability to use SRTM) is one part but the other part is using a stabilised optical flow sensor. This branch does support both of these although we don’t know yet to what altitude it will work. We know it’s beyond 100m but I suspect it’s no higher than 200m.

But if users use an Optical Motion Tracking sensor base optical flow module like PMW3901MB which has a working range of 80 mm up to infinity, shouldn’t height verification is not about optical flow sensor ability but beyond rangefinder limit into EKF?

Hi @Jai.GAY,

I think the manufacturer is referring to the distances that the lens can focus on. Besides this there is some distance beyond which it will not be able to sense movement due to the size of the camera’s pixels.

Also if the optical flow sensor is hard mounted to the vehicle’s frame then the we need to subtract the rotation rate the optical flow sensor is experiencing and that is quite difficult to get perfectly correct - there’s always some timing inaccuracies and noise in the rotation rates that reduce the overall accuracy.

Hi @rmackay9

If testers are still needed, will be happy to test the code.
I have Matek H743-SLIM V3 and Ark Flow optical flow sensor.

So, will a gimbal mount optical flow sensor produce a better holding results?

Hi @Jai.GAY,

Yes, I think so. the video at the top of this page shows the result of my tests with a gimbal mounted camera and I think it’s much better than what could be achieved with a hard mounted optical flow sensor.

-Randy

If it can produce better holding results, assuming a perfect gimbal system, does it mean the in-flight flow calibration becomes redundant compared to flow sensor hard-mounting to the UA frame?

Hi @Jai.GAY,

Yes, that’s right. The in-flight flow calibration won’t work with a stabilised optical flow sensor. I gave a longer explanation somewhere of why this is the case and how we could instead manually calibrate it but I can’t immediately find where I posted that comment. I’ll have to add that to the wiki when we release 4.7. Txs!

I use Pixhawk 6X Pro
H-Flow (Optical Flow and Distance Sensor Module)
Position control not good

Damn, I forgot logs.

So… io seems that OF out of lidar range keeps position for a while, and then starts doing some rapid moves.
Ifter that happened I switched back to GPS and did not further test.

Sorry for the file size, was testing also notch filtering :slight_smile:

Hi @rmackay9 !
It’s interesting to test this feature.
I’m using Cube Orange Plus(BDshot) and Ark Flow

Hi @Alex_Maliy, @Dronatic @Kinne,

Thanks very much! This feature is now in “latest” (aka “master”, aka “Copter-4.7.0-dev” so you can test it by using MP’s firmware install screen and then press Ctrl-Q and hopefully you’ll see the version written under the Copter icon change to “4.7.0-DEV”.