random image random image random image random image random image random image

Using a keyboard to navigate a virtual space; be it the internet, a game or some other format, is familiar to most adults and older children. The Wowwee Rovio (rover) can be driven by such keyboard controls or mouse clicks with the built-in interface. Couple of problems with this however:

  1. The interactive needed a custom interface so the built-in web interface (and keyboard controls) would not work.
  2. The interactive needed to be accessible to children as young as 3 years old.

The custom interface was built with ActionScript3 and so to move the rover, the api was used. With the api, the rover could be sent movements via http requests. These api requests needed to be mapped back to user input and so the web interface was recreated in with as3. The ASDW keys were mapped back to specific movement requests via the api. This is a specific piece of code initiated by a keypress that gets sent to the rover:

switch(e.keyCode){
//forward
case 87: //W key
drive = 1; //1 maps to forward
speed = 1;
request.data = "Cmd=nav&action=18&drive=" + drive + "&speed="+speed; //action 18 is manual drive mode
loader.load(request);
break;
}

Happ Joystick

The drive variable signals the command/direction for the rover (forward, backward, rotate right) and the speed variable is how fast the command should be executed by the rover. Sending one of these http requests would move the rover a fraction of an inch. Mapping each key to a specific movement and sending multiple commands successively reproduces the motion of the built-in interface. This does not remedy our problem of simplifying the interface for 3 year olds. This is where the custom hardware comes in.

Our custom hardware consists primarily of a joystick but also includes some auxiliary buttons for game functionality which I will describe in a following post. The hardware came from Suzo Happ and also included a UGCI board for USB interface. The UGCI board had an included key-mapping utility which was used to map the joystick and button contacts to key presses. A constant connection with the joystick in any direction sent a repeating key press rather than a key up and down.

With key presses mapped to the joystick control and to the rover’s api through actionscript, the rover could now be driven with custom joystick controls. Now if only our rover could see…

Download Flash Builder 4 Project

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • MySpace
  • NewsVine
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • TwitThis
  • Diigo
  • FriendFeed
  • Identi.ca
  • Posterous
  • Suggest to Techmeme via Twitter
  • Twitter

4 Responses to “Making the most of your toy robot (Part 1 of 4) – Custom hardware controls”

  1. Making the most of your toy robot | Electric Pineapple

    [...] Custom hardware controls [...]

  2. Making the most of your toy robot – Video stream in Flash | Electric Pineapple

    [...] that we can move the robot, we need to be able to see where we are going. To give our robot eyes within flash, I first tried a [...]

  3. Hacking Robots for Fun and Profit | Iona.LABS

    [...] Making the most of your toy robot (Part 1 of 4) – Custom hardware controls Making the most of your toy robot (Part 2 of 4) – Object Detection Making the most of your toy robot (Part 3 of 4) – Processing the video stream in Flash Making the most of your toy robot (Part 4 of 4) – Docks and Beacons [...]

  4. Jeremy

    Ah, my wonderful carpentry skills on display.

Leave a Reply

Powered by WordPress. Theme developed with WordPress Theme Generator. Header images provided by idee.
Copyright © Electric Pineapple. All rights reserved.