I see creating a practical application using OpenVibe in 3 steps.
1. The designer is used to build and test a scenario.
2. My scenario can be opened programmatically.
To open and execute a scenario some kind of a Helper class (or piece of code) must provided to facilitate this process.
3. I write my own UI (based on real world needs) wrapping step 2 (step 2 wraps step 1).
My question actually concerns step 2 - is it possible to easily configure and execute a scenario programmatically (not using the designer)? It is a kind of C++ API question to some extend.
Thanks,
Anton
Using OpenVibe as a framework
Re: Using OpenVibe as a framework
Hi Anton,
It is the Designer that makes the links between every plugins or kernel modules, from loading a scenario to actually process the signal.
If you plan to create your own application you will have to rely on these modules and recreate these links.
However, with a recent update we made, you can execute the Designer "programmatically" so to speak.
If you execute the Designer with the argument --help you will get:
As you can see you can build scripts that launch the designer with no GUI and execute a scenario. It may sounds useful for what you want to achieve.
Reminder : in order to work, the Designer (or any OpenViBE application) need a proper environment to run. You must execute win32-init_env_command or linux-init_env_command prior to executing the application itself.
This answer the "execution" part...
For the "configuration" part, what you can do with the current state of OpenViBE is (re)writing the configuration files that the boxes in your scenarios are loading at each scenario startup.
Anyway, not using the Designer is possible. It requires re-writing a whole application, that is somehow the designer runtime part without the authoring tool.
A lot of work ahead in my opinion.
BR
Laurent-
If we look at the current state of the OpenViBE platform, any signal processing is done with the Designer.is it possible to easily configure and execute a scenario programmatically (not using the designer)? It is a kind of C++ API question to some extend.
It is the Designer that makes the links between every plugins or kernel modules, from loading a scenario to actually process the signal.
If you plan to create your own application you will have to rely on these modules and recreate these links.
However, with a recent update we made, you can execute the Designer "programmatically" so to speak.
If you execute the Designer with the argument --help you will get:
Code: Select all
Possible switches :
--help : displays this help message and exits
--open filename : opens a scenario (see also --no-session-management)
--play filename : plays the opened scenario (see also --no-session-management)
--play-fast filename : plays fast forward the opened scenario (see also --no-session-management)
--no-gui : hides the designer graphical user interface (assumes --no-color-depth-test)
--no-check-color-depth : does not check 24/32 bits color depth
--no-session-management : neither restore last used scenarios nor saves them at exit
Reminder : in order to work, the Designer (or any OpenViBE application) need a proper environment to run. You must execute win32-init_env_command or linux-init_env_command prior to executing the application itself.
This answer the "execution" part...
For the "configuration" part, what you can do with the current state of OpenViBE is (re)writing the configuration files that the boxes in your scenarios are loading at each scenario startup.
Anyway, not using the Designer is possible. It requires re-writing a whole application, that is somehow the designer runtime part without the authoring tool.
A lot of work ahead in my opinion.
What do you mean by "real world needs" ?3. I write my own UI (based on real world needs) wrapping step 2 (step 2 wraps step 1).
BR
Laurent-
Re: Using OpenVibe as a framework
Thanks Laurent. You got the idea right.
So my GUI application (currently) must execute the Designer as a command line application. But then I need the output of the Designer. I will need the result in real time - which is equivalent to as fast as possible.
1. One way to go is create a box in the Designer that outputs the result to stdout of the Designer. Then I can asynchronously read stdout from .NET using the documentation below:
http://msdn.microsoft.com/en-us/library ... dline.aspx
2. My second option will be to create a box that acts as a HTTP server which will be streaming the result. Then I will connect from my .NET application to this HTTP server.
Am I in the right direction?
Thanks,
Anton
So my GUI application (currently) must execute the Designer as a command line application. But then I need the output of the Designer. I will need the result in real time - which is equivalent to as fast as possible.
1. One way to go is create a box in the Designer that outputs the result to stdout of the Designer. Then I can asynchronously read stdout from .NET using the documentation below:
http://msdn.microsoft.com/en-us/library ... dline.aspx
2. My second option will be to create a box that acts as a HTTP server which will be streaming the result. Then I will connect from my .NET application to this HTTP server.
Am I in the right direction?
Thanks,
Anton
Re: Using OpenVibe as a framework
Hi Anton,
OpenViBE includes 4 boxes that can be useful for you, depending on your needs. All of them use VRPN protocol.
- Analog VRPN server : makes available values outputed by openvibe to the outside world. the external application has to implement a VRPN client that connects to the openvibe server. Communication is through TCP/IP if I remember well, anyway it works through network.
- Analog VRPN client : same protocol, but client side. Openvibe receives values when connecting this box to an external server.
- Button VRPN server : same protocol, but for 2-state buttons. Any client connected is notified when a button is turned on or off in openvibe.
- Button VRPN client : client side. the openvibe box is notified when a server switches the buttons.
If this is not fitting your needs, I guess you can build your own client/server box, using whatever protocol you prefer.
VRPN is quiet simple to implement though.
Hope this helps,
Laurent-
OpenViBE includes 4 boxes that can be useful for you, depending on your needs. All of them use VRPN protocol.
- Analog VRPN server : makes available values outputed by openvibe to the outside world. the external application has to implement a VRPN client that connects to the openvibe server. Communication is through TCP/IP if I remember well, anyway it works through network.
- Analog VRPN client : same protocol, but client side. Openvibe receives values when connecting this box to an external server.
- Button VRPN server : same protocol, but for 2-state buttons. Any client connected is notified when a button is turned on or off in openvibe.
- Button VRPN client : client side. the openvibe box is notified when a server switches the buttons.
If this is not fitting your needs, I guess you can build your own client/server box, using whatever protocol you prefer.
VRPN is quiet simple to implement though.
Hope this helps,
Laurent-
Re: Using OpenVibe as a framework
Seems like the command line parameters are not available in current stable download version: 10.1.
SVN version supports them though.
The thing is that I can not see which OpneVibe version I am using. There is no version number in the about box. I simply remember downloading and installing 10.1. Please add version number.
SVN version supports them though.
The thing is that I can not see which OpneVibe version I am using. There is no version number in the about box. I simply remember downloading and installing 10.1. Please add version number.
Re: Using OpenVibe as a framework
Hi toncho !
------
@echo off
call dependencies\set-env.cmd
cd bin
OpenViBE-designer-dynamic.exe --play ..\share\openvibe-scenarios\box-tutorials\channel-selector.xml
pause
------
It works fine and opens the given scenario then plays it. Maybe you're using an old openvibe version...
Laurent-
When I modify the script openvibe-designer.cmd with :Seems like the command line parameters are not available in current stable download version: 10.1.
SVN version supports them though.
------
@echo off
call dependencies\set-env.cmd
cd bin
OpenViBE-designer-dynamic.exe --play ..\share\openvibe-scenarios\box-tutorials\channel-selector.xml
pause
------
It works fine and opens the given scenario then plays it. Maybe you're using an old openvibe version...
Indeed ! We'll add the version number in the "about" window for the future release. Thanks for the feedback !The thing is that I can not see which OpneVibe version I am using. There is no version number in the about box. I simply remember downloading and installing 10.1. Please add version number.
Laurent-
Re: Using OpenVibe as a framework
openvibe-designer.cmd should use "%1 %2 %3 %4 %5 %6" and pass the parameters to OpenViBE-designer-dynamic.exe
The SVN version "ov-designer.cmd" seems to do just that.
The SVN version "ov-designer.cmd" seems to do just that.
Re: Using OpenVibe as a framework
Ok I see what you mean.
Indeed the parameters of the script are not passed to the Designer .exe, we forgot to update the NSIS script that generates the windows installer and produce openvibe-designer.cmd.
It's corrected now and will be fixed for the next releases.
Thanks !
Laurent-
Indeed the parameters of the script are not passed to the Designer .exe, we forgot to update the NSIS script that generates the windows installer and produce openvibe-designer.cmd.
It's corrected now and will be fixed for the next releases.
Thanks !
Laurent-