Search This Blog

Sunday, March 13, 2011

Controlling Amiro (the name I have baptized the car) from an Android phone (HTC Desire)

While the Java PC application is useful for testing and controlling the robotic car while sitting in a chair, for on the field fun a more practical solution had to adopted. So using a popular platform that Android is, I decided to port the (Java Swing) application I already had, to run on any Android phone with a accelerometers and a Wifi connection. As the car behaves like an access point, all it is necessary is to associate the phone to it, and run the application.

Just about as fun as it is to drive it, coding the client in Android was quick an fun experience.
The interface had to contain just the essential elements. While the target hardware has abundant resolution (480x800), like in any mobile platform, screen real estate is always a concern. As such I had to economize on the components to be displayed. The result was a relatively simple UI:

It shows the data from the different active sensors (speed, 3 obstacle range values, temperature and battery status). One slider controls the throttle (the vertical one), and another slider controls the intensity of the LED headlights (also enabling the switching between white and UV LEDs).

The video below shows the car in action, this time controlled by the Android phone: