Optical flow

NOTE: Right now is not working properly in Erle-Brain 3/PXFmini.

PX4Flow is an optical flow smart camera (it provides the image for setup purposes, but it not designed to capture images like a webcam). It has a native resolution of 752×480 pixels and calculates optical flow on a 4x binned and cropped area at 400 Hz, giving it a very high light sensitivity. Unlike many mouse sensors, it also works indoors and in low outdoor light conditions without the need for an illumination LED. It can be freely reprogrammed to do any other basic, efficient low-level computer vision task.

  • 168 MHz Cortex M4F CPU (128 + 64 KB RAM)
  • 752×480 MT9V034 image sensor, L3GD20 3D Gyro
  • 16 mm M12 lens (IR block filter)
  • Size 45.5 mm x 35mm
  • Power consumption 115mA / 5V

  • MT9V034 machine vision CMOS sensor with global shutter
  • Optical flow processing at 4×4 binned image at 400 Hz
  • Superior light sensitivity with 24×24 μm super-pixels
  • Onboard 16bit gyroscope up to 2000°/s and 780 Hz update rate, default high precision-mode at 500°/s
  • Onboard sonar input and mount for Maxbotix sonar sensors. (HRLV-EZ4 recommended, SparkFun Product Link)
  • USB bootloader
  • USB serial up to 921600 baud (including live camera view with QGroundControl)
  • USB power option
  • Does fit the MatrixVision Bluefox MV
  • mounting holes (camera center off-centered)

The default orientation (meaning: zero rotation) is defined as Y on flow board pointing towards front of vehicle as shown in the following picture. The FLOW_ORIENT_YAW parameter can be used to account for other yaw orientations. It is important that the flow sensor be mounted where it does not experience angular vibration that could blur the image.

Use one of the I2C bus connection exposed in Erle-Brain (v1.x or v2) to attach the optical flow:

To be sure that the device is working properly, check that optical flow's I2C address appears in the bus. In order to do so, execute:

sudo i2cdetect -r 1

You should see the address 0x42printed out:

The sensor can be enabled by connecting with the APM Planner and then on the Initial Setup > Optional Setup > Optical Flow page check the Enable checkbox. The sensor will be initialised once Erle-Brain 2 is rebooted.

Alternatively the FLOW_ENABLE parameter should be set to “1” through the full parameters list.

  • Perform a short test flight hovering in stabilise at small tilt angles at heights ranging from 50cm to 3m with EKF_GPS_TYPE = 0 (we don’t want the optical flow being used by the EKF at this stage)
  • Download the flash log and plot the following in mission planner
  • EKF5.meaRng should correlate with the change in vehicle height
  • OF.flowX and OF.flowY should be varying
  • OF.bodyX and OF.bodyY should be consistent with IMU.GyrX and IMU.GyrY

Set the EKF_GPS_TYPE parameter to 3 make the EKF ignore GPS and use optical flow data.

More information at APM site