I made my first domino robot when the nxt was all new to me, and it didn't work for a variety of reasons. (Probably the language I was using was not shiny and object oriented enough
) The curious can see it here
Now I'm reimagining the project. It will be able to lay dominos, but the pusher has been redesigned, and there will be a whole lot more programming. Here's some pics first, (and a big fat description later on.):
First moderately successful run, making a 10cm straight line followed by a supposedly 90 degree turn with radius 15cm:
The mechanics: The top motor splits power between a pusher and a gate, using a differential. The cleverly designed gate (when I say clever, i mean it went through at least 100 different permutations to become just right,) which lets the dominos out when down but holds them back when up (this is the shock absorber, used for is 6.5M length), while nozzling them to land centered whatever the size of the domino. The a pusher is made out of that soft axle piece
. This winds up around a drum to pull the pusher back, and unwinds to push the domino out. (The end moves back and forth in a track.)
There is a lot to program on this. It builds lines of dominos segment by segment - a line, an arc, a spiral, whatever. These are written and read from a text file, and put in to a Queue for use. The program starts by asking for a file, or allowing you to create one on the go with the buttons or a color bar code reader (the latter two yet to be implemented.)
I have classes set up with proper MVC architecture:
: This is the Controller. It starts the robot, loads and save properties from a properties file, and controls setting up Queues of segments to place.
: This makes things pretty. It has its own println/printerr functions, which are special because they save the last 8 lines in a Vector. It has functions for alert and confirm, just like on web pages. When showing these "dialogs", it hides any output and changes the button listeners to control the dialog. When the dialog is closed, it prints out the lines again.
: This makes button listeners more useful. You add one listener to it to a button, and then call methods in PowerButton to change which listener is applied. It has things like waitforpress of multiple buttons. More is yet to come, like the ability to have multiple button listener threads.
: This loads a file and parses it in to commands. When start() is called, it tells the Robot to make segments, sequentially.
: This is responsible for motors. It has methods like LayLine, LayArc, LaySpiral, whatever. It listens to the sound sensor to make sure a domino falls, and if not sends an alert message to the user for more dominos.
This is all for the robot pictured above. What I'm actually building is a crane arm vehicle, which has a truck chassis and an arm on the back that can place dominos with polar coordinates, using the robot pictured above as a tool head. (You can see a 20z gear on the top where the arm will connect. The drive motors will be removed and the ball moved to their spot for support, the nxt will be removed.)
Having a truck will make the robot much more powerful: it will be able to do splits and joins in the chain of dominos. This will require things like a TruckPilot class, something to move an arm and decide when to move the truck vs when to move the arm, as well as logic for making two lines at once and maybe a light sensor for help finding the end of a line. (Step 1: parallel lines. Step 2: each line does whatever it wants, and the program figures out how to join them automatically.) I'm not sure what features to add after that, but I'm open to suggestions like Bezier curves or calculation of how long a line would take to fall based on spacing, and making lines take the same amount of time to fall...
As you can see, there's a lot do yet. I'm hoping to be able to do parallel lines in time for brickworld, but this could be tough. (Lets not think about the other NXT projects also vying for time. *cough*sumo*cough*) This is just a quick summary, I will go a lot more in to depth after the event....
What do you all think?