For
Virtual Classroom
Prepared by Tal Lev
Page ii
Table of Contents
Table of Contents .......................................................................................................................... ii Revision History ........................................................................................................................... iii 1. Introduction ..............................................................................................................................1
1.1 1.2 1.3 1.4 1.5 2.1 2.2 2.3 2.4 2.5 2.6 Purpose ........................................................................................................................................ 1 Document Conventions ............................................................................................................... 1 Intended Audience and Reading Suggestions ............................................................................. 1 Project Scope ............................................................................................................................... 1 References ................................................................................................................................... 1 Product Perspective ..................................................................................................................... 2 Product Features .......................................................................................................................... 2 User Classes and Characteristics ................................................................................................. 2 Operating Environment ............................................................................................................... 2 Design and Implementation Constraints ..................................................................................... 2 User Documentation .................................................................................................................... 2
3. System Features........................................................................................................................3
3.1 Virtual Whiteboard ...................................................................................................................... 3 3.1.1 Description and Priority .......................................................................................................... 3 3.1.2 Stimulus/Response Sequences ................................................................................................ 3 3.1.3 Functional Requirements ........................................................................................................ 3 3.2 Content Windows ........................................................................................................................ 3 3.2.1 Description and Priority .......................................................................................................... 3 3.2.2 Stimulus/Response Sequences ................................................................................................ 3 3.2.3 Functional Requirements ........................................................................................................ 3 3.3 Save Session ................................................................................................................................ 4 3.3.1 Description and Priority .......................................................................................................... 4 3.3.2 Stimulus/Response Sequences ................................................................................................ 4 3.3.3 Functional Requirements ........................................................................................................ 4 3.4 Load Session................................................................................................................................ 4 3.4.1 Description and Priority .......................................................................................................... 4 3.4.2 Stimulus/Response Sequences ................................................................................................ 4 3.4.3 Functional Requirements ........................................................................................................ 4 4.1 User Interfaces ............................................................................................................................. 6 4.2............................................................................................................................................................. 7 4.2 Hardware Interfaces .................................................................................................................... 7 4.3 Software Interfaces ...................................................................................................................... 7 4.4 Communications Interfaces ......................................................................................................... 7 5.1 5.2 5.3 Performance Requirements ......................................................................................................... 8 Safety Requirements .................................................................................................................... 8 Security Requirements ................................................................................................................ 8
Appendix A: The Wii remote ........................................................................................................8 Appendix B: Wiimote communication protocol ..........................................................................8 Appendix C: Project description ..................................................................................................8 Appendix D: Screen shots .............................................................................................................8
Wiimote.cs : ........................................................................................................................................... 13 WiiMouseControlModule.cs: ................................................................................................................ 13
Page iii
Revision History
Name Tal Lev Date 20/2/201 0 Reason For Changes Creation Version 1.0
Page 1
1. Introduction
1.1 Purpose
The system shall provide a virtual workspace for the user, consisting of a virtual whiteboard, a set of content windows and an ability to save the current data.
1.5 References
www.wii.com - The consoles main page. www.nintendo.com - Nintendo the maker of the wii console and remote. http://en.wikipedia.org/wiki/Wii_Remote - Information of the wii remote technology from Wikipedia.
Page 2
2. Overall Description
2.1 Product Perspective
This product is a new, self-Contained product.
Page 3
3. System Features
3.1 Virtual Whiteboard
3.1.1 Description and Priority
A main feature of the program is the virtual whiteboard which is the area on the screen that will provide the user the ability to write and sketch in various colors and highlights, the user could also go through pages as if he/she would do so in a notebook. This feature is of high importance.
The product will recognize the input adapter and will control the mouse movements. The product will recognize the change in the adapter that states a click. The product will draw a path as the adapter moves in front of the display. The product will stop drawing as it recognizes a release click from the adapter.
Page 4
The product will recognize the input adapter and will control the mouse movements and clicks. The product will move the drawer according to the input adapter. The product will provide a list of the contents in a specified directory. The product will enable a drag drop feature from the drawer to the main window area. The product will recognize the content type and open the relevant window.
The product will recognize the input adapter and will control the mouse movements and clicks. The product will recognize the click on the save button. The product will gather all the elements in the session (writings and content) and will pack them to a predetermined data model. The product will take the model and will save it to file.
The product will recognize the input adapter and will control the mouse movements and clicks. The product will recognize the predetermined file types in the file dialog. The product will be able to check validation of the file selected. The product will be able to load the data model from the file.
Page 5
REQ-5:
The product will be able to unpack the session from the data model.
Page 6
4.2
Page 7
Page 8
Appendix A: The Wii remote Appendix B: Wiimote communication protocol Appendix C: Project description Appendix D: Screen shots
Page 9
Page 10
The use of an infrared sensor to detect position can cause some detection problems when other infrared sources are around, such as incandescent light bulbs or candles. This can be easily alleviated by using fluorescent lights around the Wii, which emit little to no infrared light. Innovative users have used other sources of IR light as Sensor Bar substitutes such as a pair of flashlights and a pair ofcandles. Such substitutes for the Sensor Bar illustrate the fact that a pair of non-moving lights provide continuous calibration of the direction that the Wii Remote is pointing and its physical location relative to the light sources. There is no way to calibrate the position of the cursor relative to where the user is pointing the controller without the two stable reference sources of light provided by the Sensor Bar or substitutes. Wireless sensor bars have also been released. The position and motion tracking of the Wii Remote allows the player to mimic actual game actions, such as swinging a sword or aiming a gun, instead of simply pressing buttons. An early marketing video showed actors miming actions such as fishing, cooking, drumming, conducting a string quartet, shooting a gun, sword fighting, and performing dental surgery. The LEDs can be seen through some cameras and other devices with a wider visible spectrum than the human eye, like most digital cameras and camera phones. The Wii Remote also has twelve buttons. It has a power button to toggle the Wii on and off, a d-pad which is interpreted as four separate buttons, and buttons labeled "A", "B", "1", "2", "home", "-", and "+".
Page 11
Page 12
Buttons: Gets the information about the buttons state from the 2 nd and 3rd bytes. Buttons + Accelerometer: Gets the former information and in addition gets the information about the accelerometer from bytes 4-6. IR + Accelerometer: Gets the former information and in addition gets the data of the IR camera from bytes 7-18. Buttons + Extension: Gets the data for the buttons and the data of the extension from bytes 5-10 depending on the extension type. Extension + Accelerometer: Gets the data for the buttons and the accelerometer from bytes 2-6 and the data for the extension from bytes 7-12 depending on the type. IR + Extension + Accelerometer: Gets the data for the buttons from bytes 2-3 and the data for the accelerometer from bytes 46 and the data for the IR from bytes 7-18 and the data for the extension from bytes 19-22. Status: Gets the data for the buttons, and battery from byte 7 and the IR recognized from byte 4. Read Data: Gets the data for the buttons and reads data from the 4 th byte.
Page 13
Project Description:
The project consists of 2 main modules:
Wiimote.cs :
Represents the wii remote in the application, and manages the communication protocol with the device, this module holds the state of the device at any given moment. When a change occur in the state of the device the module fires up the "WiimoteChanged" event so the user could make the changes necessary according the change in state. The creation of the module should be made using the default constructor supplied, To initialize the module a call to the method "Connect" should be made, then a call to the method "SetReportType" sets the report type desired (one of the 8 supplied). The call to "GetStatus" gets the state of the device at that specific moment, the last thing that should be made is to enroll to the event "WiimoteChanged" and by that getting the state of the device each time it hanges. By calling the "Disconnect" method the module disconnects from the device and frees all resources.
WiiMouseControlModule.cs:
Represents the entity that controls the mouse by the glove (2 leds of IR), this module uses the module 'Wiimote.cs' in a way that it saves the last state of the device and selects the actions that are to be made according to the state change. It uses the IR recognition of the device to acquire 2 IR led lights and according to their positions it makes the proper calculations to get the right commands to the mouse and the OS. I've used the Singleton design pattern in this module so there will be only one instance of it, the whole idea is that this module will work as a standalone entity that will bridge between the device and the OS and will be in charge of controlling the mouse with the glove. Each IR led acquired by the device has an X value ranging 0 - 1023 and a Y value ranging 0 767. After normalizing them you get two values ranging 0.0 - 1.0 so when multiplied by the dimensions of the screen you get a point on screen. because the device is reverted (0,0 is the bottom right corner and 1,1 is the upper left) than an adjustment is needed. The module uses Win32 procedures to put commands in the mouse's Queue in the OS, it mainly uses the 'SendInput' procedure which takes an array of INPUT structures and its size. every INPUT structure has a type (mouse, keyboard, hardware) and according to the type it holds the information in MI - Mouse Input, KI - Keyboard Input, HI - Hardware Input. The module uses the mouse input which is a structure of MOUSEINPUT which looks like so: DX - a value from 0 - 65535 that determines the absolute or relative X value. DY - a value from 0 - 65535 that determines the absolute or relative Y value. MouseData - usually stays empty. DWFlags - determines what kind of input is in the structure (move, left Down, left Up, absolute
Page 14
position, relative position). Time - a timestamp for the command sent. DWExtraInfo - some extra info, usually stays empty. Every change in the state of the device, this module gets the information about the IR led lights that it acquired, first if it has been acquired and second it's X and Y values. if the module acquired 2 IRs than it calculates the average between the two points and the distance between them, if the distance is larger than a specific constant value than it makes the mouse move there, if not it makes the mouse do a left button down action (according to the last state of the device). This module has the infrastructure to support 4 led lights for a future ability to work in a multi touch environment, using 2 gloves will let the user make 2 clicks at the same time and enable multi dragging and zooming in and out like a multi touch surface can.
Page 15
Screen Shots
This is a screen shot of the application: