Skip to content

snktshrma/ngps_flight

Repository files navigation

NGPS: Next-Generation Positioning System

WIP License ROS2 ArduPilot
Python C++ PyTorch
OpenCV LightGlue

Next-Generation Positioning System (NGPS) for high-altitude drone navigation without GPS.

Description

This codebase implements a visual geo-localization system for drones that matches down-facing camera images against satellite reference images using deep learning-based feature matching. The system provides absolute position estimates to correct drift in Visual-Inertial Odometry (VIO) systems.

Main Components

  • ap_ngps_ros2: ROS2 node that performs visual geo-localization by matching camera images to satellite reference images using LightGlue/SuperPoint deep learning features. Runs at 1-2 Hz.

  • ap_ukf: Unscented Kalman Filter that fuses multiple sensor inputs:

    • NGPS absolute position (1-2 Hz)
    • VIO relative pose (10-20 Hz)
    • IMU data (high frequency)

    Outputs fused odometry at 10-20 Hz for flight control.

  • ap_vips: Visual-Inertial Odometry system that provides high-frequency relative pose estimates optimized for high-altitude flight.

How It Works

  1. NGPS module matches real-time camera frames to a georeferenced satellite reference image
  2. Provides absolute position estimates at low frequency (1-2 Hz)
  3. UKF fuses NGPS absolute positions with high-frequency VIO estimates
  4. Fused output sent to ArduPilot's EKF for final state estimation

Demo

Algorithm Demonstration Video

Related Articles & Blogs

Related Projects

  • ap_nongps - Earlier prototype implementation with SIFT-based feature matching and optical flow methods

TODO

  • Add a fallback VO pipeline
  • Add global optimisation for fusion
  • Update AP to accept position and odometry as separate sources to be fused internally
  • Add support for multiple reference images
  • Optimize feature matching for faster performance
  • Add calibration tools and documentation
  • Improve error handling and recovery
  • Add more unit tests
  • Document configuration parameters
  • Add example launch files for different scenarios
  • Performance profiling and optimization
  • Support for different camera models

Installation

Step 1: Install Docker Engine

Step 2: NVIDIA Container Toolkit (optional)

If NVIDIA GPU is present.

sudo nvidia-ctk runtime configure --runtime=docker
sudo systemctl restart docker

Step 3: Clone the repository and build the development image

mkdir -p ~/ngps_ws/src
cd ~/ngps_ws/src
git clone git@github.com:snktshrma/ngps_flight.git
cd ~/ngps_ws/src/ngps_flight
docker build -f Dockerfile.dev -t vps-dev:latest .

For Docker only: Skip Step 4 and Step 5.

With NVIDIA GPU (requires Step 2):

docker run -it \
  --name vps-dev \
  --network host \
  --privileged \
  --ipc host \
  --gpus all \
  -v ~/ngps_ws:/home/dev/ngps_ws \
  -e DISPLAY=$DISPLAY \
  -v /tmp/.X11-unix:/tmp/.X11-unix \
  vps-dev:latest

Without NVIDIA GPU:

docker run -it \
  --name vps-dev \
  --network host \
  --privileged \
  --ipc host \
  -v ~/ngps_ws:/home/dev/ngps_ws \
  -e DISPLAY=$DISPLAY \
  -v /tmp/.X11-unix:/tmp/.X11-unix \
  vps-dev:latest

To start again:

docker start vps-dev
docker exec -it vps-dev /bin/bash

Step 4: Install Distrobox

For Ubuntu:

sudo apt install distrobox

export DBX_CONTAINER_MANAGER=docker
echo "export DBX_CONTAINER_MANAGER=docker" >> ~/.bashrc

Step 5: Create the Distrobox

  • With NVIDIA GPU (requires Step 2):
distrobox create \
  --name vps-dev \
  --image vps-dev:latest \
  --additional-flags "--privileged --ipc=host --gpus all"
  • Without GPU (no NVIDIA GPU or no toolkit):
distrobox create \
  --name vps-dev \
  --image vps-dev:latest \
  --additional-flags "--privileged --ipc=host"

Step 6: Enter and initialize the workspace

distrobox enter vps-dev

Inside the container:

bash ~/ngps_ws/src/ngps_flight/setup.sh
# When done,
source ~/.bashrc

Distrobox: The host user home directory is mounted; workspace paths such as ~/ngps_ws match the host, while binaries and libraries resolve from the container image.

Step 7: Verify the simulation stack

ros2 launch ardupilot_gz_bringup iris_runway.launch.py
  • Expected result: ArduPilot DDS and Gazebo Harmonic start with the runway simulation.

Removing or reconnecting

Distrobox::

distrobox stop vps-dev
distrobox rm vps-dev

Docker:

docker stop vps-dev
docker rm vps-dev

Package-level setup

See individual package READMEs:

Documentation

Special mentions

Ofcourse, ChatGPT :)

Safety & Ethical Considerations

IMPORTANT DISCLAIMER: This software is provided for research and educational applications only. The developers and contributors of this project doesn't promote and are not responsible for any misuse.

License

See LICENSE file.

About

Global vision positioning system for UAVs in outdoor GNSS-denied environments

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors