Picochess web service

250 views
Skip to first unread message

Ole Hansen

unread,
Aug 23, 2017, 5:00:58 AM8/23/17
to PicoChess
Dear devs (and possibly users)

I have been trying to find documentation for the web service that is built into the picochess software, but so far with no luck. Are there some docs, that I have just been unable to find? Or some place in the code, where I can see what requests will give what kinds of responses?

Some background:
I have been given the task of making some software, that functions as middleware between an industrial robot arm and a DGT Pi, so that the arm will move the pieces of the computer player. In order to do that, I need to get information about the latest computer move from picochess. Currently the intention is to have my middleware running on the robot's builtin computer, so the webservice seems like the best way to get the data.

I am not particularly familiar with Python, so the way that it references other code seems to involve some "automagic" stuff that I don't get. So far, I have been able to find the specific requests that it will respond to, but not where the responses are generated. Any hints to point me in the right direction will be appreciated.

I am aware of FEN-strings and how to decipher them. so something that simply gives me the current setup of the game, will be fine.

Thank you in advance for whatever assistance you can provide.

Regards

Ole

Jürgen Precour

unread,
Aug 23, 2017, 5:44:10 AM8/23/17
to PicoChess
Hi Ole,

that sounds very GREAT!!
I would like to have such robot arm - a dream can become true.

picochess has alot of different queue's and each part of the program sending / receiving these messages/events to deal with it.
You can take a look inside the "dgt" folder. Esp "display.py" should give y some hints. Basically, y need to listen these "Message.DGT_*" and
deal with this "DGT_FEN" in your case or in picochess.py in "user_move()".

There is NO dev-docu ....i should know what im doing ..and im too lazy to write it (despite abit inside the code). SORRY!
Also there is nothing to reach out of python. But it should be not hard, to update this.


When the engine finds its move, it fires an Event.BEST_MOVE, which then deals with it, and fires a Message.COMPUTER_MOVE, and so on.
For last i have several listeners who for example display the move on the Clock, or update the webserver. Thats a basic example.

Perhaps we should discuss this out of forum, cause its quiet technical.

Jürgen

Shivkumar Shivaji

unread,
Aug 23, 2017, 10:23:16 PM8/23/17
to pico...@googlegroups.com
Adding to Juergen's reply,

I developed the webserver a while back, modeled after the event queue receiver. The code was refactored significantly by Juergen. 

It might be easiest to look over the code of https://github.com/jromang/picochess/blob/master/talker/picotalker.py. You can search for picotalker on the github tree to search on how it is invoked. It does the basics, process every move send by picochess followed by an action. It audio announces every move. The robot arm can be a variant of the pico talker, instead of announcing the move, it should MAKE the move on the board with the robotic arm!

Its quite easy to call a c-module or anything you want in this python class. If you absolutely hate python and want to only use C/C++ or the like, no problem, we can have a simple listener that just outputs the move very similar to chesstalker, it can be called chesslogger, and you can simply read the log file and do the arm movement.

I am also very excited about the robotic arm. Which company is funding you to build the arm? Do you have a video of how it is working now? Maybe you can post it to youtube. It would be fantastic to have it work with picochess! Let us know if you need help with the picochess move output side.

Best Regards, Shiv


--
You received this message because you are subscribed to the Google Groups "PicoChess" group.
To unsubscribe from this group and stop receiving emails from it, send an email to picochess+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ole Hansen

unread,
Aug 25, 2017, 8:14:57 AM8/25/17
to pico...@googlegroups.com
Hi Shiv and Jürgen

There is a video of a proof of concept at https://youtu.be/B1g5cih8PDM

The video is of the robot pre-programmed with the moves of a game, the DGT Pi in the pic is not actually doing anything. To my understanding, the robot arm is a fairly standard off-the-shelf unit - but probably a bit over-priced for a personal chess-playing robot.

My job (as a part-time intern) is making a seperate piece of software, which generates commands to the robot of the style: "pick up a piece here, and put it there" - in the same way as the handwritten commandlist that is played in the video. With the exception that the robot will only be performing the computer player's moves.

Because I am an intern, my software is restricted to running in what my mentor is willing to maintain afterwards - which means Delphi Pascal. I would very much prefer to not make modifications to the picochess software (as an update would break it). But I noticed that the built-in webpage was just a thin template in HTML with the main stuff running in javascript, and that it was getting it's data as JSON from a webservice. 

So far, I have concluded that I need to call the webserver with something like "/dgt?action=get_last_move" and analyse the fen part of the result (if it exists).

Regards

Ole

--
You received this message because you are subscribed to a topic in the Google Groups "PicoChess" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/picochess/-ib7Xyx489U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to picochess+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages