Some questions about the optical flow usage in AP

Hi guys,

I have been playing with optical flow sensors these days and trying to integrate them into the current version of Copter 4.4.2. The optical flow sensor that I use is based on OpenMV Mavlink optical flow example code. OpenMV for Optical Flow — Copter documentation

I did conducted some tests with the optical flow at 100m with interesting results that I would like to share. However, by answering the questions below, I will be more confident that the result does make sense to anybody before they try to implement by themselves.

Short video showing the drone can hover with non-GPS condition https://photos.app.goo.gl/MYqRoCWYFAYsJ8PSA

Here are what I found and I need your support to answer some questions:

  1. There are some inconsistencies between the unit and what it actually is described in the code:
    Line #85

the bodyReate is commented as m/s - translational velocity
However, it was rad/s in line #97

In the line #36, the body seems to be rad/s because it captures the IMU gyro

Question #1: What is the unit of the “body rate”?

  1. As we are trying to match the body rate flow rate, so I assume they should be the same unit. In the line #65, the body rate is multiplied by dt:

Question #2: What the flow rate actually is: rad or rad/s

I hope @rmackay9 can have some time to take a look. Highly appreciated.