Skip to content

Commit

Permalink
Merge pull request #4 from urastogi885/Phase3
Browse files Browse the repository at this point in the history
Reviewed and checked for final submission.
  • Loading branch information
namangupta98 authored Dec 9, 2019
2 parents b365b44 + 2d70678 commit 24229a4
Show file tree
Hide file tree
Showing 203 changed files with 4,927 additions and 518 deletions.
15 changes: 6 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,18 @@ before_install:
- sudo sh -c "echo \"deb http://packages.ros.org/ros/ubuntu $ROS_CI_DESKTOP main\" > /etc/apt/sources.list.d/ros-latest.list"
- sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
- sudo apt-get update -qq
- sudo apt-get install dpkg
- sudo apt-get install -y --allow-unauthenticated python-catkin-pkg python-rosdep python-wstool
# Add opencv support in ROS
#- sudo apt-get install libopencv-dev
# install lcov to generate code coverage data
- sudo apt-get install -y lcov
- sudo apt-get install dpkg lcov
# Install ROS-Base: (Bare Bones) ROS package, build, and communication libraries. No GUI tools.
- sudo apt-get install -y --allow-unauthenticated python-catkin-pkg python-rosdep python-wstool ros-$ROS_DISTRO-ros-base
# Needed to install coveralls-lcov to upload coverage information generated by LCOV to coveralls.io
- gem install coveralls-lcov
# Install ROS-Base: (Bare Bones) ROS package, build, and communication libraries. No GUI tools.
- sudo apt-get install -y --allow-unauthenticated ros-$ROS_DISTRO-ros-base
# Install package dependencies
- sudo apt-get install -y --allow-unauthenticated ros-$ROS_DISTRO-move-base ros-$ROS_DISTRO-geometry-msgs ros-$ROS_DISTRO-sensor-msgs ros-$ROS_DISTRO-cv-bridge ros-$ROS_DISTRO-image-transport
# Source ros kinetic setup file
- source /opt/ros/$ROS_DISTRO/setup.bash
# Prepare rosdep to install dependencies.
- sudo rosdep init
- rosdep update
# Install


# Create a catkin workspace with the package under integration.
Expand Down
30 changes: 19 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ project(supermarket_cleaning_robot)
add_compile_options(-std=c++11)

## Find catkin and any catkin packages
find_package(OpenCV 2 REQUIRED)
find_package(OpenCV REQUIRED)

find_package(
catkin REQUIRED COMPONENTS
Expand All @@ -28,31 +28,39 @@ include_directories(
)

## Add executables
add_executable(supermarket_cleaning_robot src/turtlebot.cpp src/obstacle_avoidance.cpp)
add_executable(object_collection src/turtlebot.cpp src/obstacle_avoidance.cpp src/navigator.cpp)

add_executable(detector src/object_detection.cpp src/detector.cpp)

## Add target link libraries
## target_link_libraries(supermarket_cleaning_robot ${catkin_LIBRARIES}${OpenCV_INCLUDE_DIRS})
target_link_libraries(object_collection ${catkin_LIBRARIES} ${OpenCV_LIBS})
target_link_libraries(detector ${catkin_LIBRARIES} ${OpenCV_LIBS})

## Enable catkin test and add files for the same
if(CATKIN_ENABLE_TESTING)
set(CMAKE_BUILD_TYPE Debug)
find_package(rostest REQUIRED)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 --coverage")

add_rostest_gtest(
test_project_x_robot
test/main.cpp
test/obstacle_avoidance_test.cpp
test/turtlebot_test.cpp
src/turtlebot.cpp
src/obstacle_avoidance.cpp)
test/project_x_test.launch
test/main.cpp
test/obstacle_avoidance_test.cpp
test/turtlebot_test.cpp
test/object_detection_test.cpp
src/obstacle_avoidance.cpp
src/turtlebot.cpp
src/object_detection.cpp)

target_link_libraries(
test_supermarket_cleaning_robot
test_project_x_robot
${catkin_LIBRARIES}
${OpenCV_LIBS})

add_dependencies(
supermarket_cleaning_robot
test_project_x_robot
test_project_x_robot
object_collection
detector
${catkin_EXPORTED_TARGETS})
endif()
2 changes: 1 addition & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ PROJECT_LOGO =
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.

OUTPUT_DIRECTORY = DOXYGEN/
OUTPUT_DIRECTORY = docs/

# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
# directories (in 2 levels) under the output directory of each output format and
Expand Down
42 changes: 24 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ items.

For prototyping, we are focusing on only one task that is identifying and collecting the items using the
robot. The robot will roam in a supermarket like environment in Gazebo and identify the type of items
that it needs to collect. It identifies the item using a camera, mounted on its base, and moves towards the
that it needs to collect. It identifies the item using a camera and HSV Color Detection algorithm, mounted on its base, and moves towards the
fallen item. Here, we are considering objects such as food, soft drinks cans and it is assumed that the robot
will already know the type of item that it needs to pick. As the robot reaches the location of the item and
touches it, the item will vanish depicting that the item is collected using a suction cup. The robot will
Expand All @@ -31,7 +31,7 @@ has an obstacle avoidance feature that is used to prevent the robot from collidi
humans, uninteresting items and walls/shelves.

<p align="center">
<img src="https://github.com/urastogi885/Supermarket-Cleaning-Robot/blob/master/data/readme_images/initial_proposal_setup.png">
<img src="https://github.com/urastogi885/Supermarket-Cleaning-Robot/blob/master/data/readme_images/supermarket_world.jpg">
<b>Figure 1 - Robot approaching towards the cans lying on the ground to collect them</b>
</p>

Expand All @@ -51,13 +51,13 @@ to access our Sprint notes document.
## Accessing the UML Diagrams

- Open the *UML* directory of the project.
- Access UML diagrams from the *initial* folder located within *UML* sub-directory.
- Access UML diagrams from *uml* sub-directory.

## API Documentations

- [Gazebo Population Tag](http://gazebosim.org/tutorials?tut=model_population&cat=build_world)
- [cv_bridge](http://wiki.ros.org/cv_bridge/Tutorials/UsingCvBridgeToConvertBetweenROSImagesAndOpenCVImages)
- [Template Matching](https://docs.opencv.org/master/de/da9/tutorial_template_matching.html)
- [HSV Color Detection](https://docs.opencv.org/trunk/df/d9d/tutorial_py_colorspaces.html)

## Dependencies

Expand All @@ -76,43 +76,41 @@ to access our Sprint notes document.
the following [*link*](http://gazebosim.org/tutorials?tut=install_ubuntu&cat=install) to just install *Gazebo* on your
machine.
- Ensure successful installation by running *Gazebo* via your terminal window:
```shell script
```
gazebo
```
- An empty window of *Gazebo Simulator* should be launched.
- Make sure that turtlebot packages have been installed on your machine using the following commands:
```shell script
```
roslaunch turtlebot_gazebo turtlebot_world.launch
```
- A window of *Gazebo Simulator* with various items and a turtlebot should be launched.
- If an error pops up upo launching the turtlebot world, then install the necessary turtlebot packages:
```shell script
```
sudo apt install ros-kinetic-turtlebot-gazebo ros-kinetic-turtlebot-apps ros-kinetic-turtlebot-rviz-launchers
```
- Create your ROS workspace by following instructions on the [*create ROS workspace tutortial page*](http://wiki.ros.org/catkin/Tutorials/create_a_workspace).

## Known Bugs and Issues

This project is under-development. Currently, we are facing build issues. Sorry for the inconvenience.
Right now we are facing the object collection issue, where our idea is to remove the object from the world as the robot reached the object. The can should be vanished representing that the can is collected by the robot.

## Build

- ***Ignore this section*** as nothing to be built has been added yet.
- Even if you run the following, it will not impact your existing workspace.
- Switch to your *src* sub-directory of your ROS workspace to clone this repository.
```shell script
Switch to your *src* sub-directory of your ROS workspace to clone this repository.
```
<ROS Workspace>/src
```
- Run the following commands to clone and build this project:
```shell script
git clone --recursive https://github.com/urastogi885/obstacle_avoidance_simulation
```
git clone --recursive https://github.com/urastogi885/Supermarket-Cleaning-Robot
cd ..
catkin_make
```

## Test

Close and terminate everything including rosmaster. In a new terminal, switch to the ROS workspace and build the tests. Type
Close and terminate everything including rosmaster. In a new terminal, switch to the ROS workspace and build the tests. Type

```
cd catkin_ws
Expand All @@ -127,7 +125,7 @@ Now, we use launch file to run. In a new terminal, type
```
cd catkin_ws
source devel/setup.bash
roslaunch supermarket_cleaning_robot launcher.launch
roslaunch supermarket_cleaning_robot object_collection.launch
```

## Doxygen
Expand All @@ -140,7 +138,7 @@ sudo apt-get install doxygen
Now from the cloned directory run:

```
doxygen doxygen
doxygen Doxyfile
```

Generated doxygen files are in html format and you can find them in ./docs folder. With the following command
Expand All @@ -151,4 +149,12 @@ firefox docs/html/index.html

## Demo

We will update in the next phase by next week.
In this demo, the turtlebot is our cleaner robot which traverses in the supermarket environment and keeps on scanning for the cans. As the can is detected, a bounding box is created and then the turtlebot apprached towards the can to collect it.
<p align="center">
<img src="https://github.com/urastogi885/Supermarket-Cleaning-Robot/blob/master/data/readme_images/demo.gif">
<b>Figure 2 - Demo of Robot scanning and detecting items</b>
</p>

## Presentation

Click on the link to preview [presentation](https://docs.google.com/presentation/d/1KiABS_kfmvH2YfD9WYNnicjoehHe6gC2hseT8R00nM4/edit#slide=id.g6c2dd6b921_0_107)
Binary file added data/readme_images/demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed data/readme_images/initial_proposal_setup.jpg
Binary file not shown.
Binary file added data/readme_images/supermarket_world.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 13 additions & 5 deletions data/results/cppcheck_results
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
Checking src/detector.cpp...
1/9 files checked 7% done
Checking src/navigator.cpp...
2/9 files checked 14% done
Checking src/object_detection.cpp...
3/9 files checked 30% done
Checking src/obstacle_avoidance.cpp...
1/5 files checked 26% done
4/9 files checked 43% done
Checking src/turtlebot.cpp...
2/5 files checked 52% done
5/9 files checked 61% done
Checking test/main.cpp...
3/5 files checked 66% done
6/9 files checked 68% done
Checking test/object_detection_test.cpp...
7/9 files checked 81% done
Checking test/obstacle_avoidance_test.cpp...
4/5 files checked 82% done
8/9 files checked 90% done
Checking test/turtlebot_test.cpp...
5/5 files checked 100% done
9/9 files checked 100% done
16 changes: 15 additions & 1 deletion data/results/cpplint_results
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
Done processing ./src/detector.cpp
./src/turtlebot.cpp:141: Use operator && instead of and [readability/alt_tokens] [2]
Done processing ./src/turtlebot.cpp
Done processing ./src/object_detection.cpp
Done processing ./src/obstacle_avoidance.cpp
Done processing ./src/navigator.cpp
Done processing ./test/turtlebot_test.cpp
./test/object_detection_test.cpp:78: Tab found; better to use spaces [whitespace/tab] [1]
./test/object_detection_test.cpp:79: Tab found; better to use spaces [whitespace/tab] [1]
./test/object_detection_test.cpp:80: Tab found; better to use spaces [whitespace/tab] [1]
./test/object_detection_test.cpp:81: Tab found; better to use spaces [whitespace/tab] [1]
./test/object_detection_test.cpp:82: Tab found; better to use spaces [whitespace/tab] [1]
./test/object_detection_test.cpp:94: Tab found; better to use spaces [whitespace/tab] [1]
./test/object_detection_test.cpp:95: Tab found; better to use spaces [whitespace/tab] [1]
Done processing ./test/object_detection_test.cpp
Done processing ./test/main.cpp
Done processing ./test/obstacle_avoidance_test.cpp
Done processing ./include/object_detection/object_detection.h
./include/turtlebot/turtlebot.h:121: Is this a non-const reference? If so, make const or use a pointer: ObstacleAvoidance& obstacleAvoidance [runtime/references] [2]
Done processing ./include/turtlebot/turtlebot.h
Done processing ./include/obstacle_avoidance/obstacle_avoidance.h
Done processing ./include/obstacle_avoidance/obstacle_avoidance.h
Total errors found: 9
Binary file removed data/uml/revised/uml_class_diagram.pdf
Binary file not shown.
Loading

0 comments on commit 24229a4

Please sign in to comment.