Thursday, January 24, 2013

3D Printed Robot Arm & Hand

This looks pretty interesting - a 3D printed robot arm & hand.  Worm gears are 3D printed, and the arm uses two affordable HS805BB servos.


Wednesday, January 23, 2013

Online Text to Speech portal

I had to listen to the pronunciation of an ancient Greek word recently, and came upon CWSpeak an online text-to-speech portal that does a whole bunch of languages (even ancient Greek and Lojban).

Sunday, January 20, 2013

Dead simple Ajax form validation

It took a while for me to sift through all the examples to simplify the concept down to what I needed.  I need to validate chess moves based on the current chess board before the submission of the move (or else people on AWS Turk will submit lots of badly formed moves). "validate_move.py" is a Python CGI program that reads the QUERY_STRING to get the move and then sends back a "t" if the move is good or "f" if it is false.

<html> <head> <script> var OK2Submit = false; function validateMove() { OK2Submit = false; document.getElementById("moveDiv").innerHTML="<i>Validating move...</i>"; var xmlhttp; if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { var moveGood=xmlhttp.responseText; if(moveGood.charAt(0)=="t"){ OK2Submit=true; document.getElementById("moveDiv").innerHTML='<i>That is a valid move, you may submit it</i><br><input type="submit" value="Submit">'; } else { document.getElementById("moveDiv").innerHTML="<i>Not a valid move!</i>"; } } } xmlhttp.open("GET","validate_move.py?"+document.forms["myForm"]["move"].value,true); xmlhttp.send(); return false; } </script> </head> <body> <form name="myForm" action="action.py" onsubmit="return OK2Submit" method="post"> Enter Move: <input type="text" name="move" onchange="validateMove();"> <br> <div id="moveDiv"></div> <br> </form> </body> </html>

Sunday, January 13, 2013

Better web server for Raspberry Pi and Python CGI

I now suggest you use lighttpd on your Raspberry Pi. Instructions to install it are here. To set up Python for cgi-bin use with lighttpd, see here.

Friday, January 11, 2013

Mechanical Turk ExternalQuestion pointers

1) If you are going to use an ExternalQuestion with Mechanical Turk command line API, you will need to use the following in your .question file:


<?xml version="1.0" encoding="UTF-8"?> <ExternalQuestion xmlns="http://mechanicalturk.amazonaws.com/AWSMechanicalTurkDataSchemas/2006-07-14/ExternalQuestion.xsd"> <ExternalURL>http://myexternalquestion.html</ExternalURL> <FrameHeight>400</FrameHeight> </ExternalQuestion>

2) The form action for the Sandbox is "https://workersandbox.mturk.com/mturk/externalSubmit"

Saturday, January 05, 2013

Turk Chess Progress

1) I had a hard time getting people to respond to Mechanical Turk HITs with proper FIDE chess algebra notation.  So I am considering using a Javascript chess board as a front end - perhaps this one, together with an ExternalQuestion, with an example external HTML here.

2) To serve this, I needed the secret to set up thttpd on Raspberry Pi.

Wednesday, January 02, 2013

Potential Chess Turk Arms

Here is my list of potential Chess playing Turk arms:

Lynxmotion AL5D 26cm "median reach" (whatever that means), $340
EZ-Robot 6 Servo Arm 50cm "total length"(not much info), $140
OWI-535 Arm 32cm "horizontal reach" (needs feedback system), $45
Dagu 6DOF Arm 39cm length, $275
Trossen PhantomX Pincher 28cm horizontal reach (powerful AX-12A Dyamixel actuators), $400
Trossen PhantomX Reactor 38cm horizontal reach (has a serious reach spec sheet, that shows it really can only reach out 30cm with a vertical pick-up), $550.

Then there is the 5DOF laser-cut DIY arm (requires about $40 of servos).

Some of these could be altered to provide longer reach.  A typical chessboard is 12-18 inches (30cm to 46cm), although I did find this 10.5-inch (26.7cm)board as well as this 11-inch (28cm) set.   There is a 5-inch (12.7cm) set but I am concerned that positioning to a 0.5-inch square might be tough, plus I may have to remove the magnets from the pieces in this magnetic set.  This affordable 7.5-inch (19cm) set may be a good compromise between being small and not being insanely small.

Update:  Here is a Lynxmotion AL5C playing chess...OK, I bet an AL5D could do it as well!