Building my own driver
Building my own driver
Hello,
I would like to create a new driver.
The documentation is clear, except for one thing : how can I use the driver I write ?
To be more precise, I don't know how to compile the c++ code and make the Acquisition server recognise it.
Could you please either explain it to me or point me to the part of the documentation I may have missed ?
Best regards.
Lucie
I would like to create a new driver.
The documentation is clear, except for one thing : how can I use the driver I write ?
To be more precise, I don't know how to compile the c++ code and make the Acquisition server recognise it.
Could you please either explain it to me or point me to the part of the documentation I may have missed ?
Best regards.
Lucie
Re: Building my own driver
Hi,
In 5 steps :
1) Download SVN source (or latest stable source)
2) Build the source (with the script in the folder */scripts/) to obtain an IDE project (I use VS2008).
There is a doc for that on the website and some tutos on the forum.
3) In the project "OpenVibe-acquisition-server-dynamic" you can add the source of your driver class.
3 bis) I prefer to manually add the source in a folder like :
*/openvibe-applications/acquisition-server/tags/X.X.X/src/{myDriverName}/
And include the .cpp and .h manually in the project.
4) Add this line after line 300 :
5) Build ALL the solution.
This is just the way I think you can add a driver. But did'nt try it yet and I did not find a doc or a more simple way.
{myDriverName} : name of your driver. e.g. GenericOscillator
In 5 steps :
1) Download SVN source (or latest stable source)
2) Build the source (with the script in the folder */scripts/) to obtain an IDE project (I use VS2008).
There is a doc for that on the website and some tutos on the forum.
3) In the project "OpenVibe-acquisition-server-dynamic" you can add the source of your driver class.
3 bis) I prefer to manually add the source in a folder like :
*/openvibe-applications/acquisition-server/tags/X.X.X/src/{myDriverName}/
And include the .cpp and .h manually in the project.
4) Add this line after line 300 :
Code: Select all
m_vDriver.push_back(new CDriver{myDriverName}(*m_pDriverContext));
This is just the way I think you can add a driver. But did'nt try it yet and I did not find a doc or a more simple way.
{myDriverName} : name of your driver. e.g. GenericOscillator
Naëm Baron
CV : http://bee-oh.esiea-ouest.fr/baron/index.xml
CV : http://bee-oh.esiea-ouest.fr/baron/index.xml
Re: Building my own driver
Thanks !
I am on Linux, I will try to adapt this solution and post an update soon.
I am on Linux, I will try to adapt this solution and post an update soon.
Re: Building my own driver
Dear Lucie,
welcome on this board and thank you for your interest in OpenViBE.
Indeed, Laurent who developed his first driver in september / october just in the same room as me already told me exactly what you are just saying... I just didn't update the documentation, sorry...
So if you want to test / use your driver, just put it in the openvibe-applications/acquisition-server/trunc/src/your-driver-name.
Then edit the openvibe-applications/acquisition-server/trunc/src/ovasCAcquisitionServer.cpp and see what is done for the other drivers. It is as easy as that.
Hope to receive a patch for your contribution soon What acquisition device are you using ?
Best regards,
Yann
PS: hey nbaron, you are faster than me - I'll be able to leave on holidays soon, thanks
welcome on this board and thank you for your interest in OpenViBE.
Indeed, Laurent who developed his first driver in september / october just in the same room as me already told me exactly what you are just saying... I just didn't update the documentation, sorry...
So if you want to test / use your driver, just put it in the openvibe-applications/acquisition-server/trunc/src/your-driver-name.
Then edit the openvibe-applications/acquisition-server/trunc/src/ovasCAcquisitionServer.cpp and see what is done for the other drivers. It is as easy as that.
Hope to receive a patch for your contribution soon What acquisition device are you using ?
Best regards,
Yann
PS: hey nbaron, you are faster than me - I'll be able to leave on holidays soon, thanks
Re: Building my own driver
Thank you, it works !
I just compiled a dummy driver which is the Generic oscillator with another name. I can see it in the pop up list when I use the acquisition server.
I just have to write the actual code
I am trying to write a driver for a gTec product : the gMOBIlab+.
Is there a way to run Cmake only in the src directory where the code of my driver lies ? I currently run linux-build, which takes some time verifying everything is already built.
Even if running Cmake only in this directory is not enough to get OpenVibe to recognize the driver, I would like to do it in order to check for syntax errors before launching linux-build which, as I said, takes some time to run.
Best Regards
I just compiled a dummy driver which is the Generic oscillator with another name. I can see it in the pop up list when I use the acquisition server.
I just have to write the actual code
I am trying to write a driver for a gTec product : the gMOBIlab+.
Is there a way to run Cmake only in the src directory where the code of my driver lies ? I currently run linux-build, which takes some time verifying everything is already built.
Even if running Cmake only in this directory is not enough to get OpenVibe to recognize the driver, I would like to do it in order to check for syntax errors before launching linux-build which, as I said, takes some time to run.
Best Regards
Re: Building my own driver
Good morning,
It looks like the documentation disagrees with the code of the other drivers.
I assume that the code of the other drivers is correct. Indeed, doing as in the documentation leads to a failure when compiling and a grep on all the source files for OpenViBEAcquisitionServer::boolean returns nothing.
The differences are :
Best regards,
Lucie
It looks like the documentation disagrees with the code of the other drivers.
I assume that the code of the other drivers is correct. Indeed, doing as in the documentation leads to a failure when compiling and a grep on all the source files for OpenViBEAcquisitionServer::boolean returns nothing.
The differences are :
- Classes for drivers are put in the namespace OpenViBEAcquisitionServer (I don't know why exactly, but this is not mentioned in the doc)
- OpenViBEAcquisitionServer::boolean and OpenViBEAcquisitionServer::uint32 do not exist, everybody use OpenViBE::boolean and OpenViBE::uint32 instead.
Best regards,
Lucie
Re: Building my own driver
Dear Lucie,
I updated the documentation page with your remarks from today and yesterday. I also put the IDriverContext object in the sample code as it did not exist when the doc was first written.
See the updated page.
Thank you,
Yann
I updated the documentation page with your remarks from today and yesterday. I also put the IDriverContext object in the sample code as it did not exist when the doc was first written.
See the updated page.
Thank you,
Yann
Re: Building my own driver
Hello,
I have a problem during the link edition : I have to use an external library which is located in /usr/lib/gMOBIlabplus.so and I don't know how to make the linker find it. I suppose that I have to modify the Cmake file but I don't know how.
Thanks for your help,
Lucie
I have a problem during the link edition : I have to use an external library which is located in /usr/lib/gMOBIlabplus.so and I don't know how to make the linker find it. I suppose that I have to modify the Cmake file but I don't know how.
Thanks for your help,
Lucie
Re: Building my own driver
Hello,
Sorry for that, I finally found what to do to add a new library !
Here is my code :
Best regards,
Lucie
Sorry for that, I finally found what to do to add a new library !
Here is my code :
Code: Select all
[size=85]IF(UNIX)
FIND_LIBRARY(gMOBIlabplus_LIBRARY NAMES gMOBIlabplus PATH /usr/lib /usr/local/lib)
IF (gMOBIlabplus_LIBRARY)
SET(gMOBIlabplus_FOUND TRUE)
ELSE(gMOBIlabplus_LIBRARY)
MESSAGE(STATUS " [FAILED] lib gMobiLabPlus")
ENDIF (gMOBIlabplus_LIBRARY)
IF (gMOBIlabplus_FOUND)
IF (NOT gMOBIlabplus_FIND_QUIETLY)
MESSAGE(STATUS " [ OK ] Third party lib ${gMOBIlabplus_LIBRARY}")
TARGET_LINK_LIBRARIES(${PROJECT_NAME}-dynamic ${gMOBIlabplus_LIBRARY} )
ENDIF (NOT gMOBIlabplus_FIND_QUIETLY)
ELSE (gMOBIlabplus_FOUND)
IF (gMOBIlabplus_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find gMobiLab+")
ENDIF (gMOBIlabplus_FIND_REQUIRED)
ENDIF (gMOBIlabplus_FOUND)
ENDIF(UNIX)[/size]
Lucie
Re: Building my own driver
Dear Lucie,
what's up with the g.Mobilab driver ?
Yann
what's up with the g.Mobilab driver ?
Yann
Re: Building my own driver
Hi everybody
In this moment i am working with research in the
area of BCI, for this reason iḿ trying to use gMOBIlab with OpenVIBE,
but actually i have i problem and I did not obtained that the
Acquisition server recognize me the gMOBIlab.
I actually think that the problem it has to do with Cmake file that seeking for the libraries of
gMOBIlab. When I make the construction of openvibe, i saw that
couldn't find the libraries, even though I did the installation of
gMOBIlab software in version 1.11.00, which I think is the last. I
think that maybe there is an incompatibility issue with the latest
version of the software .... I wonder if you have any idea that could
do.
Thanks,
In this moment i am working with research in the
area of BCI, for this reason iḿ trying to use gMOBIlab with OpenVIBE,
but actually i have i problem and I did not obtained that the
Acquisition server recognize me the gMOBIlab.
I actually think that the problem it has to do with Cmake file that seeking for the libraries of
gMOBIlab. When I make the construction of openvibe, i saw that
couldn't find the libraries, even though I did the installation of
gMOBIlab software in version 1.11.00, which I think is the last. I
think that maybe there is an incompatibility issue with the latest
version of the software .... I wonder if you have any idea that could
do.
Thanks,
Re: Building my own driver
Hi lfsuarez,
Which OS are you working on ?
For the record, the gMobilabPlus driver is only compatible with Linux (a contribution from Lucie, as you can see in this topic)
If at compilation time the build process failed to find the gMobilabPlus API, take a look at the file
cmake-modules/FindThirdPartyGMobiLabPlusAPI.cmake
Maybe you will find some incoherence with your installation.
Please provide build log, OS, openvibe version etc. the more we have details, the more we can help !
Laurent
Which OS are you working on ?
For the record, the gMobilabPlus driver is only compatible with Linux (a contribution from Lucie, as you can see in this topic)
If at compilation time the build process failed to find the gMobilabPlus API, take a look at the file
cmake-modules/FindThirdPartyGMobiLabPlusAPI.cmake
Maybe you will find some incoherence with your installation.
Please provide build log, OS, openvibe version etc. the more we have details, the more we can help !
Laurent
Re: Building my own driver
Hi laurent ... thanks for your help
The OS on which i'm working on it's ubuntu 11.10, the version of openvibe 0.13.1 and I have also installed the libraries of g.MOBIlabPlus for linux ..the version 1.11.00. I have done my own tests, with the demo that the gMOBIlab brings and the connection has performed without problems.
Laurent i was already reviewing the cmake file you specified, and what I found there was a difference in the library file name that is looking at findlibrary function. I found in the /usr/lib a library with the name libgmobilabplusapi.so.1.11 libgmobilabplusapiso.so.1.11.00. This is the content of the cmake file currently
#
# The gMobilab driver was contributed
# by Lucie Daubigney from Supelec Metz
#
# ---------------------------------
# Finds GTecMobiLabPlus+
# Adds library to target
# Adds include path
# ---------------------------------
IF(UNIX)
FIND_LIBRARY(gMOBIlabplus_LIBRARY NAMES gMOBIlabplus PATHS /usr/lib /usr/local/lib)
IF(gMOBIlabplus_LIBRARY)
MESSAGE(STATUS " Found GMobiLabPlusAPI...")
MESSAGE(STATUS " [ OK ] lib ${gMOBIlabplus_LIBRARY}")
ADD_DEFINITIONS(-DTARGET_HAS_ThirdPartyGMobiLabPlusAPI)
TARGET_LINK_LIBRARIES(${PROJECT_NAME}-dynamic ${gMOBIlabplus_LIBRARY} )
ELSE(gMOBIlabplus_LIBRARY)
MESSAGE(STATUS " FAILED to find : GMobiLabPlusAPI...")
ENDIF(gMOBIlabplus_LIBRARY)
ENDIF(UNIX)
Actually I'm not sure how I could modify the cmake, but i made some test changed the name of the library who is looking for ... and practically did the installation again, without getting new results i still receiving this message: FAILED to find : GMobiLabPlusAPI...
also he didn't find BLiFF++,
I really dont know what else I can do ...
The OS on which i'm working on it's ubuntu 11.10, the version of openvibe 0.13.1 and I have also installed the libraries of g.MOBIlabPlus for linux ..the version 1.11.00. I have done my own tests, with the demo that the gMOBIlab brings and the connection has performed without problems.
Laurent i was already reviewing the cmake file you specified, and what I found there was a difference in the library file name that is looking at findlibrary function. I found in the /usr/lib a library with the name libgmobilabplusapi.so.1.11 libgmobilabplusapiso.so.1.11.00. This is the content of the cmake file currently
#
# The gMobilab driver was contributed
# by Lucie Daubigney from Supelec Metz
#
# ---------------------------------
# Finds GTecMobiLabPlus+
# Adds library to target
# Adds include path
# ---------------------------------
IF(UNIX)
FIND_LIBRARY(gMOBIlabplus_LIBRARY NAMES gMOBIlabplus PATHS /usr/lib /usr/local/lib)
IF(gMOBIlabplus_LIBRARY)
MESSAGE(STATUS " Found GMobiLabPlusAPI...")
MESSAGE(STATUS " [ OK ] lib ${gMOBIlabplus_LIBRARY}")
ADD_DEFINITIONS(-DTARGET_HAS_ThirdPartyGMobiLabPlusAPI)
TARGET_LINK_LIBRARIES(${PROJECT_NAME}-dynamic ${gMOBIlabplus_LIBRARY} )
ELSE(gMOBIlabplus_LIBRARY)
MESSAGE(STATUS " FAILED to find : GMobiLabPlusAPI...")
ENDIF(gMOBIlabplus_LIBRARY)
ENDIF(UNIX)
Actually I'm not sure how I could modify the cmake, but i made some test changed the name of the library who is looking for ... and practically did the installation again, without getting new results i still receiving this message: FAILED to find : GMobiLabPlusAPI...
also he didn't find BLiFF++,
I really dont know what else I can do ...