Skip to content

luca-software-developer/autonomous-rover-navigation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

autonomous-rover-navigator

Autonomous Rover Navigation

Version: 1.0.0 License: MIT Python: 3.10+

A 2D autonomous rover navigation simulator in Python. The rover builds an occupancy map incrementally from LIDAR scans and plans paths using Optimistic A*, with frontier-based exploration as fallback.

Features

  • Randomized occupancy grid with configurable obstacle density
  • Simulated LIDAR sensor with configurable range (Manhattan footprint)
  • Optimistic A*: unknown cells assumed free, replans on obstacle discovery
  • Frontier-based exploration fallback when goal is not yet reachable
  • Reachability check before navigation — handles unreachable goals gracefully
  • Step-by-step animated visualization with dual obstacle layer and mode coloring

Requirements

  • Python 3.10+
  • numpy
  • matplotlib

Install

pip install numpy matplotlib

Usage

python main.py

Options

Flag Default Description
--width 20 Grid width
--height 20 Grid height
--obstacles 0.25 Obstacle density (0.0–1.0)
--seed None Random seed for reproducibility
--sensor-radius 4 LIDAR range in cells
--interval 120 Animation frame interval (ms)

Examples

# Default 20×20 grid
python main.py

# Larger grid, denser obstacles
python main.py --width 30 --height 30 --obstacles 0.3

# Reproducible run
python main.py --seed 42

# Smaller sensor range, slower animation
python main.py --sensor-radius 2 --interval 200

Navigation strategy

The rover uses Optimistic A*: unknown cells are treated as free when planning, so the rover heads directly toward the goal and only replans when an obstacle is discovered on the current path. If the goal is unreachable on the known map, it falls back to frontier exploration — navigating to the nearest boundary between known and unknown space to expand its map.

The path cost function is f(n) = g(n) + h(n), where g(n) is the number of steps from start and h(n) is the Manhattan distance to the goal.

Visualization

Color Meaning
🔴 Red Rover
🟢 Green Trail — heading to goal
🟠 Orange Trail — frontier exploration
🔵 Light blue Sensor FOV
🟣 Purple Frontier cells
⬛ Dark Detected obstacle
⬜ Medium gray Hidden obstacle (hint)
Light gray Unknown cell

License

This project is licensed under the MIT License. See the LICENSE file for full details.

About

2D autonomous rover navigation simulator in Python. Implements Optimistic A* with online replanning and frontier-based exploration on an incrementally built occupancy map from simulated LIDAR scans.

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages