Skip to main content

VIO vs Optical Flow — What's the Difference for Drones?

Both let a drone fly where there is no GPS, both point a camera at the ground, and both plug into the flight controller's EKF. That is where the similarity ends. Optical flow is a velocity sensor; visual-inertial odometry is a position sensor. This page explains what each one measures, why the difference matters in the air, and how to choose between the MicoVIO and the MTF optical flow sensors.

Side-by-side comparison of optical flow and MicoVIO visual-inertial odometry

What optical flow measures​

An optical flow sensor is a tiny, low-resolution camera looking straight down. Its chip compares one frame with the next and reports how far the ground pattern moved across the image — a number in pixels per second. On its own that number is meaningless: the same movement looks fast at 1 m and slow at 10 m. That is why every flow sensor carries, or needs, a rangefinder: dividing the pixel rate by the height turns it into a horizontal velocity in metres per second.

That velocity goes to the flight controller as an OPTICAL_FLOW message, and the EKF uses it to correct the velocity it already predicts from the IMU. Position is then integrated from velocity — and everything that is integrated accumulates error. Hold a flow-equipped drone perfectly still and its position estimate still creeps, because a small velocity bias, integrated for a minute, is a metre. Yaw the aircraft fast and the flow chip loses track altogether, because the ground sweeps across its field of view faster than it can match.

None of this makes optical flow bad. At 1–8 g and a fraction of the cost of any VIO system it gives a 3-inch quad a solid indoor hover, which is why the MTF-01, MTF-01P and MTF-02 / 02P are so popular. It simply is not a position sensor.

What VIO measures​

Visual-inertial odometry tracks hundreds of distinct features — corners, edges, texture — across successive frames of a proper camera. From how those features move it solves for the camera's own motion in six degrees of freedom: three of position and three of orientation. The IMU does two jobs alongside: it predicts where the features should be in the next frame, so tracking survives fast rotation and brief blur, and it supplies the high-rate motion between the ~40 Hz camera updates. A rangefinder (the ToF on MicoVIO) fixes the metric scale, which a single camera cannot know by itself.

The output is a pose — position, velocity and attitude — sent as a MAVLink ODOMETRY message. The flight controller treats it as an external navigation source, exactly as it would a motion-capture system or a VOXL companion computer: position and velocity and yaw, not just velocity.

MicoVIO adds local loop closure. It keeps a short memory of recent images; when the current view matches one of them, the match becomes a position constraint that pulls the estimate back to where it was. In a hover this is the difference between an aircraft that sits on a tile and one that slowly tours the room.

Why VIO used to need a companion computer — and why MicoVIO doesn't​

Until now, VIO on an open-source drone meant a stereo or tracking camera (Intel RealSense D435 or T265), a single-board computer such as a Raspberry Pi or Jetson running ROS and a VIO package, a power supply for it and a MAVLink bridge to the flight controller: several hundred dollars, well over a hundred grams, days of integration, and a software stack that tends to diverge when the light changes or the aircraft is bumped. MicoVIO runs the entire pipeline on the module and presents itself to the flight controller like a GPS — one 4-pin UART cable, MAVLink 2, no companion computer. See the standalone section of the manual for the side-by-side.

Why error grows with distance, not time​

Because VIO estimates position from what it sees, a stationary aircraft accumulates almost no error — the same features keep matching the same places. Error enters when the aircraft moves to new ground, which is why VIO accuracy is quoted as a percentage of distance travelled. MicoVIO's typical figure is 1 %; in MicoAir's outdoor tests against RTK, 136 m and 141 m flights ended with 0.73 m and 0.70 m of absolute trajectory error, about 0.5 %. An optical-flow position, by contrast, drifts whether you fly or not.

Side by side​

Optical flow (MTF-01 · MTF-01P · MTF-02 · MTF-02P)MicoVIO (visual-inertial odometry)
SensorLow-resolution flow chip + LED, laser or ToF rangefinderGlobal-shutter HDR camera (120°) + IMU + ToF rangefinder
MeasuresGround motion across the image → horizontal velocityFull 6-DoF motion: position, velocity, attitude
PositionIntegrated from velocity by the EKF — drifts with timeEstimated directly; local loop closure holds a hover
Message to FCOPTICAL_FLOW → EKF velocity aidingODOMETRY → EKF external navigation (position + velocity + yaw)
Trajectory / RTLNo usable trajectory; RTL needs GPS≈ 1 % typical error → GPS-free RTL (firmware dependent)
Fast rotationFast yaw and aggressive maneuvers degrade flowIMU-aided tracking up to 300°/s
Working heightBest within a few metres of the groundUp to 30 m
Light> 60 lux (MTF-01)> 1 lux
ProcessingOn the sensorOn the sensor — no companion computer
Weight1–8 g16 g
FirmwareArduPilot, PX4, INAV, BetaflightArduPilot ≥ 4.5.2, PX4

Which one should you buy?​

Choose optical flow when

  • the job is "hover indoors without drifting into the wall" on a small aircraft, and nothing more;
  • every gram counts — a tiny whoop or 2–3-inch micro (MTF-02 is 1 g);
  • you fly INAV or Betaflight, which have no external-navigation input;
  • the sensor budget is the main constraint.

Choose MicoVIO when

  • you need a position, not just a damped hover: waypoints indoors, repeatable paths, scanning a warehouse aisle, flying under a bridge deck;
  • you want return-to-launch with no GPS (with firmware that supports external-nav RTL);
  • the aircraft yaws or flies aggressively — orbits, spins, FPV-style moves — and flow keeps dropping out;
  • lighting is poor or changes hard (indoors to outdoors, bright sun on a reflective floor);
  • you are building the kind of autonomous aircraft that until now needed a VOXL or a Jetson plus a stereo camera, and would rather carry 16 g on a spare UART.

Neither replaces GPS/RTK outdoors. VIO position is relative to take-off and grows ~1 % of distance in error; RTK is absolute to a few centimetres. Serious autonomous platforms fly RTK where there is sky and VIO where there is not — ArduPilot's EKF3 source switching makes exactly that hand-over possible.

How each one plugs into the flight controller​

Optical flowMicoVIO
ArduPilotFLOW_TYPE 5, rangefinder as RNGFND1_TYPE 10, EKF EK3_SRC1_VELXY 5 (OpticalFlow) — see the Optical Flow Setup GuideVISO_TYPE 3 on a MAVLink 2 serial port at 921600, rangefinder RNGFND1_TYPE 10, EKF EK3_SRC1_POSXY / VELXY / VELZ / YAW 6 (ExternalNav) — see the MicoVIO manual
PX4SENS_EN_PX4FLOW / flow via MAVLink, EKF2_OF_CTRLMAVLink port in Onboard mode at 921600, EKF2_EV_CTRL 9, EKF2_HGT_REF 2 — see the MicoVIO manual
Board requirementAny board with a spare UART, including F405Firmware with external-vision support — H7 boards; most F405 boards leave it out

FAQ​

What is visual-inertial odometry? Estimating a camera's motion by tracking visual features between frames and fusing that with an IMU. The output is a full 6-DoF pose relative to the starting point. On a drone it replaces GPS as the EKF's position source.

What does an optical flow sensor actually measure? How fast the ground moves across a small downward camera, scaled by height into a horizontal velocity. It is a velocity sensor; the flight controller integrates it to get position.

Why does optical flow drift and VIO drift much less? Integrating velocity integrates its errors, so a flow position wanders with time. VIO estimates position directly, predicts between frames with the IMU, and (on MicoVIO) closes local loops, so error grows only with distance flown — about 1 %.

Can I use both on the same drone? You can, but VIO already supplies velocity, position and yaw, so the flow sensor adds little.

Is VIO a replacement for GPS or RTK? Where there is no sky view, yes. For absolute outdoor accuracy, no — VIO is relative and its error grows with distance; RTK is absolute to centimetres.


Written and maintained by the Robofusion engineering team.