Login

Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

ARM websites use two types of cookie: (1) those that enable the site to function and perform as required; and (2) analytical cookies which anonymously track visitors only while using the site. If you are not happy with this use of these cookies please review our Privacy Policy to learn how they can be disabled. By disabling cookies some features of the site will not work.

ARM Community: Travels of the ARM Powered Android LEGO Rubik’s Speedcuber: ESC SV 2010 - ARM Community

Jump to content

Travels of the ARM Powered Android LEGO Rubik’s Speedcuber: ESC SV 2010

As you may be aware, my ARM-Powered LEGO robotic Rubik’s Cube solver “Speedcuber” was demonstrated live at Mobile World Congress ’10 in Barcelona in February this year (actually it almost didn’t happen because the LEGO robot fell apart while in transit and as I didn’t attend, a few other ARM Engineers had to roll up their sleeves and work out how to piece it back together – thanks guys). I had anticipated that after the push to prepare the robot for the its first public outing, I could re-focus my energy on my regular day job and relax a bit more in my spare time... but things don’t often go as expected in my life!

Speedcuber was a very popular demonstration at MWC so it was natural to consider demonstrating it again. However, someone (I won’t name the “guilty party”) suggested that we should switch to more relevant, contemporary technology; after all, the Nokia N95 phone controlling the first robot was launched almost four years ago in 2006. It was proposed that we show the robot again in April at the Embedded Systems Conference in Silicon Valley (time to forget relaxing in my spare time for another couple of months!?!).

We decided to use an Android-based phone and I set about downloading the Android SDK and acquainting myself with the unfamiliar APIs. The ARM Solution Center for Android (SCA) provided a good starting point for this. The application on the Nokia phone was written in Java using MIDP 2.0 so I hoped that the port to an Android application using Java would be relatively painless. I managed to borrow an HTC Hero for my initial work. Using one of the many example applications available via the ARM SCA I was quickly able to construct a skeleton application and user interface from a “Hello World” example and port the cube solver code.

For me, one of the coolest things about developing for Android was the ability to download and debug an application directly on the device using features such as breakpoints, code stepping and variable inspection that you would expect in an embedded software development environment. While developing for the N95, I was able to debug the application running in an emulator, an option which is also available with Android. This allowed me to debug the main solving algorithm, but didn’t allow me to debug the Bluetooth and Camera interfaces. From my previous experience, I expected that writing code to interface from the phone to the Motorola DROID.

But it was all going too smoothly! Accessing the camera was more of a challenge. On the N95, I was only able to use the camera in snapshot mode rather than in streaming video mode. This limited the overall speed of the demonstration since the initial scan took several seconds to capture each of the images for the six faces of the Rubik’s cube. I was hoping to be able to use the live preview image stream provided by the android.hardware.Camera class to significantly reduce the time required to capture each image in the new demonstration. It took a while to find enough information to convert the HSV images returned in the preview call-back into RGB format to allow me to use my existing colour recognition algorithm. However, once this was achieved, the Android version of Speedcuber soon sprang into life with its first solve!

The other significant change to the demonstration was to add a large LED display to show messages and solve times. Luke from the “demo team” in Cambridge worked very hard to create this from scratch using a Cortex-M3 based microcontroller, the LM3S811 from Luminary Micro using their Evaluation kit. Of course the software development environment supports debug of the embedded application while it is running on the microcontroller. Luke had to develop code to allow the LEGO NXT controller to communicate with the Cortex-M3 in the LED display using an I2C interface so I wasn’t the only person to get to play with LEGO at work this time!

Overall, I had a very positive experience porting the application to Android. The developer resources are generally clear and comprehensive. Since I was interacting directly with hardware interfaces to external devices, the ability to debug the application directly on the phone was a definite win for me.

You can see the Android version of the ARM Powered LEGO Speedcuberlive on ARM’s stand #1308 Embedded Systems Conference in San Jose until 29th April (assuming it survived the flight this time!)



Back to my day job... and maybe I can find some time now to relax a little?!? smile.gif

David Gilday, Principal Engineer, ARM, It all started with LEGOs. When asked what I was going to do when I grew up, I gave the answers that everyone expected of me…"train driver" or "fireman". But secretly I dreamed of a job where I could spend all my time building things with my favorite toy... Well thanks to ARM's cool technology it has come true (well in-between my regular day job anyway)! As I got older, I became interested in puzzle solving, electronics and programming and my "expectations" gradually changed from train driver to chip designer. However, my hobby and dream have remained essentially the same and I continue to enjoy dabbling in construction, electronics, mathematics and software programming in my spare time.

Shortlink to this post: http://bit.ly/9VvihX
All company and product names appearing in the ARM Blogs are trademarks and/or registered trademarks of ARM Limited per ARM’s official trademark list. All other product or service names mentioned herein are the trademarks of their respective owners.

6 Comments On This Entry

Please log in above to add a comment or register for an account

  • (2 Pages)
  • +
  • 1
  • 2

David Gilday 

30 April 2010 - 02:34 PM
I understand that Speedcuber did reach San Jose in one piece. I was pleased to see that Sylvie Barak from RCR Wireless stopped by to see this demo at the ARM booth at ESC. I just wish my demo hadn’t had been “camera shy”! smile.gif
0

David Gilday 

07 May 2010 - 07:05 PM
I have been receiving some great feedback and interesting questions about the Android LEGO Rubik's Speedcuber this week and thought I would share with you all.

Jesse Prabawa tweeted "I wonder what the grips for this #LEGO #Rubik's cube solver are made of? That's probably the crucial part. http://bit.ly/ae2BoE #ARM #Droid".

My Answer: Thanks for the question Jesse. The Speedcuber is made solely out of LEGO pieces and an Android phone. There is a small rubber LEGO "double grommet", which is part of the retail LEGO Mindstorms NXT set, fixed at the center of each grip to provide enough friction to hold the cube as it is manipulated. Yes, this was one of several design features that were essential in making this creation possible.

@DavidGilday
0

wallinnr12 

07 May 2010 - 07:42 PM
Hi David!

I am very impressed by your work. Being a high school science student, I am interested in building one myself. Is there a possibility for me to take a look at some blueprints and maybe the app used one the phone? It would be highly appreciated with a little help on this science project but I understand if you want to keep such a marvelous machine to yourself.

Regards
Johan Wallin
0

David Gilday 

10 May 2010 - 06:57 PM
Thanks for your comment Johan. I'm flattered that you and a number of others have asked if I will share the robot design and software. A number of people have also said that seeing the videos has inspired them to try to build their own. For me, this is probably one of the most rewarding aspects of this project - the fact that other people have been inspired to want to make similar creations :-)

I am busy on some other projects at the moment but I will investigate the possibility of making the design available in some form in the near future. Feel free to follow me here or @DavidGilday on Twitter so I can keep you posted if and when this happens.

In the mean time, I hope you enjoy your studying - science is a great subject.

Have fun!
David
0

nexus6 

10 May 2010 - 08:23 PM
Hi, why is the video gone from the YouTube channel?
0
  • (2 Pages)
  • +
  • 1
  • 2
Maximise
Minimise
» 

My Blog Links

» 

Recent Entries

» 

Search My Blog

» 

ARM Onsite

»