Overview

This project simulates a drone navigating autonomously in a 2D environment with static and dynamic obstacles. The drone uses a modified A* path planner to reach a target while avoiding collisions. The system is tested in real-time simulation using PX4 (SITL), Gazebo, and Dronekit.

High level arch

The simulation stack consists of:

Sensor data is used to map the environment to a 2D occupancy grid. Obstacles—both static and moving—are marked on this grid. The planner continuously checks for changes in the environment and recomputes the path as needed.

Sequence Diagram

Path Planning Logic

The drone uses a modified A* algorithm combined with a potential field-based cost function to improve obstacle avoidance.

Key ideas:

This results in paths that are not only collision-free but also avoid regions close to obstacles. The drone is effectively attracted to the goal and repelled by obstacles.

To handle dynamic obstacles, the cost function also considers their predicted motion. If a moving obstacle is expected to intersect the current path, the planner triggers a replan using updated grid data.

Simulation Results