micronav
Lightweight autonomous navigation library — anywhere Python runs.
Overview
micronav is a minimalist Python library for autonomous navigation tasks:
- Waypoint navigation with Haversine distance and bearing
- PID controller for heading and speed
- Geofencing — virtual boundary enforcement
- Zero dependencies — only Python standard library
- Runs anywhere — laptop, Raspberry Pi, Docker, Android/Termux
Installation
pip install micronav
Or from source:
```bash
git clone https://github.com/Orion-smith25/micronav.git
cd micronav
pip install -e .
Quick Start
from micronav import WaypointNavigator, PIDController, Geofence
waypoints = [
{"lat": -6.175, "lon": 106.827},
{"lat": -6.125, "lon": 106.655},
]
nav = WaypointNavigator(waypoints)
current = {"lat": -6.175, "lon": 106.827}
print(f"Distance: {nav.distance_to(current):.1f}m")
print(f"Bearing: {nav.bearing_to(current):.1f}deg")
pid = PIDController(kp=1.0, ki=0.1, kd=0.05)
correction = pid.update(target=90.0, current=45.0)
print(f"PID correction: {correction:.1f}")
fence = Geofence(center_lat=-6.175, center_lon=106.827, radius=500)
print(f"Inside geofence: {fence.is_inside(current)}")
Docker
docker build -t micronav .
docker run -it micronav python3 examples/basic_navigation.py
Modules
Module Description waypoint Waypoint management, Haversine distance, bearing pid PID controller for heading and speed geofence Circular geofence boundary enforcement utils Coordinate conversion, angle normalization
Platform Support
Platform Status Linux (x86_64) Full macOS Full Windows Full Raspberry Pi Full Termux (Android) Full Docker Full
Related Projects
· open-nav-core · maritime-vessel-design
License
MIT License — see LICENSE
Maintained by the Maritime Autonomy Lab.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters