🎉 75% of content is free forever — Unlock Premium from $10/mo →
CW
NEWSLIVESearch All Content
đŸ’ŧ Servicesâ„šī¸ Aboutâœ‰ī¸ ContactView Pricing Plansfrom $10

Indoor Drone Navigation: VIO, UWB, and SLAM

đŸŸĸ Free Lesson
GPS-Free Flight

The one-line mental model

Indoor navigation replaces the single global fix from satellites with a fusion problem: visual-inertial odometry for continuous relative motion, one or more absolute references — UWB anchors, WiFi fingerprints, or mapped landmarks — to arrest drift, and a planner that respects tight geometry.

You will be able to:

  • Compare UWB, WiFi, visual landmarks, and VIO on accuracy and setup cost
  • Fuse camera and IMU into a continuous pose estimate with bounded drift
  • Recognize when VIO is about to fail and switch strategies in time
  • Design waypoint missions for warehouses and corridors with these constraints

Prerequisites

  • !SE(3) pose notation
  • !IMU basics: accelerometer and gyroscope
  • !Graph-based optimization intuition

What You'll Learn

  • 1Explain why GPS fails indoors and what replaces it
  • 2Implement a complementary camera-IMU fusion sketch
  • 3Choose positioning technology per environment type

The indoor positioning landscape

Outdoors, a GPS receiver gives meter-level absolute position essentially for free, with infrastructure already in orbit. Indoors the signal is gone — attenuated to noise within a few meters of the first wall — and every replacement requires either pre-installed infrastructure or prior mapping. The four practical options divide cleanly by what they assume about the building.

UWB (ultra-wideband) ranging installs fixed anchors with known positions and measures time-of-flight to a tag on the aircraft, typically with multilateration giving 10 to 30 centimeter accuracy. It is the most reliable option for industrial deployments: predictable, low-latency, and independent of lighting, at the cost of a site survey and anchor power. WiFi fingerprinting reuses existing access points by matching observed signal strengths against a radio map collected beforehand; accuracy is one to three meters, free if the building already has dense WiFi, but the fingerprint map drifts as furniture and people move. Visual landmarks — AprilTags, QR markers, or mapped natural features — give 5 to 20 centimeter accuracy when a marker is in view, and no accuracy at all when one is not, so they suit corridors and doorways rather than open halls. Visual-inertial odometry needs no infrastructure whatsoever and provides a continuous six-degree-of-freedom pose, drifting roughly one percent of distance traveled — excellent for short hops, insufficient alone for long patrols.

TechnologyTypical accuracyInfrastructureLight dependenceDrift behavior
UWB multilateration10 to 30 cmAnchors + surveyNoneBounded, absolute
WiFi fingerprinting1 to 3 mExisting APs + radio mapNoneMap drift over time
Visual landmarks5 to 20 cmMarkers or mapped featuresNeeds textureBounded in view
VIO (camera + IMU)Relative, ~1%/100 mNoneNeeds textureUnbounded alone
LiDAR SLAM2 to 10 cmNone or prior mapNoneBounded with loop closure

Production systems almost never pick one. The standard architecture runs VIO continuously and corrects it whenever an absolute reference — UWB range, tag detection, map match — becomes available.

Visual-inertial odometry, concretely

VIO fuses two sensors with complementary failure modes. The IMU measures at hundreds of hertz but double-integrates accelerometer bias into position error that grows quadratically with time. The camera measures at tens of hertz, is drift-free over short baselines where features match, but fails in darkness, blur, or textureless walls. A sliding-window optimizer estimates the recent trajectory, feature landmarks, and IMU biases jointly, minimizing reprojection error and IMU preintegration residuals.

You do not need to implement the optimizer to use the idea correctly. What you do need is the failure checklist: VIO needs sufficient texture (not a blank white wall), sufficient lighting, and sufficient excitation — a camera staring at a featureless ceiling for five seconds has observed essentially nothing, and the estimate will drift by however far the IMU bias carries it. Awareness of these limits lets you plan trajectories that keep textured surfaces in view.

python
from dataclasses import dataclass, field
import numpy as np

@dataclass
class VioState:
    position: np.ndarray
    velocity: np.ndarray
    bias_accel: np.ndarray
    covariance_trace: float

class SimpleVioStub:
    """Educational stand-in: IMU dead-reckoning with feature-fix decay.

    Real VIO runs a sliding-window bundle adjustment; this sketch shows the
    interfaces and the drift bookkeeping the rest of the stack depends on.
    """

    def __init__(self, dt=0.01, drift_per_s=0.02):
        self.dt = dt
        self.drift_per_s = drift_per_s
        self.state = VioState(np.zeros(3), np.zeros(3), np.zeros(3), 1.0)
        self.last_feature_fix = 0.0

    def imu_step(self, accel_meas, gyro_meas):
        """Propagate state with raw IMU; covariance grows without fixes."""
        self.state.velocity = self.state.velocity + accel_meas * self.dt
        self.state.position = self.state.position + self.state.velocity * self.dt
        age = self.last_feature_fix
        self.state.covariance_trace = 1.0 + self.drift_per_s ** 2 * age ** 2
        return self.state

    def feature_fix(self, position_meas, quality):
        """When enough features match, snap position and reset drift."""
        if quality < 0.5:
            return False
        innovation = position_meas - self.state.position
        gain = np.clip(quality, 0.3, 0.95)
        self.state.position = self.state.position + gain * innovation
        self.last_feature_fix = 0.0
        self.state.covariance_trace = max(0.5, self.state.covariance_trace * 0.2)
        return True

    def advance_time(self, seconds):
        self.last_feature_fix += seconds

vio = SimpleVioStub()
rng = np.random.default_rng(5)
for t in range(400):
    accel = rng.normal(0, 0.02, 3)
    vio.imu_step(accel, np.zeros(3))
    vio.advance_time(vio.dt)
    if t % 100 == 99:
        quality = 0.9 if t < 300 else 0.2   # texture runs out at the end
        fixed = vio.feature_fix(rng.normal(0, 0.05, 3), quality)
        print(f"t={(t + 1) * vio.dt:5.1f}s  cov {vio.state.covariance_trace:6.2f}  "
              f"fix applied: {fixed}")

The covariance trace printed here is the number to watch operationally. When it crosses a threshold you set for the mission, the navigation stack should be requesting an absolute reference — fly toward a tag, request a UWB fix, or trigger a loop closure — rather than continuing to integrate blind.

UWB ranging and multilateration

UWB anchors at known positions measure time-of-flight to a tag on the drone, giving slant ranges good to a few centimeters over noise. Position comes from solving for the intersection of those range spheres — a least-squares problem once you have four or more ranges.

python
import numpy as np

ANCHORS = np.array([
    [0.0, 0.0, 3.0],
    [20.0, 0.0, 3.0],
    [20.0, 12.0, 3.0],
    [0.0, 12.0, 3.0],
])

def multilaterate(ranges, anchors=ANCHORS, iters=30, lr=0.15):
    """Gauss-Newton style range intersection; returns position estimate."""
    pos = anchors.mean(axis=0)
    for _ in range(iters):
        residuals = []
        jacobian = []
        for r, a in zip(ranges, anchors):
            diff = pos - a
            dist = np.linalg.norm(diff) + 1e-8
            residuals.append(dist - r)
            jacobian.append(diff / dist)
        residuals = np.array(residuals)
        J = np.array(jacobian)
        step = np.linalg.lstsq(J, residuals, rcond=None)[0]
        pos = pos - lr * step
        if np.linalg.norm(step) < 1e-6:
            break
    return pos

rng = np.random.default_rng(3)
true_pos = np.array([8.0, 5.0, 1.2])
ranges = [np.linalg.norm(true_pos - a) + rng.normal(0, 0.04) for a in ANCHORS]
est = multilaterate(ranges)
err = np.linalg.norm(est - true_pos)
print(f"true  {true_pos}")
print(f"est   {np.round(est, 3)}   error {err * 100:.1f} cm")

With only three ranges the solution can mirror across the anchor plane; four or more gives you redundancy that both resolves the mirror and lets you reject a single bad range — anchor multipath near metal racking is the classic indoor culprit. When a residual for one anchor suddenly jumps while the others stay consistent, drop that anchor's range rather than letting it corrupt the fix.

Fusing absolute fixes with VIO

The fusion pattern is a correction filter. VIO propagates continuously; absolute fixes arrive asynchronously with their own uncertainty. A Kalman-style update pulls the state toward the fix, weighted by relative confidence, and — critically — resets the accumulated drift in the internal map so subsequent VIO steps start from the corrected frame. The planner then consumes position and covariance together, treating high-covariance regions as expensive to traverse rather than pretending every estimate is equally good.

python
import numpy as np

class PositionFuser:
    """Fuse high-rate odometry with low-rate absolute fixes."""

    def __init__(self):
        self.pos = np.zeros(3)
        self.vel = np.zeros(3)
        self.P = np.eye(3) * 4.0     # position covariance

    def odometry_step(self, delta, dt, process_noise=0.05):
        self.pos = self.pos + delta
        self.P = self.P + np.eye(3) * process_noise ** 2 * dt
        return self.pos, self.P

    def absolute_fix(self, z, r_std):
        """Kalman update from UWB or tag measurement."""
        R = np.eye(3) * r_std ** 2
        K = self.P @ np.linalg.inv(self.P + R)
        self.pos = self.pos + K @ (z - self.pos)
        self.P = (np.eye(3) - K) @ self.P
        return self.pos, self.P

fuser = PositionFuser()
rng = np.random.default_rng(7)
true = np.array([2.0, 1.0, 1.5])
for step in range(120):
    drift = rng.normal(0, 0.01, 3)
    fuser.odometry_step(drift, dt=0.05)
    if step % 30 == 0:
        noisy = true + rng.normal(0, 0.1, 3)
        _, cov = fuser.absolute_fix(noisy, r_std=0.15)
        print(f"step {step:3d}  pos {np.round(fuser.pos, 2)}  "
              f"trace(P) {np.trace(cov):.3f}")

Note how the covariance trace falls at each fix and climbs between them. That sawtooth is the health signature of an indoor stack: sawtooth within bounds means the absolute references are frequent enough; steady climb means you need more anchors, more markers, or slower flight.

Planning missions indoors

Indoor geometry constricts the planner in ways outdoor flight never does. Corridors are one-dimensional problems with doorways as choke points; open warehouse floors have few visual features at height, so trajectories should hug shelving that provides texture; ceiling clearance often forbids the climb-and-cruise profile that works outdoors. Keep speeds low enough that the camera's motion blur stays manageable — under 2 m/s is a common limit for VIO-dominated flight — and plan return paths that retrace segments where absolute references already exist, so the way home benefits from a corrected state rather than maximum accumulated drift.

Common Mistakes

Running VIO with no plan for absolute correction

Fix: Treat odometry as a bridge between fixes; schedule UWB ranges, tag detections, or map matches at known intervals.

Ignoring the covariance

Fix: Gate actions and waypoint transitions on position uncertainty, not just on nominal error.

Assuming UWB ranges are always clean

Fix: Implement residual-based anchor rejection; one metal-rack multipath range can pull a fix by meters.

Flying fast through featureless spaces

Fix: Slow down where texture is poor; blur and feature dropout compound exactly when you can least afford them.

Best Practices

  • Survey and log anchor positions carefully — UWB accuracy is capped by anchor survey error
  • Collect WiFi radio maps in the configuration the building actually operates in, and refresh when layouts change
  • Place visual markers at corridor ends and doorways where they are almost always in view
  • Record odometry, fixes, and covariance throughout every flight for post-incident reconstruction

Key Takeaways

  • Indoor navigation is a fusion problem: continuous odometry corrected by intermittent absolute references
  • UWB gives bounded absolute accuracy, WiFi is free but map-dependent, VIO is infrastructure-free but drifts alone
  • Watch VIO covariance in real time; it tells you when an absolute fix is required, not merely nice
  • Multilateration needs four or more ranges and residual-based rejection to survive multipath
  • Plan trajectories that keep texture in view and reference density high along the return path
CW

ChatWhole Learn Editorial Team

Written by experienced data scientists, software engineers, and educators. All content is reviewed by industry professionals to ensure accuracy and relevance.

Last reviewed: 2026-10-13

—
☆☆☆☆☆
0 ratings

Rate & Feedback

Need Expert Drone AI Help?

Get personalized tutoring, project support, or professional consulting.

Advertisement