Mind controlled Robot

Typically: "How do I... ", "How can I... " questions
antoo
Posts: 2
Joined: 08 Jan 2015, 13:31

Mind controlled Robot

Hi,

I have an important project to finish soon, I am supposed to control a manipulator DoF 7 with open vibe, an other software able to process EEG ( electrical signals from the brain). I am supposed to write a client in C++ on Vrep in order to retreive data sent by open vibe. How should I do that ? Using a plug in seems to be the best way but does some other easier option exist ? Should I just use the skeleton available on the install folder and write my code in it ?

Eric
Posts: 186
Joined: 11 Feb 2013, 16:39

Re: Mind controlled Robot

Hi

Can you detail a little bit more on the architecture? How do you do to retrieve data sent by openVIBE?
How are you using openVIBE? as an application or as a library? If it is as an application, you can either use an ad-hock socket communication with V-REP or a remoteAPI. If it is as a library, then a plugin is recommended.

Cheers

Eric

antoo
Posts: 2
Joined: 08 Jan 2015, 13:31

Re: Mind controlled Robot

Thank you very much for helping me I am kind of lost as I am not use to program that much !

Code: Select all

#include <iostream>

#include <vrpn_Button.h>
#include <vrpn_Analog.h>

void VRPN_CALLBACK vrpn_button_callback(void* user_data, vrpn_BUTTONCB button)
{
std::cout << "Button ID : " << button.button << " / Button State : " << button.state << std::endl;

if (button.button == 1)
{
*(bool*)user_data = false;
}
}

int main(int argc, char** argv)
{
/* flag used to stop the program execution */
bool running = true;

/* VRPN Button object */
vrpn_Button_Remote* VRPNButton;

/* Binding of the VRPN Button to a callback */
VRPNButton = new vrpn_Button_Remote( "openvibe_vrpn_button@localhost" );
VRPNButton->register_change_handler( &running, vrpn_button_callback );

/* The main loop of the program, each VRPN object must be called in order to process data */
while (running)
{
VRPNButton->mainloop();
}

return 0;
}
The code above is the client i am supposed to write on VREP
With open vibe, i created a server box which send a "a button" with states and id I need to retreive this id and button on VREP, so i think i am using open vibe as an application. It is a brain computer interface that must send button to vrep. But i am not sure, how could i know for sure if i am using it as library or not ?

coppelia