Back from another Garage48 event, this time from Helsinki. The project I was member of was completely different from the earier ones — we turned 6 more-or-less mobile devices into wireless 3D controllers for Lego Mindstorm NXT. We won Nokia special prize and public vote prize.
So, how did it all happen? To put it into one sentence — nobody of our team didn’t have any concrete idea before the Friday (neither pre-submitted nor even in just in our own mind), and it all happened very spontaneously and instantly.
I personally only had some abstract strategic goals before coming to the event. For one thing, lately I have been increasingly engaged in hacking on mobile platforms, have been playing around with iPhone stuff, new Nokia Qt Mobility development frameworks and things like that. The other thing is that in Mooncascade we recently made the 48h development style as our official development service offering to our customers. So, I thought it would be nice if I could join some mobile project, have fun with it, prove to myself and to the others, that I can do stuff, and meet other people that are into mobile stuff. But I didn’t have any concrete project idea in my mind.
By the initiative of Garage48 organizers, there was some information exchange on couple of cars that were commuting from Tartu to Helsinki, to the event. I was picked up by one of those, driven by Pearu Orusalu — some dude I didn’t know at that time, but who later become one of the partners in Montroller crime.
On the road from Tartu to Tallinn Pearu started to express his vision that it would be rather boring or lame to do just another web piece of noise. He thought it would be much more interesting to come out of virtuality and do something physical/real. He described his background being in the industrial design and 3D-modeling of mechanics, that obviously explained his inspiration. I personally felt pretty sceptic on that and reacted like “yeah, right, would be nice really, but… 48 hours etc etc etc”. So, the conversation on the car was left as just some theoretical dream, nothing else.
On the boat we settled in some caffeteria area with buch of other people, including Jaen Saul, another to-become-partner in Montroller crime. Unlike Pearu, I already knew Jaen as he is also co-founder of our Mooncascade operations. On the boat we continued the conversation about physical stuff, but this time in perspective of mobile phones. For example, one random idea that emerged was to turn mobile phone into an auxiliary mouse for ones laptop. We even did a quick Nokia N8 Qt code test to measure the sensitivity of its accelerator in order to see, if it is suitable for mouse interactions.
Hacking on boat, to test Nokia N8 accelerator sensitivity (from left to right: Asko, Jaen):
The measurements looked good, though, the idea as such still sounded… well… boring.
Now, having the phone that could be used as controlling device, Pearu again introduced the physical world factor. What could be controlled by phone, that would be something physical and cool at the same time? One should be really braindamaged at that point to not discover, that it would be some robot of course. But still the sceptics — none of us owned any robot kit, leaving aside finding one accidentally in our back-bags. Jaen, being a hardcore hacker of anything that has some interface to talk to, boldly stated, that if we’d find any robot kit (be it Lego or whatever), we could wake it up if it has either bluetooth, some sonic or whatever interface that it listens to. We did also some surfing of potential Lego shops to visit if no other options would come up. We figured out that if it is a Lego Mindstorm, it has to be NXT model (as it has bluetooth interface). At that point I was still sceptical and left some retreat statement that I’d still watch what other ideas will be proposed on the ideas session, and make the decision there.
So, after some random chattery and chicken-out-disclaimers, we decided that we’ll pitch the idea, with conditions — we need to find somebody into our team, who has access to some robot-kit (doesn’t have to be Lego — any would do) — if we don’t get such a mate, we’d scrap the idea and join other teams.
On the event site, during ideas pitching, I started my pitch with the question to crowd: “Does anybody have any robot kit at home?” After repeating that question like one or two times, one not very confident hand was rised. Anywais, I then explained what’s the deal and what competencies we’d need, and hoped for the best. During the session where people make their project choises and divide into projects, two more people joined us (in addition to Pearu, Jaen and me): Annika Toit (marketing) and Anton Narusberg (Android developer).
Fortunately, during the session where people were selecting their projects, Annika managed to locate one Lego Mindstorm NXT — it was 20 kilometers from the event site. So, Pearu and Annika jumped into the car and went for it. And that was basically the moment, when I felt already almost certain, that we are going to do the project.
While Annika and Pearu were away, Jaen, Anton and me started to investigate bluetooth situations on mobile side — Jaen and Anton on Android, and me on Nokia N8. I guess it was around 9 PM. For my disappointment I discovered that Qt doesn’t support BT yet in its API — one had to go to the Symbian level with it. So, I downloaded and installed Symbian toolchain. Then downloaded a Symbian SDK plugin for bluetooth that had to be compiled. Which of course didn’t wen’t smoothly — I had to fix one Symbian header file and bunch of other obstacles that caused a compilation error. When I finally managed to compile the plugin, I was about to compile a third party Qt component on top of it, while Jaen and Anton discovered, that Anton’s Android Desire doesn’t have bluetooth API at all. It was about 11:30 PM or 12 PM by that time.
For the sake of development speed we then decided to scrap the phone bluetooth interfaces and simplify the prototype, by adding a proxy to the desktop computer — mobiles were to talk to proxy over TCP connection and proxy was to speak bluetooth with robot.
About the same time Annika and Pearu arrived with the robot kit. The moment, that caused some salutations and joyful shoutings, but what died away when we discovered that the LCD screen of the robotkit’s “brain” unit was practically dead. That ment that Jaen had to hack the protocol between proxy and robot into working kind of blindedly — reading the manual of the robotkit, and hoping he pushed the buttons on it in the right order and that the brain unit actually reads those pushes. Somehow he managed it, and since then, everything started to go very quickly.
By 1..2 AM Saturday morning some limbs of the robot started to twitch on the commands that came from proxy. Software in the Nokia N8 and Android end started to get its gyroscope readings, we agreed the protocol between mobiles and proxy, calibrated and normalized the gyroscope/accelerator readings, and started to connect the vertical communication chain. Pearu constructed the robot mechanincs and by 3 AM Saturday morning, robot already moved because somebody moved some phone, although sometimes the robot movement didn’t necessarily make any sense yet. After fixing all the sign and shifting calibration errors/bugs in the communication chain, about 4 AM in the morning, we had robot completely under the phone control, first N8, and couple of minutes later also Android.
About the same time our Android developer recalled that macbook has a gyroscope, and… well… You can already guess, what was the next device that we tilted in order to move the robot.
On Saturday we also added more features of the robot to the control of the phones: moving the claws, blinking a light and using audio.
The last technical challenge that was left to tackle was Windows Phone 7. Annika in our team had Windows Phone 7 device, but we knew, that we can’t deploy to it without having a Microsoft Windows Phone developer account, and we couldn’t register for one fast enough. Jaen did set up a windows container into his linux box, downloaded the necessary development environment, prepared the code in the WP7 emulator by Saturday night, and we started tweeting about we need for somebody with development account access. On Sunday we got help from the local Microsoft representative (Microsoft was the main sponsor of the event) — by 1 PM Sunday we got a temporary access to a development account. It took about half an our then from Jaen to deploy the app, do the calibration, and… we had another device to tilt in order to drive the robot.
On Saturday we also came to an idea to turn the robot into a spy device – we mounted the Android phone on top of the robot and had it stream video, which we could look at on the desktop screen and basically drive the robot truly remotely while just watching the screen.
On Saturday, while we were hanging around and bullying the other teams with our mobile-controlled spy-robot, Sander Saar joined our team who provided very valuable marketing and PR help to us by doing the movie-trailer-style video, the feature video in behind-the-scenes-style and helped to prepare for the decent final presentation on Sunday afternoon.
On the final presentations we happened to be the last project who presented. Our presentation went almost perfectly, except we had a robot accident. Our scenario was to put robot down from the desk, when I finish my demonstration of the robot movements and give the control over to another guy. But nobody did put that robot down. When another mobile device got activated, it was incidentally tilted in a position that gave full gears forward to the robot and the robot just flew off the table, crashing on the floor. The Android that was mounted on top of the robot, fell into pieces, but the robot sustained enough of its mechanical structures to still continue driving and be controllable.
That accident cought so much of our attention, that we accidentally forgot the last feature we had to demonstrate. It was unfortunate, because that feature would have been a style-clean ending to the show, especially with the now-jammed robot. I had to put the microphone close to the robot and it had to say, with a famous voice that everybody would have recognized: “I’ll be back…“
Anywais, despite of that it turned out in the end that we won the Nokia special prize of the best mobile app created on the event, and the public favourite prize.
I am completely happy, that I came to that event again, and that despite of earlier scepticism we undertook the project that we did. Now it is already Wednesday and I am by now recovered from the sleeplessness of the weekend.
Looking forward to the next Garage48 event to participate!
The happy winners of Nokia special prize and public favourite prize: