Skip to content

SirErico/RRT_pathPlan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Implementation of 2D Motion Planning on an Occupancy Map using RRT Algorithm with Gradient-Based Sampling Guided by Neural Network

Repository Overview

This project implements a Rapidly-exploring Random Tree (RRT) algorithm enhanced with neural network-guided sampling for path planning in 2D environments.

Prerequisites

  1. ROS 2 (tested on Humble) with required ros2 packages
  2. Python 3.10
  3. Required Python packages (requirements.txt):

🛠 Steps to Take

  1. Install the required ROS2 packages:
sudo apt-get install ros-humble-nav2-map-server ros-humble-nav2-lifecycle-manager
  1. Create ROS 2 workspace:
mkdir -p ros2_ws/src
cd ros2_ws/src
  1. Clone the repository:
git clone https://github.com/SirErico/Projekt_MiAPR
  1. Before building, create a venv
cd ..
python3 -m venv venv
  1. Install the Python dependencies from requirements.txt:
pip install -r requirements.txt
  1. Add 'COLCON_IGNORE' file to your venv folder
touch ~/venv/COLCON_IGNORE
  1. Source venv
source ~/path/to/venv/bin/activate
  1. Build and source workspace
colcon build
source /install/setup.bash

Usage

Training the Neural Network

  1. Generate training data:
python3 src/sample_map.py
  1. Train the neural network:
python3 src/neural_net.py

Running the RRT Algorithm

To run the RRT algorithm with the neural net model:

ros2 launch mapr_rrt rrt_ai_launch.py model_path:=/your/path/model.keras

Scripts:

  • map_blur.py: Applies a Gaussian blur to a map image.
  • sample_map.py: Samples data points from a map to create a dataset for training a neural network.
  • show_map.py: Visualization of the map .pgm and .csv file.
  • neural_net.py: Trains a neural network to learn occupancy probabilities from a map dataset.
  • show_model.py: Predicts occupancy for the entire map and visualizes the original and predicted occupancy maps.

⚠️ Known Problems

venv Packages Not Visible

If the virtual environment packages are not visible, add the following to your setup.cfg file:

[build]
executable=/usr/bin/env python3

About

RRT algorithm aided path planning

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages