MAVLINKHUD

Overview

The FLOW parameter group configures the Optical Flow Sensor. This sensor uses a tiny high-speed camera and an image processor to track the movement of "features" (textures) on the ground. By measuring this "visual flow," the autopilot can estimate the vehicle's horizontal velocity.

Optical flow is the primary method for position hold in GPS-denied environments (Indoors, under tree canopies).

Key Concepts

1. Scaling (FLOW_FXSCALER / FLOW_FYSCALER)

The raw output of the flow sensor must be scaled based on the lens focal length and mounting height to convert "pixels per second" into "meters per second."

2. Height Requirement

Optical flow requires an accurate measurement of height above ground to calculate velocity correctly.

  • Rangefinder: A Lidar or Ultrasonic sensor is almost always required alongside an Optical Flow sensor.

3. Orientation (FLOW_ORIENT_YAW)

The autopilot needs to know which way the flow camera is rotated relative to the flight controller to ensure the "Flow X" aligns with "Vehicle X."

Parameter Breakdown

  • FLOW_TYPE: Driver selection (0=Disabled, 1=PX4Flow, 2=DroneCAN, 5=CX-OF, etc.).
  • FLOW_ADDR: I2C address of the sensor.
  • FLOW_POS_X/Y/Z: Offset of the sensor relative to the vehicle's center of gravity (for lever-arm compensation).

Integration Guide

  1. Hardware: Mount the sensor facing straight down. Ensure good lighting.
  2. Enable: Set FLOW_TYPE and EK3_SRC1_VELXY = 5 (Optical Flow).
  3. Calibrate: Perform a "Handheld Calibration" (see Wiki) to ensure the flow and gyro data are perfectly synced.
  4. Test: Hover in Loiter mode. The vehicle should stay stationary without GPS.

Developer Notes

  • Library: libraries/AP_OpticalFlow.
  • Accuracy: Accuracy degrades with height. Most sensors are effective up to 10-20 meters AGL.
  • Surface Texture: Flow will fail over perfectly uniform surfaces like smooth water or solid-color tiles.

FLOW_ADDR

Default 0
Range 0 127

Address on the bus (FLOW_ADDR)

Description

I2C address selection for the optical flow sensor.

Tuning & Behavior

  • Default Value: 0
  • Range: 0 127

FLOW_FXSCALER

Default 0
Range -800 +800

X axis optical flow scale factor correction (FLOW_FXSCALER)

Description

Scale factor correction for the X axis optical flow rate.

Tuning & Behavior

  • Default Value: 0
  • Range: -800 800

FLOW_FYSCALER

Default 0
Range -800 +800

Y axis optical flow scale factor correction (FLOW_FYSCALER)

Description

Scale factor correction for the Y axis optical flow rate.

Tuning & Behavior

  • Default Value: 0
  • Range: -800 800

FLOW_HGT_OVR

m
Default 0
Range 0 2

Height override of sensor above ground (FLOW_HGT_OVR)

Description

Fixed height override for rover vehicles.

Tuning & Behavior

  • Default Value: 0 m
  • Range: 0 2

FLOW_MAX

Default 0.6
Range 0.1 2.5

FlowHold Flow Rate Max (FLOW_MAX)

Description

Limits the maximum optical flow rate considered valid during FlowHold mode.

Tuning & Behavior

  • Default Value: 0.6
  • Range: 0.1 2.5

FLOW_OPTIONS

Default 0

Optical Flow Options (FLOW_OPTIONS)

Description

This parameter is not found in the current ArduPilot optical flow library. It may be a mis-scaffolded entry or from a specific vendor fork.

FLOW_ORIENT_YAW

cdeg
Default 0
Range -17999 +18000

Flow sensor yaw alignment (FLOW_ORIENT_YAW)

Description

Yaw alignment of the flow sensor relative to the vehicle.

Tuning & Behavior

  • Default Value: 0 cdeg
  • Range: -17999 18000

FLOW_POS

m
Default 0
Range -5 5

Position offset (FLOW_POS)

Description

XYZ position of the optical flow sensor focal point in body frame. Note: In the codebase this is split into _POS_X, _POS_Y, _POS_Z but exposed as a vector parameter.

Tuning & Behavior

  • Default Value: 0 0 0 m
  • Range: -5 5

FLOW_TYPE

Default 0

Optical flow sensor type (FLOW_TYPE)

Description

Optical flow sensor type.

Tuning & Behavior

  • Default Value: 0 (None)
  • Values: 0:None, 1:PX4Flow, 2:Pixart, 3:Bebop, 4:CXOF, 5:MAVLink, 6:DroneCAN, 7:MSP, 8:UPFLOW