A comprehensive toolkit for visualizing and comparing different path planning algorithms, including Dijkstra, ARA*, Dynamic Programming, TRRT*, and Neural Network approaches. This repository contains a Streamlit web application for interactive path planning and a path labeling tool for generating training data for neural network models.
- Interactive visualization of multiple path planning algorithms
- Real-time parameter adjustment and comparison
- Neural network-based path planning with pre-trained model
- Path labeling tool for generating training data
- Costmap upload and processing
-
Clone the repository:
git clone https://github.com/yourusername/path_planner_visualization.git cd path_planner_visualization -
Install the required dependencies:
pip install -r requirements.txt
The Streamlit app provides an interactive interface for visualizing and comparing different path planning algorithms.
cd Streamlit-app
streamlit run main.pyThis will start the Streamlit server and open the app in your default web browser.
-
Costmap Upload Center (Home Page)
- Upload a costmap image (grayscale or color)
- View costmap information and histogram
- The uploaded costmap will be available to all path planning algorithms
-
Path Planning Algorithms
- Navigate to different algorithms using the sidebar
- Available algorithms:
- Dijkstra Path Planner
- ARA* Path Planner
- Dynamic Programming Path Planner
- RRT* Path Planner
- Neural Network Path Planner
- Visualization (for comparing algorithms)
Each algorithm page follows a similar workflow:
-
Parameter Adjustment
- Set obstacle threshold (determines what pixel values are considered obstacles)
- Adjust obstacle padding (expands obstacles for safety)
- Configure algorithm-specific parameters
-
Point Selection
- Select start and end points using the coordinate grid
- Preview selected points on the costmap
-
Path Finding
- Click "Find Path" to run the algorithm
- View the resulting path overlaid on the costmap
- See computation time and path statistics
- Download path coordinates if needed
The Neural Network path planner uses a pre-trained U-Net model to predict paths. The model has been trained on costmaps and optimal paths generated using the path labeling tool.
The path labeling tool allows you to annotate costmap images with start and end points to generate training data for neural network models.
python path_label.py-
Configuration
- Before running, update the
costmap_dirandoutput_filepaths in themain()function - The tool will look for costmap images with names starting with "map_" and ending with ".png"
- Before running, update the
-
Labeling Process
- The tool displays costmap images one by one
- Click on the image to set points:
- First click: Set start point (green)
- Second click: Set end point (red)
- Third click: Reset points and set new start point
- Use navigation buttons:
- Previous: Go to the previous image
- Next: Go to the next image
- Save: Save all annotations to CSV
- Skip: Skip the current image without saving
-
Output
- Annotations are saved to a CSV file with columns:
- costmap: Image filename
- start_x/y: Start coordinates
- end_x/y: End coordinates
- This data can be used to train the neural network model
- Annotations are saved to a CSV file with columns: