geoffrey-anto / drones-attention-based-lstm-deep-q-network-rpp

A Realtime Path Planning AIRSIM Simulation Using Deep Q Learning With Attention Based LSTM
MIT License
2 stars 0 forks source link

MOAAPP - Multi-Objective Attention-Based Adaptive Path Planner (UAV Path Planning) 🚀

This project implements a UAV path planning system using Deep Q-Learning (DQN) combined with LSTM and Attention mechanisms for reinforcement learning. It leverages the AirSim simulation environment to enhance the UAV's ability to navigate in complex, obstacle-rich environments, optimizing multiple objectives like path length, safety, and energy efficiency.

Key Features

Project Structure

project_root/
│
├── src/
│   ├── lstm_model.py           # LSTM with Attention and DQN for path planning
│   ├── airsim_integration.py   # Integration with AirSim for UAV control
│   ├── data_generation.py      # Generates training data (optional)
│   ├── mission_planner.py      # Collects user input for mission planning
│   ├── simulation.py           # Simulation setup and execution
│   └── safety_checker.py       # Monitors collisions and handles obstacle avoidance
│
├── config/
│   └── config.py               # Configuration settings for the project
│
├── main.py                     # Main script to run the UAV system
├── requirements.txt            # Python dependencies
└── README.md                   # Project information and setup instructions

Installation

  1. Clone the repository:

    git clone https://github.com/saswatakumardash/MOAAPP-PathPlanner.git
    cd MOAAPP-PathPlanner
  2. Install dependencies: Install the required Python packages by running:

    pip install -r requirements.txt
  3. Set up AirSim:

Running the Project

Step 1: Prepare your AirSim environment

Ensure your AirSim environment is properly configured and running.

Step 2: Run the main script

Execute the following command to start the system:

python main.py

Step 3: Mission planning

You will be prompted to input the takeoff location, waypoints, and landing location during the mission planning phase.

Step 4: Observe the simulation

Watch the UAV navigate through the environment while avoiding obstacles and completing the mission.

Configuration

You can modify the project settings in config/config.py to adjust simulation parameters:

Deep Q-Learning (DQN) Integration

The core of this project uses Deep Q-Learning (DQN), which enables the UAV to learn an optimal path by interacting with the environment:

Model Architecture:

  1. LSTM + Attention:

    • The model first processes sequential state data with LSTM layers and a dynamic attention mechanism to focus on relevant environmental features.
    • The output of the LSTM-attention network is fed into a Dense layer representing Q-values for possible actions.
  2. DQN Logic:

    • The agent learns the optimal path by predicting Q-values and updating them through the Q-learning update rule: [ Q(s, a) \leftarrow r + \gamma \max(Q(s', a')) ]
    • Where r is the reward, \gamma is the discount factor, s is the state, and a is the action.

Future Enhancements

Authors


This project is a part of ongoing research in adaptive UAV navigation using reinforcement learning, aiming to improve the adaptability and efficiency of UAVs in complex environments.