Sunday, October 20, 2013
Android Rover Control Client Up First Drive
I was able to get the Android client up and running last night. It's a fairly simple affair, since I am definitely an Android GUI newbie, but it is working enough to drive around. Today I took it for my first drive outside my line of sight, driving strictly with the camera. Good fun!
First, I got a new laptop that has a processor that has the right support for the Intel HAXM hardware accelerated simulator. That is a dramatic improvement - it boots fast and runs quickly enough to test the video streaming and network control code. HIGHLY recommended to use it if your hardware supports it. It's worth the 20-30 minutes to set it up.
Right now, the client only has an ImageView for displaying the frames from the rover's camera, ImageButtons for the directional controls, and a SeekBar to set the motor speed. Additionally, there is a text box to enter the rover's IP address.
For momentary contact buttons, I used an OnTouchListener, with the direction being set with MotionEvent.ACTION_DOWN. The UP event calls a stop when you release the button.
I need to do a better job of handling rotation/app pause type events and make sure the socket code handles most events cleanly. I also intend to punch a couple holes in my home router so that some friends can try to drive it over the Internet.