Overview
Caves, tunnels and mines have no GPS, little light and tight walls. This project is the software brain for a drone that can enter such a place by itself: it maps what it sees in 3D, plans a safe path, chooses where to explore next and steers along the path without touching the walls.
It is built on ROS 2 Humble and Ignition Gazebo Fortress with a quadrotor carrying a 3D LiDAR, and has been developed and tested in simulation.
What the project is about
A drone flying through a cave cannot use GPS, cannot count on light, and has walls only a metre or two away on every side. This project gives it a way to cope: it builds a 3D map while it flies, plans a safe path through that map, chooses where to explore next and steers along the path on its own. Everything was developed and tested in simulation.

How it works
- Mapping: a 3D LiDAR on the drone feeds OctoMap, which turns the laser points into a grid of small cubes marking free and occupied space.
- Planning: a D* Lite planner searches that 3D grid for a route with no collisions, and repairs the route when new obstacles appear instead of starting again.
- Exploring: a frontier explorer finds the edge between mapped and unknown space, picks a safe spot there and sends it to the planner as the next goal.
- Flying: a tunnel controller follows the planned path by looking ahead along it, holds a safe altitude and keeps away from the walls.

Staying out of trouble
Caves are full of dead ends, so the system is built to notice and recover rather than assume the plan always works.
- The planner keeps a safety margin around every obstacle and smooths the path so the drone never has to make a sharp turn.
- The explorer rejects targets that sit too close to a wall.
- If the drone is told to move but barely moves for a couple of seconds, it stops, reverses and turns to give the LiDAR a new view, then plans again.

Maps and test worlds
The map is stored as small cubes, so the planner works with solid obstacles instead of millions of raw laser points. The system was exercised in several simulated worlds: a rough cave, a mine, a collapsed building and a warehouse.


Main settings
| Part | Setting |
|---|---|
| Map cell size | 10 cm |
| Planner update | about every 0.8 s |
| Hover height | 0.8 m |
| Top speed | 0.8 m/s |
| Look-ahead distance | 1.0 m |
A single command starts the whole mission: the simulator, the transform bridge, mapping and planning, the flight controller and the explorer, each in its own terminal.

Where it stands
This is a simulation project. The repository documents the system and its tuning values, but there is no formal benchmark of success rate or area covered, so none is claimed here. The planning and control parts are separate from the simulator, so moving them to a real vehicle is a matter of replacing the simulated sensors and flight interface.
Code, launch instructions and configuration are in the project repository.