An Engineer's Blog

Back

Autonomous micro UAV indoor mapping, no GPS, one cameraBlur image

Overview

The first portfolio part of my bachelor thesis: an autonomous micro UAV that maps a building interior without GPS, from a single camera. The previous post set up the simulator side, PX4 in Gazebo with MAVROS. The thesis question is where the position estimate comes from without satellites, and how a camera alone builds a map.

Both stages were recorded the same day. Stage A flies the drone hard in simulation and tests localization methods on real footage; Stage B runs the full stack with ORB-SLAM, simulated and real.

Stage A: stability, agility, and the localization shootout

Stage A: offboard stabilization, circular and lemniscate trajectory tests, the SDVL vs SVO comparison, and dense mapping.

Offboard communication and stabilising

The drone hovers in a simulated room while RViz tracks its pose axes, on the MAVROS offboard link from the previous post. Nothing later here works without that stable hover.

Pose agility test: circular trajectory

RViz tracing a circular trajectory with the drone's pose axes while the drone flies the circle in Gazebo Pose agility test: a full circle in RViz on the left, the drone following it in Gazebo on the right.

Circles are gentle but never stop accelerating: the drone banks continuously, and that banking shakes the camera and upsets a visual tracker.

Manoeuvring test: lemniscate trajectory

RViz tracing a lemniscate, or figure-eight, trajectory with pose axes at each crossing Manoeuvring test: the figure-eight, with the tight turns at the crossing point.

The figure-eight is harder than the circle: at the crossing point the drone flips its turn direction through the tightest curvature on the path, and a controller overshoot there compounds on the way back. The traced line stays clean through the crossing, so the whole chain from planner to MAVROS to PX4 holds.

The localization shootout: SDVL vs SVO

Split screen comparing SDVL and SVO running on the same real office footage The shootout: semi-direct visual localization on the left, SVO on the right, same flight, same office.

On real footage from the office floor, two camera-only localization methods run head to head. SDVL ↗, semi-direct visual localization, builds its pink point cloud and camera trail live; the split screen then runs it against SVO ↗, semi-direct visual odometry, on the same flight. Both work without GPS; they differ in how they hold onto the world as the drone swings past desks and chairs.

Mapping: the dense map

RViz building a dense white point map slice by slice while the drone sweeps the room in Gazebo Dense mapping: the room accumulating slice by slice from the depth data.

The last leg is dense mapping, RGB-D only. No loop closures, no landmarks; depth data piles into a voxel grid until the room is a solid white model in RViz. Localization ran the whole time to hold the drone’s position estimate.

Stage B: the full stack, simulation and real life

Stage B: ORB-SLAM and the full flight stack, initialization through to map completion, then the same in SITL at double speed.

Stage B puts ORB-SLAM into the full flight stack. The screen carries four views at once: the physical drone, the keyframe trajectory, the camera view with tracked features and a live counter (SLAM MODE | KFs: 24 MPs: 1883 Matches: 250, keyframes, map points, feature matches), and the dense map growing in RViz.

The phases repeat the Stage A tests with the tracker in the loop:

  • Initialization: the camera finds features and the first keyframes anchor the map. Nothing moves until the tracker is confident.
  • Diagonal trajectory: climb plus sideways travel at once, so the camera pitches and rolls while the tracker keeps its place.
  • Back to start: fly the loop home and see where “home” lands. The gap between where the drone started and where it thinks it started is the drift; every visual system accumulates some.
  • Map completion: the dense map fills in to a recognizable copy of the room, and the trajectory loop closes inside it.

The four panels during initialization: drone on the floor, keyframe trajectory, feature-tracked camera view, and the dense map in RViz Initialization: the tracker anchors the first keyframes before anything moves.

The last third returns to SITL, the same PX4-in-Gazebo setup with this work on top. SITL Mapping, Speed x2.0 flies a simulated house while the dense pipeline rebuilds it; SITL Planner, Speed x2.0 draws a green start-to-goal path across the finished map and flies it. Testing in simulation first makes the real flights calm: algorithms get to fail in a house where nobody pays for wall repairs.

The SITL planner drawing a green path across the completed house map while the drone follows in Gazebo Planner at work: start to goal over the dense map, at double speed.

What carried over

Stage A proved the parts: a controller that tracks circles and figure-eights, and two localization methods that survive real footage. Stage B bolted them into one stack with ORB-SLAM. The drone holds position on camera alone and hands back a map of the room it flew. Next come longer autonomous runs and the hardware lessons that only exist outside the simulator.

Autonomous micro UAV indoor mapping, no GPS, one camera
https://tin.ng/blog/2021-01-20--autonomous-uav-indoor-mapping
Author Tin Nguyen
Published at January 20, 2021
Comment seems to stuck. Try to refresh?✨