Inspiration

Pool is a really hard game for AI to learn, due to both the strategic search space and semi-chaotic physical outcomes. It's also a fun robotic challenge.

What it does

The robot attempts to play Bar Billiards by hitting marbles with a cue on a table of our own making (1:3 scale approximately). To do this, it identifies the balls in an overhead webcam feed using OpenCV, transforms their location in pixels to position in millimeters using four fiducials at the corners of the playing table, and performs inverse kinematics to correctly position the queue for the strike. The queue is positioned using a pair of stepper motors (one for belt driven translation along the table base, another for rotation) and performs the strike using a solenoid.

How we built it

We manufactured the chassis with hand tools (a drill and a jab saw) and wrote the code in Python and C++ in the Arduino framework (using PyCharm and CLion with PlatformIO respectively).

Challenges we ran into

Turns out, it's really hard and time intensive to manufacture a large piece of hardware with only two tools, and no workbenches. We missed the blessings of proper power/machine tools and CNC milling/lasercutting. We also didn't have a reliable power supply, which meant the microcontroller would occasionally restart if the stepper motors pulled more current than we could provide, which happened often as the translational assembly rode on a pair of dowel rods instead of proper linear guides.

Accomplishments that we're proud of

We got it largely to work! It find the marbles and hits them pretty hard.

What we learned

Experiencing the sheer amount of time machine tools save was somewhat shocking, as we spent hours just cutting out the pieces for the playing board by hand from our particleboard stock. As a result of this and CV taking longer than expected, we had very little time for developing the actual AI side of the hack, and so the current strategy of the robot is to just hit the marble in the general direction of the target pockets.

Built With

Share this project:

Updates