Skip to content

Dheeraj-yellapu/Path-Creation-on-an-Image-Using-RRT-Algorithm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Path-Creation-on-an-Image-Using-RRT-Algorithm

This repository implements the RRT* (Rapidly-exploring Random Tree Star) algorithm for path planning in a 2D environment. The project integrates with ROS (Robot Operating System) and uses Turtlesim to visualize the planned path.

Features

  • RRT Algorithm*: Efficient path planning with obstacle avoidance.
  • Turtlesim Integration: Moves a turtle along the planned path in the Turtlesim simulator.
  • Image-based Environment: Reads start, goal, and obstacles from an input image.
  • Visualization: Displays the RRT* tree and the final path using OpenCV.

Project Structure

  • Image1.png and Image2.png: Sample images defining the environment. Green represents the start point, red represents the goal, and black represents obstacles.
  • move_turtle.py: ROS node to move the Turtlesim turtle along the planned path.
  • RRT_Star.py: Implements the RRT* algorithm and publishes the planned path.
  • turtle_rrt.launch: ROS launch file to start the Turtlesim node and the path planning nodes.

Prerequisites

  • ROS (Robot Operating System) installed on your system.
  • Python 3.x with the following libraries:
    • numpy
    • opencv-python
    • Pillow
  • Turtlesim package installed in ROS.

Setup and Usage

  1. Clone the Repository:
    git clone https://github.com/Dheeraj-yellapu/Path-Creation-on-an-Image-Using-RRT-Algorithm
  2. Prepare the Environment: Ensure ROS is sourced and the required Python libraries are installed:
    pip install numpy opencv-python Pillow
  3. Run the Launch File: Use the provided launch file to start the simulation:
    roslaunch turtle_rrt.launch
  4. Modify the Image: Update the image_path in RRT_Star.py to point to your custom environment image.
  5. Visualize the Path: The RRT* algorithm will display the tree and the final path in an OpenCV window. The turtle in Turtlesim will follow the planned path.

How It Works

  • Environment Setup: The environment is defined by an image where:

    Green pixel ([34, 177, 76]) represents the start point. Red pixel ([237, 28, 36]) represents the goal point. Black pixels ([0, 0, 0]) represent obstacles.

  • Path Planning: The RRT* algorithm generates a tree of possible paths and finds the optimal path to the goal while avoiding obstacles.

  • Path Execution: The planned path is published as a ROS topic (/rrt_star_path), and the move_turtle.py node subscribes to this topic to move the turtle.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages