Today I have uploaded a video ‘Lego plays Ruzzle‘ on Youtube, to show how my creationÂ works.
I like to mix different technologies to create something innovative.
In this project I used:
- Tablet with Ruzzle
- Bash script for:
- Bash script for download screenshot of device
- Process image with Imagemagick
- Recognize character from image with Tesseract
- NodeJS for:
- Solving Ruzzle
- Optimizing the plan
- Send via bluetooth to Lego Mindstorm
- Nxc program to receive plan via bluetooth
- Absolute Position Regulator library for precise control of lego motors
The project is open source, and the code is on Github:
More photos are on Flickr:
Other article on Lego Ruzzle Solver:
- (english)Â http://hackaday.com/2013/02/19/lego-stylus-solves-ruzzle-tablet-game/
- (russian) http://24gadget.ru/1161053411-lego-reshaet-golovolomku-ruzzle-video.html
- (russian)Â http://mirfactov.com/lego-reshaet-golovolomku-ruzzle/
- (italian)Â http://leganerd.com/2013/02/13/lego-plays-ruzzle-retroscena-della-nascita-di-un-robot/
- (italian)Â Video of my partecipation @ Deejay TV show
In march 23 I talked about history of my robots @ Codemotion Rome. Below you can finde the slides of my talk:
Any feedback / request is appreciated !
31 Replies to “Lego plays Ruzzle: nxt & nodejs powered robot”
this is great stuff!! Congrats! Amazing job!
How did you solve the ruzzle? Do you use some search algorithm or is a simple greedy search on all the dictionary?
Greedy search is so fast (< 100ms) that i not implemented particular optimization. The only pre-optimization is filter world, removing those not contains letters out of the 4x4 grid. This avoid unnecessary research. The entire code is on github, and the search algorithm has a length of ~100 line of code (search, searchWord and searchNeighboard methods).
Vienici a trovare sul gruppo di NodeJs Italy 😉
Join request inviata 😉
Great job! A very cool mashup of technologies!
E che ti devo dire? come ho giÃ condiviso su G+ …sono rimasto senza parole 😉
Solo che ora mio figlio mi ha sfidato: “…perchÃ© non lo costruisci anche te?”
Grandissimo progetto,idea veramente geniale!!poi il video fighissimo. ti stimo!!!!!
Grazie Gabriele 🙂
Very cool project! I liked the video and the music!
Tnx for your comment, E !
Awesome project! I was curious – how much time does your software need to take a photo, analyze it, find words, and get the Mindstorms to start playing the game?
Thank you Shawn!
The more time consuming process is make the screenshot, download it, and process image via tesseract (4-7s).
The search in the dictionary is fast, very fast. For example, limiting the dictionary to 5000 words, the search process require 52ms to find words and order them.
Another point where to improve the performance is the sending over bluetooth: actually the robot wait until the entire plan is received (2-3s).
Hi, great project – any chance you might post the plans to build the robot? Would be really great for various applications in software QA, if it could be integrated with for example the Sikuli environment.. http://www.sikuli.org/
I don’t know Sikuli environment, but i love the automation (i hate any repetitive task), and in future week i publish some detailed photos on how build the robot.
The structure behind the motors responsible of movement along x and y axis are modular, and is easy to change the gear to obtain different velociy/acceleration and tune the robot.
If I generalize the nxt program to receive coordinate in cm or pixel, instead of coordinates in 4×4 grid, the robot can be used to make real test of any tablet application.
Awesome! You make me wonder why I am wasting time in an office rather than spending my days building stuff like this.
Please share a video that is a bit more technical, showing the components and real-time video of a typical Ruzzle match, start to finish.
Something that is not clear from your description is which component is responsible for “reading” the Ruzzle board, or, in other words, where the bash script runs and what it does exactly (unless you want us to reverse engineer what you published on GitHub of course). At the moment I am guessing that you manually import a screenshot on some conventional computer that is not shown in the video, which then sends instructions to the Mindstorms controller. In an ideal geeky world, this part of the process may run on a Raspberry Pi 😀
Fantastic job. Thanks!
I spend my days in the office like you: the robot is made in the kitchen of my apartment (with the permission of my girlfriend), in many nights and some weekend of hard work.
In the next week I post more videos and photos of the robot. I confirm that i use my computer to download the screen. I own a Raspberry board (great!) with node.js installed, but I wan to send the plan via bluetooth to the mindstorm nxt, and (I not own a bluetooh dongle connected to the Raspberry).
Complimentoni!! SeguirÃ² il tuo talk al Codemotion!!! 🙂
Grazie Giulia, a sabato 🙂
That is a good tip especially to those new to the blogosphere.
Simple but very precise infoâ€¦ Appreciate your
sharing this one. A must read article!
Really nice style and fantastic subject matter, hardly anything else we need :D.
Really cool project! I wonder which tablet do you have? Is it running Vanilla Android or is it rooted? I’m interested to know how to run bash script on my Nexus 7.
Is a Sony tablet with Vanilla Android (no rooted): i use ADB to create screenshots, without any bash script on tablet.