Indushekhar / pioneer

Pioneer : Exploratory Robot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pioneer

Pioneer : Exploratory Robot

License: MIT Build Status Coverage Status

Project Overview

The objective of this project is to design a software stack which will enable the Turtlebot2 robot to explore an unknown environment autonomously. After exploration, it will also generate an occupancy grid map. The robot will demonstrate robust obstacle avoidance with some added feature such as visual feedback from onboard camera, velocity control, Image capture option and start/stop control. All the code though will be tested on Gazebo simulations.

This product can be very useful in the exploration of a disaster area and provide aid in rescue effort by locating victims, delivering medical aids etc. The addition features will be also very helpful in these operations. For example, the user can slow down the robot if he found something useful (say injured human being) from the camera feedback and then deliver the aid. Other application could be hazardous area (say radioactive radiation, poisonous gas exposed area etc) exploration where human access has very high risk involved. It can also be used for generating the occupancy map which can be used for indoor navigation purposes.

Test Image 1

About the Developers

I am Indushekhar Singh. I am currently pursing Masters in Robotics at University of Maryland - College Park. I hold a Bachelors degree in Electrial & Electronics Engineering from, NIT Jamshedpur India. Along with that I brings 3 years of work experience in the area of Industrial Automation. I am also comfortable working in MATLAB and Python. I have done few projects in these two languages too.

Sample output

The 2D map created from the system is shown below :

Test Image 2

Presentation

Presentation slides can be found here : link

Presentation video can be seen here : video link

Dependencies

To run the program you need to have the following dependencies on your system:

  1. Ubuntu (Xenial)

  2. ROS Kinetic Kame

  3. Gazebo 7.x (part of ros-kinetic-desktop-full package)

  4. Turtlebot simulation package

  5. Gmapping

  6. map_server

  7. image_view

To install ROS, follow the instructions on this link

Don't forget to setup the ROS environment by adding the following line in your .bashrc :

$ source /opt/ros/kinetic/setup.bash

To install the turtlebot packages, run the following after installing ROS Kinetic on your ubuntu 16.04.

sudo apt-get install ros-kinetic-turtlebot-*

To install gmapping, In a terminal run :

sudo apt-get install ros-kinetic-slam-gmapping

To install map_server, In a terminal run:

sudo apt-get install ros-kinetic-map-server

To install image_view, run :

sudo apt-get install ros-kinetic-image-view

Build Instructions

Following the environment setup, next step is to create the workspace.

$ cd <path where workspace needs to be created>
$ mkdir -p <name of workspace>
$ cd <workspace>
<workspace>$ catkin_make

Now, for building the main branch

<home>$ cd <workspace>/src
<workspace>/src$ git clone --recursive https://github.com/Indushekhar/pioneer
<workspace>/src$ cd ..
<workspace>$ catkin_make 

Just like the path of the ROS was sourced in .bashrc file, same needs to be done for the workspace by writing

source <path to workspace>/devel/setup.bash

in the .bashrc. This will avoid the needs of sourcing everytime we run the package.

Running the System demo

To run the system demo please follow the instruction given in this section. Open a terminal and launch a file using given below:

$ roslaunch pioneer pioneer.launch

The command given above will spwan the robot in a custom gazebo world and launch the rviz plugin. It will also start gmapping node which will be used to map the environment.

Now robot will start moving in the gazebo simulation.

Running the demo with image_view

If you want the see the camera feedback in real time, run the following launch file instead :

$ roslaunch pioneer pioneer_image_view.launch

This is will open a image_view window where you can see the real time camera feedback.

Saving the map

You can see the map created in real time in rviz window. Once the exploration is complete, run the following command to save the map :

<path where map is to be saved> $ rosrun map_server map_saver -f <map_name>

Services for the user

Along with the core exploration task, the system is capable of supporting additional user demands if required.

Image Capture Service

The user any time during the simulation can capture an image and save on their disk using captureImageService. To run the service run following command on a new terminal :

$ cd ~/catkin_ws/
$ source devel/setup.bash
$ rosservice call /captureImageService true

The files will get saved in ./ros folder. To view the files. In a new terminal:

gnome-open ~/.ros

If you do not have gnome-open installed. In a terminal run :

sudo apt install libgnome2-bin

Veclocity Change Service

User can any time incresese/decrease the linear velocity of the robot. To increase or decrease the velocity run following command on a new terminal :

$ cd ~/catkin_ws/
$ source devel/setup.bash
$ rosservice call /velocityChangeService <value>

for example , setting the velocity to 0.1 m/s, run :

rosservice call /velocityChangeService 0.1

Start/Stop Service

User can any time start/stop the robot in simulation using motionService. To stop the robot if already moving, run following command on a new terminal :

$ cd ~/catkin_ws/
$ source devel/setup.bash
$ rosservice call /motionService true

If the robot is in stop position, to move the robot , run following command on a new terminal :

$ cd ~/catkin_ws/
$ source devel/setup.bash
$ rosservice call /motionService false

Testing

The unit tests for this package can be ran using the following commands. After cloning the repository, navigate to the root of the workspace and run the following command:

$ catkin_make run_tests 

It can also be run by using launch file :

$ rostest pioneer pioneer_test.launch

Recording bag files

The data publsihed during the simulation can be recoreded in a bag file using the launch file by running the following command:

<home>$ roslaunch pioneer pioneer_image_view.launch record:=true

This will record data for 45 seconds of all the topic except /camera/* topics and save a bag file in the results folder of the package.

Playing back bag file

To inspect the bag file, In a new terminal:

$ cd ~/catkin_ws/
$ source devel/setup.bash
$ cd src/pioneer/results
$ rosbag info pioneer.bag

To replay the bag file, first run rosmaster from a terminal:

roscore

Now, from the results folder run the following command in a new terminal:

cd ~/catkin_ws/
source devel/setup.bash
cd src/pioneer/results
rosbag play pioneer.bag

Solo Iterative Process and Sprint Planning

While developing this module SIP process was followed. The link to the SIP sheet for this module is here.

https://docs.google.com/spreadsheets/d/1h1utyFEapiUcafLp1L-bTxqeRQMaXjP8P0F8vSe2olY/edit?usp=sharing

Sprint planning notes can be found here.

https://docs.google.com/document/d/1AY8NstnOtWDZ6wul_0_c_aTAbeUBaYTrImGRCwSZni4/edit?usp=sharing

Documentation

The documentation for this project can be found at the path docs/html/index.html. The documentation for this project is created using doxygen-gui. To generate the documentation again, please execute the commands given below:

$ sudo apt-get install doxygen 
$ sudo apt-get install doxygen-gui
$ doxywizard

The last command opens up the GUI window of doxygen. First select a dummy folder for doxygen to run from. After that, complete the details as required like name, synopsis, and version of the project. Select this repository as source directory and select a destination directory as well. Please make sure you check scan recursively option in order to generate the complete documentation. Once doxygen runs successfully, navigate to your destination directory, go to html folder and open index.html file.

Known Issues

  1. The code coverage is not 100%.

  2. Though the system works fine with the map chosen here for demo, but in case of larger map it might be ineffcient to use this package.

License

MIT License

Copyright (c) 2018 Indushekhar Singh

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Pioneer : Exploratory Robot

License:MIT License


Languages

Language:C++ 96.4%Language:CMake 3.6%