Chess Robot using BrickPi3 - with vision and sound

brickpi3

#1

(I’ve updated the link with an improved video showing detection of player’s move using vision system)

My chess robot blog.

If anybody else is thinking of building this, please let me know by commenting in this thread.


#2

AH! this is awesome! As a former competitive chess player (a bad one though), I’m loving this!


#3

reminds me of my former (autonomous) NXT chess robot…!
Which chess engine are you using?


#4

Stockfish (see full description in YouTube))


#5

thank you, the description didn’t show up for me when I tried it the first couple of times, but now it’s visible to me.


#6

Very cool! Could you hook it up to Hal?


#7

The robot’s chess engine can beat any human, but HAL was “presumed infallible” :grinning:


#9

amazing!
by which image processing program and which object detection algorithm do you perform the move recognition specifically ?


#10

That’s close enough.


#11

I use a couple of functions from cv2 and PIL, but, because the system knows where all the pieces are after the computer move, then all that has to be done after the human makes a move is for the code to be able to tell the difference between the following three cases:

  • An empty square
  • A black piece of any kind
  • A white piece of any kind

I wrote my own code for this.


#12

Could you share the code? I’d love to see in raw technical detail what happens.


#13

Now with vision, as per my post in the thread


#14

I’ll PM you later today or tomorrow about this. Is it just the vision code that you’re interested in?


#15

Yes, just the vision code that interests me.


#16

Now tested the vision code for castling.


#17

tbh, I’m curious about pawn promotion :wink:


#18

You are right! If the player promotes a pawn to a non-queen then they have to tell the system what the piece has been promoted to.


#19

I got fed up with the robot jamming when lowering the grabber, so I’ve been implementing a Watt’s linkage


#20

Video showing piece taking and castling by both sides:


#21

Got another bug out of the vision code and implemented en passant