PX4FLOW seems to be the best available optical flow sensor on the market. It has an optical flow sensor and a Maxbotix MB1043 HRLV-MaxSonar-EZ4 directly attached.
Implementation suggestions:
It has an easy I2C interface, you can get with single I2C-call optical flow and sonar readings. Implement Optical Flow sensor driver and write rangefinder reading in atomic variable. In the Rangefinder driver read this variable and return. Use QGroundControl software to see optical flow image/video and make camera picture sharp.
PX4FLOW informations
Firmware for PX4FLOW
PX4FLOW Optical Flow code
PX4FLOW Rangefinder code

Issue-Label Bot is automatically applying the label Feature request to this issue, with a confidence of 0.97. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!
Links: app homepage, dashboard and code for this bot.
Most helpful comment
Issue-Label Bot is automatically applying the label
Feature requestto this issue, with a confidence of 0.97. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!Links: app homepage, dashboard and code for this bot.