Skip to content

光流

Optical Flow uses a downward facing camera and a downward facing distance sensor for velocity estimation. It can be used to determine speed when navigating without GNSS — in buildings, underground, or in any other GNSS-denied environment.

The video below shows PX4 holding position using the Ark Flow sensor for velocity estimation in Position Mode:

The image below shows an optical flow setup with a separate flow sensor (PX4Flow) and distance sensor (Lidar-Lite):

Optical flow lidar attached

设置

An Optical Flow setup requires a downward facing camera and a downward facing distance sensor (preferably a LiDAR). These can be combined in a single product, such as the Ark Flow and Holybro H-Flow, or they may be separate sensors.

The sensor(s) can be connected via MAVLink, I2C or any other bus that supports the peripheral.

INFO

If connected to PX4 via MAVLink the Optical Flow camera sensor must publish the OPTICAL_FLOW_RAD message, and the distance sensor must publish the DISTANCE_SENSOR message. The information is written to the corresponding uORB topics: DistanceSensor and ObstacleDistance.

在不同方向移动时光流的输出必须如下所示:

Vehicle movementIntegrated flow
Forwards+ Y
Backwards- Y
Right- X
Left+ X

Sensor data from the optical flow device is fused with other velocity data sources. The approach used for fusing sensor data and any offsets from the center of the vehicle must be configured in the estimator.

Scale Factor

For pure rotations the integrated_xgyro and integrated_x (respectively integrated_ygyro and integrated_y) have to be the same. If this is not the case, the optical flow scale factor can be adjusted using SENS_FLOW_SCALE.

TIP

The low resolution of common optical flow sensors can cause slow oscillations when hovering at a high altitude above ground (> 20m). Reducing the optical flow scale factor can improve the situation.

Flow Sensors/Cameras

ARK 光流

ARK Flow is a DroneCAN optical flow sensor, distance sensor, and IMU. It has a PAW3902 optical flow sensor, Broadcom AFBR-S50LV85D 30 meter distance sensor, and BMI088 IMU.

Holybro H-Flow

The Holybro H-Flow is a compact DroneCAN optical flow and distance sensor module. It combines a PixArt PAA3905 optical flow sensor, a Broadcom AFBR-S50LV85D distance sensor, and an InvenSense ICM-42688-P 6-axis IMU. An all-in-one design that simplifies installation, with an onboard infrared LED enhances visibility in low-light conditions.

PMW3901-Based Sensors

PMW3901 is an optical flow tracking sensor similar to what you would find in a computer mouse, but adapted to work between 80 mm and infinity. It is used in a number of products, including some from: Bitcraze, Tindie, Hex, Thone and Alientek.

Other Cameras/Sensors

It is also possible to use a board/quad that has an integrated camera. For this the Optical Flow repo can be used (see also snap_cam).

Range Finders

You can use any supported distance sensor. 然而,我们建议使用激光而不是超声波传感器,因为它的鲁棒性和准确性更高。

估计器

估计器融合数据从光流传感器和其他资源获得。 The settings for how fusing is done, and relative offsets to vehicle center must be specified for the estimator used.

The offsets are calculated relative to the vehicle orientation and center as shown below:

Optical Flow offsets

Optical Flow based navigation is enabled by both EKF2 and LPE (deprecated).

Extended Kalman Filter (EKF2)

For optical flow fusion using EKF2, set EKF2_OF_CTRL.

If your optical flow sensor is offset from the vehicle centre, you can set this using the following parameters.

参数描述
EKF2_OF_POS_XX position of optical flow focal point in body frame (default is 0.0m).
EKF2_OF_POS_YY position of optical flow focal point in body frame (default is 0.0m).
EKF2_OF_POS_ZZ position of optical flow focal point in body frame (default is 0.0m).

See Using the ECL EKF > Optical flow for more information.