Skip to content

This repository try to perform move_base using random goal and free move using turtlebot3

License

Notifications You must be signed in to change notification settings

labiybafakh/turtlebot3_obstacle_avoidance

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

turtlebot3_obstacle_avoidance

Introduction

This simulation is based on turtlebot3 website. This simulation will keep moving by generating random position and orientation. To avoid unreachable area, a checking method is used. It will check whether the goal position is free or not. This robot will also go to the next step if the robot does not reach the desire position in 30s. It can also prevent the robot to do an undefined behavior.

Prequisition

1. ROS

  1. ros-noetic-dekstop installed.
  2. Install some packages required below
sudo apt-get install ros-noetic-gazebo-ros ros-noetic-gazebo-plugins ros-noetic-move-base-* ros-noetic-actionlib-* ros-noetic-gazebo-ros-pkgs ros-noetic-gazebo-ros-control ros-noetic-dwa-local-planner ros-noetic-slam-karto ros-noetic-map-server ros-noetic-amcl python3-catkin-tools

2. Clone repositories.

  1. Clone repository
cd ~
mkdir -p noetic_ws/src && cd noetic_ws/src
git clone https://github.com/labiybafakh/turtlebot3_obstacle_avoidance
  1. Get turtlebot3 packages to run this reposity, but if it has been installed on system, you can skip it. If vcstool has not been installed, please install it.
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt install curl # if you haven't already installed curl
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install python3-vcstool
cd turtlebot3_obstacle_avoidance
vcs import . < turtlebot3.repos

Build and Run

1. Build

cd ~/noetic_ws/
catkin build
source devel/setup.bash

2. Run

1. Creating Map.

to create the map using slam-karto, it can be done by run create_map.launch file.

export TURTLEBOT3_MODEL=burger
roslaunch obstacle_avoidance creating_map.launch

Run turtlebot3_teleop to move the robot by using turtlebot3_teleop_key.launch.

source devel/setup.bash
export TURTLEBOT3_MODEL=burger
roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch

after the whole area has been mapped, teleop can be terminated and save the map by run another launch file.

source devel/setup.bash
roslaunch obstacle_avoidance map_saver.launch

Another shortcut, it also can be also done by changing the path inside the map.yaml file.

image: /home/toys/noetic_ws/src/turtlebot3_obstacle_avoidance/obstacle_avoidance/maps/map.pgm

2. Run simulation environment.

Make sure that it can be ran like the video below by using 2D Nav Goal tool in RViz. If it is ok, it is better to re-run the launch file, but it also ok to go to the next step.

export TURTLEBOT3_MODEL=burger
source devel/setup.bash
roslaunch obstacle_avoidance simulation.launch
nav-rviz.mp4

2. Run the node to publish random position and keep moving.

It should be run in different terminal.

export TURTLEBOT3_MODEL=burger
source devel/setup.bash
rosrun obstacle_avoidance obastacle_avoidance
obstalce-avoidance-with-free-move.mp4

About

This repository try to perform move_base using random goal and free move using turtlebot3

Resources

License

Stars

Watchers

Forks

Packages

No packages published