Close
0%
0%

Cueball: A Life-Sized Pool Playing Robot

In this project, a robot is being constructed from basic components that will be able to challenge human players to a game of pool.

Similar projects worth following
Many have asked "if this is a machine that plays pool - implying that it understands the physics of the game - then how can a human player expect to win against this robot?" Our response is that this robot does not use physics to play pool but rather logic, learned behaviors, and causality to play pool. In this project, we present an autonomous robot that is able to play pool against one other player (generally a human) in most any pool hall. The specific billiard game that it plays is known as "eight ball", which is the most common game played in the United States. The build logs should contain all of the details you will need on this project. If you have any questions or comments, please do not hesitate to leave us a note in the "comments section" below. We will respond as soon as possible. Thank you, and we hope that you enjoy our project!

Please note: the actual robot itself is designed to be reusable and is being designed and built so it can be easily repurposed.

Introduction

The main focus of this project is to utilize current Artificial Intelligence (AI) software packages and develop new agents for the purpose of engaging a human player in a game of pool. By the completion of the project, the robot will be able to: learn behaviors, identify targets, strategize, and make real-time decisions as to meet its objectives.

This details section will include a functional overview of the main robotics modules as described by the following graphic:

Communications Architecture (Comms) and Physical Network:

The comms infrastructure will operate on a wireless router/4-port ethernet switch (exact model TBA) and will be based in MOOS (Mission Oriented Operating Suite) which is a publish and subscribe infrastructure for C++ (native), Python (external package), and Java (external package). MOOS was originally designed for the communications architecture for autonomous marine robotics and is being repurposed for this project because of its flexibility and efficient functionality. Please see their website for more details: http://www.robots.ox.ac.uk/~mobile/MOOS/wiki/pmwiki.php

Gaming Agent:

The gaming agent is composed of two Artificial Neural Networks (ANNs) which will be used to decide on a move (shot) in the game of pool. Each shot is represented as both a set of vectors starting at the white ball (cueball) and a network of casual action-reaction parings which are generated using knowledge of the behavior of the system. System behavior is learned through inductive reasoning and sequential experimentation on an actual pool table.

Physics are left out of this section of the robot for the sole purpose of making the robot more "realistic" to play against. Generally, a human player does not understand the physics of the game; rather they understand that x action causes y reaction in the system. Our robot is designed to match this attribute of play.

An action is selected by a second ANN according to the utility formula:

(myBalls)(myScore) - (opponentBalls)(opponentScore) 

Error calculations (which are necessary for the weights) are performed according to:

ERROR = 1 - (P(A) + P(B)) = 1 - P(A or B) where P(A) = (n(Possible likely successes))/(n(Total available moves to "me")) and P(B) = (n(Possible likely successes for opponent))/(n(Total available moves to opponent))

Control Systems:

The robot will be controlled by means of an evolutionary algorithm (EA) control system which will be running on a Raspberry Pi. Specifically, all of the robots functions (such as moving a motor x number of radians in a certain direction) will be pre-programmed and placed in a library. The EA will be part of a weighted network which will be trained in how it is to call each of the functions and to what degree will they run. This will require the use of a Monte Carlo search tree combined with a genetic algorithm. An example of its use is, shooting a ball: it will already have all of the functions needed to shoot a ball but it must learn the order of those functions as well as the amount of force required to shoot the ball in a specific manner. Actual hardware actions will be carried out on the Arduino which is to be interfaced with the Pi.

Vision System:

Details on this system to be announced. Vision will be coded in Python 2.7.5+ with OpenCV.

Physical Robot:

The robot itself is being constructed from a mixture of VEX angles, plywood, PVC piping, and a few other eclectic parts.

Note on connected device:

An important note for the Hackaday Prize is "how is this project 'connected'?" Each software module runs on its own designated computational unit - whether that be Arduino, Raspberry Pi, or desktop, depends on the software itself - which are all networked together and communicating using PyMOOS which is MOOS (Mission Oriented Software Suite) for Python. MOOS operates using a publish and subscribe architecture.

System Diagram:

The above image describes how the robot system functions as a whole (ignoring the publish and subscribe system). Note:...

Read more »

  • 2 × Arduino Uno R3
  • 2 × Raspberry Pi Model B
  • 2 × Arduino Motor Shield R3
  • 2 × 2.5" Vex CIM Motor
  • 1 × Pool Table with game set Standard game equipment

