1)We followed the wiki, the sensor was connected via I2C http://ardupilot.org/copter/docs/common-px4flow-overview.html
2)We focused the lens on
3)We have enabled the sensor from the planner
4)We looked at the “status” screen and looked at the values "opt_m_x opt_m_y"
5)Sometimes we can see some numbers, sometimes not, we only see 0.
6)We tried to fly with pre arm check disabled, but it seems that the optical flow was not functioning.
7)We looked again at “opt_m_x opt_m_y” but everything was 0.
Can anyone help us in make the optical flow work correctly?
Technically doable, but make sure you’re actually using it! You will need to solder wires from the sonar itself to a plug and connect it to the ADC manually.
Really recommend a lidar lite though, I tried using the sonar myself, but the occasional measurement errors and weird startup behavior got on my nerves!
Consider that you have to install 2 devices:
A) RangeFinder : (Preferably a laser based unit on serial or I2C) - configured in Initial Setup and outputting distance (Sonar Range)
B) OpticalFlow : Firmware upgraded - Connected using I2C - Configured in Initial Steup and outputting x - y opflow signal and calibrate it with the IMU as demonstrated in the wiki.
I personally fly it indoor (no GPS) using a Garmin Lidar Lite Range finder with no problem.
Here is a demonstration of my Q450 doing Red Ball Tracking , using an OpenMV as a color blob detector controlling the precision landing library and you can see the optical flow operate as the velocity controler, making the quadcopter holding its position quite accurately in Loiter mode.
Please note the texture on the rug that is essential to get a good optical flow detection, and you need to adjust the focus for the typical mission (mine was adjusted to 1-3 meter to fly in my garage).