Giter Site home page Giter Site logo

unity-plugin's People

Contributors

hoangphamemotiv avatar joedevon avatar l42aro avatar nguoithichkhampha avatar patemotiv avatar sondhemotiv avatar tungntemotiv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

unity-plugin's Issues

Need help in accessing mental command from a profile

We are unable to access mental commands from a trained profile.

Following function from DataStreamManager class printing only NEUTRAL command with 0 pow value.

    private void OnMentalCommandReceived(object sender, ArrayList data)
    {
        if (_mentalCommandLists == null || _mentalCommandLists.Count != data.Count)
        {
            UnityEngine.Debug.LogAssertion("OnMentalCommandReceived: Mismatch between data and label");
            return;
        }

        UnityEngine.Debug.Log("data count: " + data.Count);

        double time     = Convert.ToDouble(data[0]);
        string act      = Convert.ToString(data[1]);
        double pow      = Convert.ToDouble(data[2]);

        MentalCommandEventArgs comEvent = new MentalCommandEventArgs(time, act, pow);

        string comListsStr = "";

        foreach (var ele in _mentalCommandLists)
        {
            comListsStr += ele + " , ";
        }

        UnityEngine.Debug.Log("MentalCommand labels: " +comListsStr);
        UnityEngine.Debug.Log("MentalCommand datas : " +comEvent.Time.ToString() + " , " + comEvent.Act+ " , " + comEvent.Pow);
    }

Also with the help of BCITraining class, we are able to create a profile, and can also print the list of all available profiles, even from native emotive applications.

But we are not able to apply these trained commands in applications.

Thanks for help in advance.

injectMarkers function may not be set up

Hello,

I see in the Unity Emotiv plug-in that injecting markers into the recorded EEG data is marked as "To do." Will this functionality be added, or could I be given assistance in developing it myself?

Thank you!
C

BCI Training

Hello!

I am having some difficulties when I try to load a profile for using the mental commands. Like in the example, I first:

  • connect to the headset like in the unity example
  • then I subscribe to sys and com data streams
  • then I instantiate a new BCITraining object and call Init()
  • then I call GetDetectionInfo("mentalCommand");
  • then I call queryProfile where my profile is correctly found
  • and then I call LoadProfile() with the appropriate profile. But here I get a NullReferenceException in if (_profileLists.Contains(profileName))...

Also I am getting only the neutral state with power 0....

Am I missing something?

Error when setting up a new profile

Hi,
thanks for the Unity-plugin!
I´m trying to setup a new profile through my application. As in the readme written, LoadProfile(string) should look for a existing profile and if is not found, a new profile wil get created and loaded. If I try LoadProfile("whatever") I´m getting
An error received: Invalid Parameters. UnityEngine.Debug:Log (object) EmotivUnityPlugin.CortexClient:WebSocketClient_MessageReceived (object,WebSocket4Net.MessageReceivedEventArgs) (at Assets/EmotivPlugin/Src/CortexClient.cs:238)

and

MessageErrorRecieved :code -32602 message Invalid Parameters.method name setupProfile UnityEngine.Debug:Log (object) EmotivUnityPlugin.DataStreamProcess:MessageErrorRecieved (object,EmotivUnityPlugin.ErrorMsgEventArgs) (at Assets/EmotivPlugin/Src/DataStreamProcess.cs:298)

Also there should be a warning, that using the callbackfunctions to make changes on the UI elements, leads to a total stop of the app. For everybody: use the bools in the EmotivUnityItf instance like the example does in CheckButtonsInteractable ;-)

Looking forward to get some help here :-)

Mental Command

Hey,

I want to use the mental commands for my application using Unity... I subscribe to sys and com data streams and then I load my profile.... But how am I able to retrieve the current mental commands? I can't find a method in DataStreamManager.... I know that the current command is printed in OnMentalCommandReceived but how can I actually get to the commands?

The commands that I get seem very random.... Usually when I start the EmotivBCI App, it sometimes asks me to relax (I guess to get my current neutral mental command) with my eyes open and then with my eyes closed... Is there a way in Unity to do the same? And could it be that when I get the mental commands in unity that it doesn't actually use the profile as its basis?

Subscribe to EEG Datastream

Good evening! I am able to subscribe to the raw EEG data stream in Python. However, when I try to do it using the Emotiv Unity Plugin it does not work. I do the following.

  1. Define buf to hold the data
    double[][] buf = new double[14][];

  2. Define the dataStream List
    List dataStreamList = new List() {DataStreamName.EEG};

  3. Start Connect and Authorize
    DataStreamManager.Instance.StartAuthorize();

  4. Start the data stream.
    DataStreamManager.Instance.StartDataStream(dataStreamList, "EPOCX-REDACTED");

  5. Call get EEG data.
    DataStreamManager.Instance.GetEEGData(Channel_t.CHAN_AF3);

  6. Output to console
    Debug.Log(buf[(int)Channels.AF3]);

The problem is that Each time buf[(int)Channels.AF3] contains null. This is the same for all sensors.

LoadProfile()

I have created a Unity Project and imported the Unity Plugin from the Emotiv Github page. The LoadProfile() function does not Load a Profile. Instead it returns the error, "NullReferenceException: Object reference not set to an instance of an object." My C# script is attached and a picture of the console with the associated errors.
LoadProfile

Test Script

Extremely lost

Hi all, I would like to integrate this API into my unity 3d environment as part of my university project. Upon reading the steps listed in the README, I'm completely lost. May I seek assistance or if there is a video guidance on the integration of this API into an external unity workspace? If no, other than importing the entire repository as a plugin into my unity work space, which is the specific line I am supposed to change (for the clientId etc)? And after which, is there additional coding required on my end in order to interact with this plugin?

In addition, I would like to know if it is feasible to use the specific parameter within the performance metrics (met) to be served as a control mechanism (ie: Focus parameter into a lighting object) to control the lighting environment. If not, would it simply meant that I can only use the entire met parameter itself to perform this interaction that I wanted?

Hope to seek any advice soon!

How to I define mental commands?

May someone please guide me?
My unity app is connected to the emotiv app. However, nothings shows on the emotiv app. I cannot create mental commands.
I need to classify my data into three categories using machine learning and return the output back to unity.
How can I do so please ?

Accessing raw EEG signal from Emotiv in Unity

Hello,

Is it possible to both Record and Subscribe to the EEG data stream? I am currently recording EEG data, and I have started a session correctly.

However, when I try to subscribe to the data, so that I can GetEEGData, the Unity console says that "A session has not been activated"

My second question is: with GetEEGData, is there already processing on this data, or is this the raw EEG signal?

Additionally, with GetAlphaPower, is EEG preprocessing AND alpha power extraction already applied to this EEG data?

Many thanks,
C

Loading profiles from EmotivBCI into Unity Application

Hi,
I am a student looking to use this plugin in a research project however I am currently encountering issues when trying to load profiles that have been trained through EmotivBCI into my Unity application. I have been encountering an error saying that:

"This profile was loaded by another application. Your application does not have access to this profile." and is accompanied by error code 32046.

I was wondering why this is happening and can confirm that my application IS registered. I am able to successfully connect to a headset, subscribe to data streams and start records. I am also able to create profiles through my unity application. However I am wondering if there was a way to load profiles that I have trained through EmotivBCI into my Unity application.

Any help would be greatly appreciated. (I apologise if this is not the right place to ask for development assistance. If there is a better place to seek support on this topic, feel free to let me know and remove this issue).

Error after load-unload-load a profile

Hi,

I'm a building an application using your Unity plugin. I'm having some issues trying to do the following operation:

LoadProfile - UnloadProfile - LoadProfile (again)

Once I call UnloadProfile, I figured out that the data stream stops.

I'm doing this operation with the same username and after to test how your API works, but this operation throws an error:

imagen

I'm doing just the following operation after creating an instance of BCITraining once I pass through onHeadsetConnected event:

imagen

I don't know if I misunderstood part of the API.

Thanks!

Do I need a pro license?

I got this error,when connecting
MessageErrorRecieved :code -32002 message Invalid License Key.method name authorize

Video Tutorial

Is it possible to have an official video tutorial made for this?

  • Setting up the hardware
  • Connecting with Unity (including installation of packages)
  • Based on brain activity do call functions

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.