View all 11 components

  • Code Repo Update

    VPugliese32303/22/2015 at 03:09 0 comments

    I have just been informed that Google Code is closing. As a result, the code will be moved and hosted from Github. I will update the link for the most recent version of the code as soon as I have ported and updated the repository and license.

  • Status Update: 10 March 2015

    VPugliese32303/10/2015 at 22:26 0 comments

    Over the last few months I have been working on new ways to detect objects in an image. I have recently created a software agent that applies bio-inspired search algorithms to identify subsets of images that contain contrast values of a pre-specified utility. The program works, and was written in Python, however it contains a major bug. Details will be released in the near future. Plans to release this agent will be delayed and are contingent upon the status of the bug(s). The idea of translating the software end of this project into a "crowd developed" project are under consideration.

    The majority of work is in research and development of this robot. Most of my efforts are in developing a novel game agent, and developing a highly functional object recognition suite.

  • Update: Vision

    VPugliese32311/07/2014 at 12:57 0 comments

    I just wanted to quickly let everyone know that this project is still in development. Things have been slow because of school responsibilities (finals for the current college semester are coming up in a few weeks). In the interest of finishing a major part of the project, a hard deadline has been set for the vision code. My current goal is to have it completed by December 20th of this year. After which I will begin the process of translating it from Python to C++/In-line NASM so that I can improve performance by working closer to the hardware level.

    Anyway, I just wanted to mention that this project has not ended, but rather has been delayed in development over a protracted period of time.

  • Screenshots: Vision

    VPugliese32310/03/2014 at 12:54 0 comments

    Here is a screenshot of the output of the edge (line and rectangle) detector which was mentioned in the last update. I took a screenshot because the output is a video feed.

    As one can see, it is detecting a majority of the rectangles (and some lines) on my shirt and on the railing beside me. The code for this was part of the old code that has been revised.

  • Vision Update #2

    VPugliese32309/22/2014 at 14:25 0 comments

    Last year, part of our work group began to code a vision program that targets retroreflective tape. While the program was never finished, we managed to detect and output a contrast map with lines (and their slopes) to the evaluator program (which is the part that was not constructed). Recently, we have been mixing the old vision program with the new circle detection program to detect both circles and rectangles in a field of view. While the evaluator is still being designed and coded, work is underway to finalize these vision programs. I will be posting screenshots of the program working when we are closer to finalizing the code. 

  • Vision Update

    VPugliese32309/10/2014 at 20:55 0 comments

    After performing several more tests with the current vision software, it is now ready to be converted from operating on sample images to a live video feed. Designs of the next update on vision will be posted here soon. On a related but different note, we have decided to use HSV for determining the color of the pool balls. More on HSV can be found here: http://en.wikipedia.org/wiki/HSL_and_HSV

  • Update: 8/26/14

    VPugliese32308/26/2014 at 16:16 0 comments

    Hello all, despite the fact that we have not been selected to continue in The HaD Prize, our team will still be working on this project. As we are interested in publicly showcasing this robot, we are currently discussing where to showcase the robot, and what changes will need to be made (if any) to showcase at the selected venue. We have also added a new team member recently, she will be working (for the most part) on constructing, testing, and maintaining the electronic control system.  I would also like to add that as we are students (some college, others high school) and the school year has started, actual work and postings will be drawn out over a protracted period of time. 

  • General Update: 8/20/14

    VPugliese32308/21/2014 at 00:34 0 comments

    Today the shift register needed for the control system has been shipped and received. In addition, work on the drivetrain has progressed significantly. The current focus is in strengthening it to hold the weight of the rest of the robot. The current drivetrain  (without gears) is pictured below:

  • Miscellaneous #2

    VPugliese32308/20/2014 at 13:23 0 comments

    I would like to add that the components required for the project are being updated as they are consumed (used in creating the robot). Also, for reference sake, the picture below is our original concept art for what the robot will look like (more or less - excusing poor drawing skills). 

  • Video Log 1

    VPugliese32308/19/2014 at 23:05 0 comments

    Here is our first video log:

    The image pictured in the video is of all of the subsystems of the robot and is there for reference sake.

View all 18 project logs

Enjoy this project?

Share

Discussions

VPugliese323 wrote 09/22/2014 at 14:28 point
Is there anyone who is familiar with SLAM (simultaneous localization and mapping) here? I would like to get their opinion on a good solution for mapping moving and immovable obstacles (tables and humans) in a pool hall. As it stands, the working plan is to have the robot stop when it encounters an obstacle. You can imagine the problems that arise from this though.

  Are you sure? yes | no

Adam Fabio wrote 06/09/2014 at 02:22 point
Thanks for submitting Cueball to The Hackaday Prize! An autonomous robot will be an awesome entry! Don't forget to upload some images and document your project as it progresses.

  Are you sure? yes | no

zakqwy wrote 06/05/2014 at 04:02 point
Looking forward to seeing the hardware! Great project!

  Are you sure? yes | no

VPugliese323 wrote 06/18/2014 at 03:23 point
Just a heads up, while there will be a large amount of work on the hardware side, the software side is our primary focus as both myself and my friend who is contributing are currently computer science students.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates