I’ve been trying to set up a OpenMV cam m7 to use as optical flow. (It’s got this code on it Github-mavlink_opticalflow )
It’s connected to a mro-Rixracer running Arducopter 3.5.5 on serial 1 using mavlink.
As distance sensor there is a bennewake tf-mini on serial 2. (This is working great in alt-hold flight!)
I want to look at “OF.flowX” and “OF.bodyX” as described in this link.
But this was written a while ago and i think some things changed in 3.5 because i can’t find those values in the logfile.
I can’t see these using missionplanner, in Q i see the messages the clearest. Youtube - Qgroundcontol In the OpenMV i can control the messages time_usec, flow_comp_m_y, and the entire list of optical_flow messages. And see them in Q-groundcontrol, but i can never see any value in missionplanner.
It’s not logging the right messages or the names have changed (i’ve tried the log bitmask on 131071 and 655358).
Can someone point out how or where i can see these messages and plot them against each other?
Looks like I’m on the wrong track here.
I thought the important part of the calculation (combining the gyro, distance sensor & basic camera vectors into an velocity-error ) was done in arducopter.
I’m staring to think I’m wrong. And this setup won’t work unless i start modifying both the arducopter and the openMV code a lot.
(Or do something completely different in a companion computer.)
I still find it strange that the data i can see in the mavlink inspector on Qgroundcontrol, is not visible in missionplanner or APM2.0.
In order get the OpenMV opticalflow work correctly with Ardupilot you would need to developp a new driver for it.
There is no ‘‘generic’’ mavlink method to get the velocity vectors being consumed at the present stage, and as the EKF has been originally designed for the PX4FLOW , you need to provide flowrate and bodyrate vectors to the estimator. If you look at the existing driver, its possible to use the FC bodyrate state vectors and provide a method to synchronise with the flowrate.
The last unknown, and maybe the biggest issue, is the difference between the KLT algorithm of the Px4FLOW and the Enhanced Optical Flow by kwagyeman
So this is why I use a 55$ STM32F7 based camera system called PX4FLOW as an opticalflow and a 55$ STM32F7 based camera system called OpenMV as an Object Tracking