Giter VIP home page Giter VIP logo

astar-algorithm-for-turtlebot-in-2d-and-3d-ros-gazebo's Introduction

Description

Implementation of A* algorithm on a differential drive (non-holonomic) TurtleBot robot. Navigate a differential drive robot (TurtleBot) in a given map environment from a given start point to a given goal point. Considered differential drive constraints while implementing the A* algorithm, with 8 set of action space. Checks the feasibility of all inputs/outputs (if user gives start and goal nodes that are in the obstacle space they will be informed by a message and they should try again). Code outputs an animation/video of optimal path generation between start and goal point on the map. It shows both the node exploration as well as the optimal path generated.

Dependencies

Plugin
heapq
numpy
cv2
math
queue
ast
sys
argv
time
argv
rospy
rospkg
Twist
Software
Python
ROS
Gazebo
Rviz

Part 1: 2D turtlebot

Clone or download the project repository and open the Part1 folder, Test case 1: Input start location as shown in below fashion, start_x_location,start_y_location,start_orientation space goal_x_location,goal_y_location space rpm1,rpm2,clearance Open terminal in the part1 folder and type below command:

python turtlebot_A_star.py -4,-4.5,0 4.25,2.75 30,25,5

or

python3 turtlebot_A_star.py -4,-4.5,0 4.25,2.75 30,25,5

Output Part1 testcase 1 visualization video: Test case 1. Optimal_path_testcase1

Test case 2: Input start location as shown in below fashion, start_x_location,start_y_location,start_orientation space goal_x_location,goal_y_location space rpm1,rpm2,clearance Open terminal in the part1 folder and type below command:

python turtlebot_A_star.py -4,1,0 4.25,2.75 30,25,5

or

python3 turtlebot_A_star.py -4,1,0 4.25,2.75 30,25,5

Output Part1 testcase 2 visualization video: Test case 2. Optimal_path_testcase2

Part 2: 3D turtlebot

Traverse to location containing proj3_ws. This is the workspace that contains all the files necessary to run A* for Turtlebot3 in ROS-Gazebo. Once inside proj3_ws, type the following commands to prepare the files for execution:

cd ~(your location)/proj3_ws/
catkin_make
source devel/setup.bash

If any errors pop up, caktin_make can be replaced by:

catkin_make -DPYTHON_EXECUTABLE=/usr/bin/python3

Traverse into the package proj3_gazebo and run the 2D A* Program to generate wheel velocities for 3D implementation:

cd src/proj3_gazebo
python3 turtlebot_A_star.py -4,-4.5,0 4.25,2.75 30,25,5

To create an executable for a_star_turtlebot_gazebo.py located in proj3_ws/src/proj3_gazebo/src/ , run the following command:

cd proj3_ws/src/proj3_gazebo/src/
chmod +x a_star_turtlebot_gazebo.py

To execute the launch file and view turtlebot in gazebo, run the following command:

roslaunch proj3_gazebo map.launch

If you wish to view output for different start_x_location,start_y_location,start_orientation, first generate the velocities by running turtlebot_A_star.py (as shown earlier) and change the following in the map.launch file located in proj3_ws/src/proj3_gazebo/launch/ in line 13,14,15:

13 <arg name="x_pos" default="(your start_x_location)"/>
14 <arg name="y_pos" default="(your start_y_location)"/>
15 <arg name="z_pos" default="(your start_orientation)"/>

NOTE: Be absolutely certain that the arguments entered while running the 2D implementation are the same as the values entered in the launch file. Output Optimal_path_testcase2

Video Output Part2 visualization video: Part2 video.

astar-algorithm-for-turtlebot-in-2d-and-3d-ros-gazebo's People

Contributors

roniepatil avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.