Neurosky Demo
- Overview
- Download Links
- User Manual
- Documentation
Neurosky Unity3D Demo Package
The neurosky Demo package is a package to be used in Unity3D. This demo allows you to fully integrate your neurosky with unity3D as long as you use the Reh@panel protocol to send its information. There is already a tool (Reh@panel) that sends the neurosky information using this protocol.
Developed by: Tatiana Vieira, Yuri Almeida
Neurosky Demo Download & Requirements
Here you can download all the tools you will need to reproduce our demo with your own leapmotion.Requirements to use the package
- Make sure you have the Neurosky SDK installed – Download Link here
- Plug in your Neurosky to the PC
- Make sure that it is sending information by UDP to port 1202 (To change this port check our User Manual section). You can use the Reh@panel to do this – Download Link here
- Run the Unity3D scene
Download Links
Latest Stable Version: Latest Stable Version (build):- Demos Launcher_01_2018 (you don’t need Unity3D to run this example)
Neurosky Demo User Manual
Importing the package
- Create a new project
- Import the package NeuroskyDemo.unitypackage
- Assets -> Import package -> Custom Package
Requirements to use the package
- Make sure you have the Neurosky SDK installed – Download Link here
- Plug in your Neurosky to the PC
- Make sure that it is sending information by UDP to port 1202 (To change this port see below).
- You can use the Reh@panel to do this – Download Link here
Testing the scene
- Open the Scene
- Neurehab -> Demo Neurosky-> Scenes -> NeuroskyDemo
- Make sure you fulfill all the requirements
- Press Play
1 – UDP | Gameobject that has the UDP connection Information. You can change the UDP port here |
2 – Components | Gameobject that has the Neurosky.cs script |
3 – Leapmotion Prefab | Prefab that has the NeuroskyUnity.cs script. This prefab will only appear in the scene when you have pressed Play |
1 – Number Of Samples | The number of data samples to save for each data input. In the end returns the average of that data input. |
2 – Position Multiplier | Multiplies the position that is receiving for this value. This is useful when you have a game world scale that differs from the real world. |
3 – Prefab parent | The Gameobject parent where the device prefabs are going to be instantiated. Each instantiated prefab represents a Neurosky that is sending data by UDP. |
4 – Prefabs | The list of prefabs that can be instantiated. |
5 – Time to Live | The maximum time in seconds that a prefab can wait for new data before it is destroyed. |
1 – Available Data | All the data that we are receiving from a Neurosky. Note that the Gameobject Unity references are for this specific demo. You don’t need to have bars to represent the neurosky information |
The data is accessed through the NeuroskyUnity.cs script. If you open this script, in the UpdateGuiValues function you will notice that the Neurosky prefab values are updated there.
private void UpdateGuiValues() { BarDelta.fillAmount = GenericDeviceData.GetFloat(Neurosky.delta.ToString()) GenericDeviceData.GetFloat("max_" + Neurosky.delta); ... }
To be able to access any data that the Neurosky is sending, you will need to know two things: the label of the information you want to access and the type of that information. Then, using the NeuroskyUnity.cs script, you can find all this information by accessing the GenericDeviceData Dictionaries as shown below:
GenericDeviceData.Get[INFORMATION_TYPE](“[INFORMATION_LABEL]”);For example, to access the Neurosky meditation value which is labeled as ‘meditation ’ and is of the type float, you can:
GenericDeviceData.GetFloat(“meditation”)
Current Neurosky protocol values
Information Label [INFORMATION_LABEL] | Information Type [INFORMATION_TYPE] |
delta | Value (float) |
theta | Value (float) |
lowalpha | Value (float) |
highalpha | Value (float) |
lowbeta | Value (float) |
highbeta | Value (float) |
lowgamma | Value (float) |
highgamma | Value (float) |
attention | Value (float) |
meditation | Value (float) |
signal | Value (float) |