Code Monkey home page Code Monkey logo

naoqi-opencv-tictactoe's Introduction

Tic Tac Toe running on Pepper

Application for playing Tic Tac Toe against Pepper with simple game logic, computer vision and human-robot interaction components. The included Dockerfile allows to run everything in a pre-built container without the need to install Python2.7, NaoQi 2.5 and OpenCV 3.4. The environment variables PEPPER_IP and PEPPER_PW should be changed. This repository has been created for a workshop at the 37th Bundeswettbewerb Informatik BWINF.

Requirements

The following software must be installed beforehand:

  • Docker Engine >= v16 (current version v18.09 recommended)
    • An installation guide for any operating system can be found on the Docker Docs

Prepare Pepper

$ ssh nao@[PEPPER_IP]
# nao stop
# naoqi-bin --disable-life

Play TicTacToe

  1. Print or Draw a black Tic Tac Toe field with rather thick edges
  2. Place Pepper at roughly 40cm distance in front of the field
  3. Launch web server to host the game field that is retrieved by Peppers tablet
  4. Launch VNC and see if field is clearly visible by Peppers camera
  5. (Launch image server to see debug CV images)
  6. Launch game

Development Guide

So that we can start programming, we first need the version control software Git. An installation guide can be found here.

Clone the repository naoqi-opencv-tictactoe with

git clone https://github.com/kw90/naoqi-opencv-tictactoe.git

and navigate into the folder

cd naoqi-opencv-tictactoe

Inside this folder the container can be built using

docker build -t naoqi-opencv-tictactoe:latest .

This will pull the Docker image from the Docker Hub, copy the TicTacToe folder and sets the command python Main.py as the Launch order.

Then the container can be started by running,

docker run -it --network host naoqi-opencv-tictactoe:latest

which runs the Python Main.py program on the specified Pepper in the Dockerfile.

To run a different program inside the container, it can be specified after the container image description

docker run -it --network host naoqi-opencv-tictactoe:latest python DetectBoard.py

If something has been modified in the TicTacToe application, you can simply use the two commands

docker build -t naoqi-opencv-tictactoe:latest .
docker run -it --network host naoqi-opencv-tictactoe:latest

to rebuild and rerun the container.

More convenient way

For more convenient development, the source directory TicTacToe can be mounted inside the container and started with a simple shell as entrypoint

docker run -it -v `pwd`/TicTacToe:/naoqi/src/tic-tac-toe --entrypoint /bin/sh --network host naoqi-opencv-tictactoe:latest

This method allows to modify files on the Host machine using a preferred text editor and run them inside the container by running the Python program on the Docker shell, e.g. simply

python Main.py

naoqi-opencv-tictactoe's People

Contributors

kw90 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.