IndexNextUpPreviousUrbi SDK 2.7.5

Chapter 32
Spykee

The Spykee is a WiFi-enabled robot built by Meccano (known as Erector in the United States). It is equipped with a camera, speaker, microphone, and moves using two tracks.

 32.1 Installing Urbi on the Spykee
 32.2 Device list
 32.3 Dynamically loaded modules
  32.3.1 Clapper

32.1 Installing Urbi on the Spykee

To enable Urbi in the Spykee, you must update it with a new firmware. The Urbi firmware can be downloaded from http://www.gostai.com.


PIC

Figure 32.1: Installing the Spykee interface

Once obtained, use the Spykee interface. To install it (see Section 32.1): Download it from http://spykeeworld.com, start the interface, connect to your robot, click on the “settings” button, then on the Spykee image on the left. Then go to the “Firmware” tab, and click the “Load” button. Select the firmware file you downloaded earlier, and press OK. Leave the Spykee on its base until it reboots, the update process will take a few minutes. Do not reboot the Spykee yourself while update is in progress or you might render it useless.

With the Urbi firmware, the Spykee should continue to work as usual: you can still control it using the Spykee interface. But you can now also control it with Urbi.

32.2 Device list

The following standard devices are available on the Spykee:

The following non-standard functions are also present:

32.3 Dynamically loaded modules

At start-up, the Spykee tries to connect to the spykee.gostai.com website to fetch a list of additional features available for download. It sets up the system in a way that the first attempt to use one of those additional features will download and load the required objects.

The location where the modules are fetched can be changed by setting the loader_host and loader_dir configuration values (using Spykee.setConfigValue()). Default values are spykee.gostai.com and /modules/.

The following modules are currently available:

32.3.1 Clapper

The Clapper module detects and counts short and loud sounds, such as the one made by clapping hands. It can be instantiate by typing:

 
var Global.clap = Clapper.new("micro.val", 0.2, 200, 800, 4000);  

The second parameter is the volume threshold above which a clap is detected. The third and fourth parameters are the minimum and maximum delay between claps, in milliseconds. The last argument is the maximum duration of a sound sequence.

Each time a clap sequence ends, the val slot of the object is set to the number of claps heard, then reset to 0. Additionally, if emitEvent is true, the event sequence is emitted with one argument: the number of claps heard.

 
clap.emitEvent = 1; 
// Play sound sample number 3 when two successive claps are heard. 
tag:at(clap.sequence?(2)) speaker.playSound(3); 
// Stop the previous behavior. 
tag.stop;