Package-Identification-using-Turtlebot
Robots have been used to improve efficiency in a various tasks in warehouses such as package handling, identification and organization. This project aims to simulate the use of Turtlebot in identifying packages with QR codes, in a warehouse setting.
ENPM 808X Final - Package-Identification-using-Turtlebot

Overview

Robots have been used to improve efficiency in a various tasks in warehouses such as package handling, identification and organization. This project aims to simulate the use of Turtlebot in identifying packages with QR codes, in a warehouse setting. The simulation is implemented in Gazebo. ROS packages such as gmapping, and teleop_twist_keyboard are used for mapping the environment in the simulation, while move_base is used for navigation.

Turtlebot navigating towards packages.

Our main focus in this project is QR-code decoding. Image stream from Turtlebot's simulated camera is subscribed and processed to obtain a clear front view of the QR code. The masking and encoding type of the QR code is detected, and it is unmasked to extract a bit stream, which is then coverted to a string. This resultant string is the package ID. Each package ID must have a valid prefix to ensure that appropriate packages have arrived at the warehouse. In our case we use "pack" as a valid prefix. Since there can be errors in odometry in the Turtlebot, it may not always reliably orient itself near the packages which results in a slanted perspective.To ensure that the package identification is robust to such odometry errors, we threshold and isolate the QR code first and then detect Harris corners. These corner points are then used to warp the perspective of the QR code. Only then the decoding is applyed to the image.

Decoding the QR code.

The scenario is that some new packages of unknown identities have arrived at the warehouse and are stored in a location allotted to "new arrivals". This location is generally known, along with the floor plan of the warehouse. The Turtlebot starts from another corner of the warehouse and moves towards the packages avoiding all "mapped" obstacles as well as "unmapped" obstacles (the dustbin in front of one of the packages is unmapped.) The Turtlebot then sequentially moves from one package to another identifying and storing the package IDs and locations from which each package can be accessed.

Moving to next package when current package is identified.

SIP

The product backlog, iteration log and time log sheets can be found here.

The sprint planning and review document can be viewed here.

Dependencies

This project is run on top of Ubuntu 16.04 with ROS Kinetic and Gazebo 7.14.

To install ROS Kinetic in Ubuntu 16.04, follow the steps given here. Catkin can be installed from here.

ROS packages such as move_base, actionlib, and gazebo_ros packages should be installed as:

1 sudo apt-get install ros-kinetic-move-base ros-kinetic-actionlib ros-kinetic-gazebo-ros

Turtlebot packages that are required can be installed as:

1 sudo apt-get install ros-kinetic-turtlebot-gazebo ros-kinetic-turtlebot-apps ros-kinetic-turtlebot-rviz-launchers

For the vision aspects of the project, we use OpenCV 3.3.1. It can be installed from here

Download

Before building the package, ensure that your catkin workspace is set up properly. In a new terminal, type the following commands:

1 mkdir -p ~/catkin_ws/src
2 cd ~/catkin_ws/
3 catkin_make
4 source devel/setup.bash

For more details follow the steps here

Download this repository inside src directory inside your catkin workspace.

1 cd ~/catkin_ws/src/
2 git clone https://github.com/Mayavan/Package_Identification_using_Turtlebot.git

Build

After cloning, you should see a package inside src. To build this package, when you're inside the src folder:

1 cd ..
2 catkin_make
3 source devel/setup.bash

Running Demo

To run a fullfledged demo of the Turtlebot in the warehouse setting identifying packages, give:

1 roslaunch package_identification_using_turtlebot demo.launch

In Gazebo, the Turtlebot spawns at (-3, -3) and starts navigating towards the packages. Once a goal is reached, ROS info messages will display the state if the identification (whether package is IDed or Turtlebot is waiting for proper identification). When the four packages are detected, the Turtlebot moves to the origin. The package IDs and their locations are then printed and code exits.

Additionally, the navigation, global and local costmaps can be viewed in Rviz.

1 roslaunch turtlebot_rviz_launchers view_navigation.launch

For additional information see here.

Turtlebot Rviz.

The code related to this demo can be found in the src, launch and include folders.

Test

To run the test cases, run:

1 rostest package_identification_using_turtlebot Qbot.test

All test cases in your catkin workspace can be run while compiling by:

1 catkin_make run_tests

This runs 12 test cases for various methods in the PathPlanner and QReader classes. The code for the tests can be found in the test folder.

Doxygen Documentation

To install Doxygen:

1 sudo apt-get install doxygen

To generate Doxygen documentation, run:

1 doxygen ./Doxygen

Known Issues and Bugs

License

1 Copyright (c) 2018, Mayavan, Adarsh Jagan Sathyamoorthy
2 
3 Redistribution and use in source and binary forms, with or without
4 modification, are permitted provided that the following conditions are
5 met:
6 
7 1. Redistributions of source code must retain the above copyright notice,
8 this list of conditions and the following disclaimer.
9 
10 2. Redistributions in binary form must reproduce the above copyright
11 notice, this list of conditions and the following disclaimer in the
12 documentation and/or other materials provided with the distribution.
13 
14 3. Neither the name of the copyright holder nor the names of its
15 contributors may be used to endorse or promote products derived from this
16 software without specific prior written permission.
17 
18 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
19 IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
20 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
22 CONTRIBUTORS BE
23 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
29 THE POSSIBILITY OF SUCH DAMAGE.

Authors