Skip to content

A ROS (Robot Operating System) web interface to manage your robot online.

License

Notifications You must be signed in to change notification settings

mabdullahsoyturk/robot-box

Repository files navigation

Robot Box

Robot Box is a ROS Kinetic project that can be used to display the map of the environment, which Turtlebot placed, and the compressed camera view of the robot in any browser. Also, you can give a goal to the robot through map in the browser.

Screenshot

Pre-installation

LAMP

In order to setup the project to your local, LAMP must be installed in your computer. To do that you can follow DigitalOcean's LAMP Tutorial:

How To Install Linux, Apache, MySQL, PHP (LAMP) stack on Ubuntu 16.04

PHP Extensions

Following extensions should be installed in computer.

  • mbstring PHP extension
$ sudo apt-get install php7.0-mbstring
  • intl PHP extension
$ sudo apt-get install php7.0-intl
  • simplexml PHP extension
$ sudo apt-get install php7.0-xml

After installing these PHP extensions, don't forget to restart your Apache Server.

$ sudo service apache2 restart

Installation

Cloning the project

Clone the project under the "/var/www/html" folder.

$ cd /var/www/html
$ git clone https://github.com/mabdullahsoyturk/ui-for-warehouse-robot.git

Initializing the Composer

To initialize the project that uses composer you need to navigate to the root folder of that project an simply execute

$ composer install

This command will read the dependencies from the composer.json descriptor file and downloads them ready for you to use in your project.

If you get vendor does not exist and could not be created. error, your folder (var/www) probably is read-only or has not enough rights. For a quick fix, try chmod -R 777 /var/www, but dont use 777 in production!

URL Rewriting

UI For Warehouse Robot uses cakePhp framework which requires Apache mod rewrite to be enabled. You can follow CakePHP's URL Rewriting tutorial.

Connecting to Database

Import the SQL, which is ros_database.sql in the Database folder of the repository, into the your database.

Then you move to the config folder in the project folder and copy the app.default.php and paste into the same directory, change the name of it as app.php.

After that, open app.php, and change the 'my_app', 'secret' and 'my_app' fields by your own username, password and database.

...
'Datasources' => [
        'default' => [
            ...
            'username' => 'my_app',
            'password' => 'secret',
            'database' => 'my_app',
            ...
...

Project Structure

robot-box/
  .git             # Git source directory
  .github          # Issue templates
  bin/             # Command line scripts for CakePHP
  config/          # Database credentials, migrations, and other configuration
  database/        # SQL database files
  logs/            # Error,debug logs
  plugins/         # Currently an empty file since we do not use any plugins for now.
  src/             # PHP source code
      controllers/ # Controller classes
      models/      # Model classes
      views/       # Views
  tests/           # Unit tests
  tmp              # Temporary files such as sessions, cache etc.
  vendor/          # Composer files and 3rd party packages
  webroot/         # Publicly accessible files
      css/         # css files
      js/          # js files
      font/        # font files
      img/         # images
      index.php    # The Front Controller for handling every request
  .gitignore       # Files to be ignored in the repository
  composer.json    # Composer dependency file
  install.php      # Database installation script
  package.json     # npm dependency file
  README.md        # Brief documentation

Tutorial

Requirements

  • Robot must has a map server
  • Robot must has a camera
  • Robot must publish it's position through some topic.

This project has support only TurtleBot for now. Support for other robots will be added soon.

First of all, you need to launch the Gazebo in order to create a virtual environment for Turtlebot.

$ roslaunch turtlebot_gazebo turtlebot_world.launch

Building the Map

In order to create map of the virtual environment, you can follow the turtlebot_gazebo Make a map tutorial.

After you create your own map just run the following script.

$ roslaunch turtlebot_gazebo amcl_demo.launch map_file:=<full path to your map YAML file>

Or if you prefer to use an already created map, just omit the map_file argument.

Running Rviz

You need to launch the Rviz to be able to give goal to the robot.

$ roslaunch turtlebot_rviz_launchers view_navigation.launch

Controlling the Turtlebot with Keyboard Teleop

You can navigate the Turtlebot with pressing the u i o j k l m , . keys on your keyboard in the new terminal after run following script.

$ roslaunch turtlebot_teleop keyboard_teleop.launch

Running Rosbridge

You need to launch the rosbrige server to create a WebSocket on port 9090 by default.

$ roslaunch rosbridge_server rosbridge_websocket.launch

Now that rosbridge has been launched and a WebSocket connection is available, we can create a basic HTML webpage to send and receive calls to rosbridge. Roslibjs is a JavaScript library that handles the communication for you. Check out the getting started with roslibjs tutorial to create a webpage with roslibjs and rosbridge.

Usage

Now, everything is ready. Go to the our project in your browser. After Signup/Login, first of all, you need to create your message type.

For example, if you are using Turtlebot;

Message name = "nav_msgs/Odometry"
X paramater = "pose.pose.position.x"
Y paramater = "pose.pose.position.y"
Theta(Angle) paramater = "pose.pose.position.z"

Then you need to create your topic.

Topic = "/odom"
Mes = nav_msgs/Odometry (Select message that you've created before.)

After that you can create your robot.

IP address = Your IP address (If you are on localhost just "localhost".)
Port = 	9090 (Your port.)
Topic = /odom (Select topic that you've created before.)

After creating your robot, just tap the connect button. When you connect to the robot, you will see the map of the environment, which Turtlebot placed, positon information and the compressed camera view of the robot. Also you can give a goal to robot with clicking the destination point on the map. You can see the global path from robot the destination point.

Contributing

Ready to contribute to the project? That's great! Open an issue and send your pull request. You can find issue template and pull request template in the repo or send us an email and we will get back to you as soon as possible!

Muhammet Soytürk: [email protected]

Burak Usul: [email protected]

Muaz Ekici: [email protected]

Licence

MIT License

Copyright (c) 2018 Muhammet Soytürk, Hamdi Burak Usul, Mansur Muaz Ekici

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

A ROS (Robot Operating System) web interface to manage your robot online.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published