Wednesday, August 13, 2014

Lesson 60 - Physical Turtle

It's summertime! So no wonder we haven't been coding much lately. A while ago we got a couple of Lego Mindstorms boxes from Reaktor though. Me and my friends built a "turtle robot" that can be move and turn and draw with a blue marker. The mechanical part was quite challenging and rewarding. The software part wasn't so much. The graphical development environment from Lego was really bad. Graphical and "easy", but practically impossible to code anything interesting. I mean code in the sense that you can write and refactor code the way a coder is used to. Well, it took until 3 AM or so to finally get the firmware (LeJOS) and the development environment (Eclipse) working together. Then we had an environment where you can actually code something. Yes, it's Java.But doesn't the robot look pretty cool? It had two independently controllable wheels and a pen that you can lift and put down. And you can turn it around 360 degrees around the pen. Amazing mechanical engineering required :)

The next day, I wrote a simple API so that you can issue commands similarly to Turtle Roy. For instance, you can tell the robot to turn 90 degrees to the left, or move 100 units forward. Then we did some programming with my daughter. Like this.

You can imagine my little girl (5 years as we speak) being quite excited when her commands made an actual physical ROBOT MOVE and DRAW ON THE FLOOR. Yes. The floor. First we tried paper but the result was the robot messing up the paper quite badly. Fortunately the marker was water-soluble.I wish someone sold wifi/ble capable robot turtles that had a pen and an open API. Then I could make Turtle Roy control a real robot. That would be huge!