| |
Can wireless sensor networks be fun? You bet! This Tuesday, Sun Technology Evangelists Simon Ritter and Angela Caicedo demonstrated a row of interactive 3D virtual game prototypes, all created using Java and the Sun SPOT technology. The session covered hardware and software used, and ended with a demo.
The hardware -- the Sun SPOT (which stands for Small Programmable Object Technology) -- is a lightweight electronic communication device that fits in the palm of your hand. What distinguishes the Sun SPOT from comparable devices is that it runs a Java Micro Edition Virtual Machine directly "on the metal" (on the processor) without an operating system. Sun SPOTS can be programmed just like any mobile CLDC 1.1 device -- minus the graphical user interface of course.
Each device comes with a 180 MHz 32-bit ARM920T core, 512K RAM, 4M non-volatile Flash memory, 802.15.4 radio, 8 multi-color LEDs, and a USB interface. The default hardware configuration includes several sensors, such as an accelerometer, and temperature and light sensors. Six analog-to-digital converter inputs and five general purpose I/O pins can be used to add custom sensors and devices. Furthermore, four high-current output pins (100 mA) are available to control actuators such as servo motors. The devices are battery-powered and thanks to their very efficient power management they run for a year without recharging. Sun SPOTs are already available for sale, but presently only in the US.
Ritter proceeded with actual examples of how these features could be put into action. Just like any Java ME application, you use getters and setters to access inputs and outputs. Ritter recommended to use the LEDs to display debug output, and showed how scalar values could be polled from the sensors, for instance the accelerometer. A 3-axis accelerometer tells you whether the SPOT is being tilted, and it also tells you exactly which way the device is being moved in 3D space. The sensor's sensitivity can be set to respond either to minute movements in the range of 0-2g, or response can be restricted to only consider jolts in the range of 0-6g.
Since the accelerometer responds comparably slowly, Ritter next demonstrated a custom gyroscope add-on. For optimal motion detection and orientation of the device, Ritter suggested to combine the solid-state accelerometer and the gyroscopic sensors. Ritter also described how he added a cool P5 data glove that can be used to control a mouse pointer on a PC. The glove had to be customized to work with the Sun SPOT: Ritter added two perpendicular gyroscopes, and then the Sun SPOT was attached to the back of the glove using velcro. In Ritter's experience, a refresh rate of 1/25 sec is optimal for smooth mouse movement. However he also confirmed that the data glove is not yet a viable replacement for a mouse since it needs to be calibrated for each user. Other possible add-ons Ritter described included a potentiometer (actually a thumb joystick taken from an old game pad), a compass sensor, and a voice synthesizer.
Next Caicedo gave an overview of the Java 3D API that she used to create the virtual reality part of the system. In a virtual reality environment, a user interacts with a 3D simulation. The user is represented in the virtual world either by a hand (requiring one SPOT), or by a full Avatar (requiring several SPOTs). The world itself is represented by a scenegraph containing the camera, lights, object geometries and transformations; for increased realism, the world can be surrounded by a skydome for a horizon. For the actual implementation, Caicedo decided to use 3D Studio Max to create Wavefront 3D models, VRML (Virtual Reality Modeling Language), Java OpenGL (JOGL), and the JOAL/OpenAL 3D sound toolkit.
In order to be able to use the data glove as pointer in the 3D world, Caicedo first implemented mouse picking: 2D Mouse click coordinates are matched against the bounds of 3D objects in the viewport, a hit within the bounds is recorded as selection. For the actual mouse pointer controller, Caicedo used Java's existing AWT Robot class.
The session ended with demos of three gesture-controlled 3D desktop applications that were created using NetBeans IDE: A Sudoku game, an interactive aquarium, and a 3D desktop based on Project LookingGlass technology. The demos clearly showed how a combination of Sun SPOTs and Java3D can be used for sophisticated virtual reality simulations.
|
|