Journal of Automation, Mobile Robotics & Intelligent Systems VOLUME 12, N° 1 2018 Journal of Automation, Mobile Robotics & Intelligent Systems VOLUME 12, N° 1 2018

Tab. 2. Comparison of Virtual Laboratories Created Outside of FEI STU [12] ���������� ���� J���S����� �� ������ ��� S����� S��� �� ��� ������� have the following de�inition: ”We call it a virtual la- ���������� ��� ���������� �� M���� R������ ����� M�������� �������� boratory where the student interacts with the experi- Name Client Simulation ment, which is physically at distant from him or her of VL techno- techno- and not to demand any physical reality”. logy logy th th ��bm��ed: 15 December 2018; accepted: 15 March 2018 After explaining what is VL, look at the bene�its Tab.they 1. can Comparison bring. They of are Real, described Virtual and in the Remote Table 1. Laboratories [7] Weblab- AJAX, Web servi- Xilinx- Erich Stark, Erik Kučera, Pavol Bisták, Oto Haffner DEUSTO Flash, Java ces, Python, VHDL, Laboratory Advantages Disadvantages applets, LabVIEW, LabVIEW DOI: 10.14313/JAMRIS_1-2018/2 Type LabVIEW, Java, .NET, Remote C, C++ Abstract: boratories. It was important to keep on with different The paper demonstrates remote control of test experi- panel safety regulations to the possibility of personal injury ment in the virtual laboratory. This is a common problem, Real real data, in- time and place NCSLab AJAX, Flash PHP Matlab, Si- or damage to equipment. but another way can always be used to solve it. The paper teraction with restrictions, re- mulink �istance and lack of �inancial resources make real compares several exis�ng virtual laboratories and their real experi- quires schedu- ACT HTML, Java PHP Matlab, Si- experiments dif�icult to perform, especially in cases possible issues at present. To develop such a new solu�on ment, collabo- ling, expensive, applets mulink where it is necessary to have some advanced and so- JavaScript technology was used on both client and ser- rative work, supervision LabShare AJAX, Java Web servi- Java phisticated tools. Another encountered problem is the ver side using �ode.js run�me. The modern approach is interaction with required Sahara applets ces, Java lack of good teachers. Although at present there are al- a visuali�a�on of received data in using �i- supervisor iLab HTML, Webservices, LabVIEW ready online courses that provide instructional videos, croso� �olo�ens or another compa�ble device with �in- Virtual good for con- idealized data, Active .NET but it solves the problem only partially. Thanks to in- dows �ixed �eality pla�orm. cept expla- lack of colla- X, Java ternet experiments can be structured for visualization nation, no boration, no applets Keywords: virtual experiment, virtual laboratory, java- and control remotely. Nowadays, a lot of equipment al- time and place interaction with RECOLAB HTML PHP Matlab, Si- script, engine, , mixed reality ready provides an interface to connect computer and restrictions, real equipment mulink process data from it. Experimenting over the internet interactive SLD AJAX, Web servi- Matlab, Si- �. ��troduc�o� allows the use of resources, knowledge, software and medium, low HTML ces, PHP mulink data when physical experiments cannot [15]. cost In this paper, we discuss the creation of virtual la- Remote interaction with only ”virtual Practical exercises in the laboratory are an impor- boratory (VL). Before we describe the list of technolo- real equipment, presence” in the analysis of existing solutions we have done in the pre- tant part of the process of training with techni- gies to create VL, we must explain what we consider calibration, re- lab vious section. Our aim was to create a cross-platform cal background in general. Ancient Chinese philosop- under VL. Generally, we can say that VL is a computer alistic data, no solution using one programming language on client her Confucius once said: ”Tell me, and I will forget. program, where students interact with the experiment time and place and server side, which cannot be done with WCF or Show me, and I may remember. Involve me, and I by the computer via the Internet as it is depicted in the restrictions, COM technology as in the previous solutions. JMI is will understand” [20]. We know from experience that Fig. 1. medium cost only suitable for solutions where Java platform is used. man can learn in the fastest way when he tries things The server cannot also be used with LabVIEW techno- several times, and after that, he understands how it People often think that the main bene�it of a virtual logy or .NET (multi-platform version – .NET core is works. Unfortunately, you cannot always provide di- already under development). Client solutions such as rect access to real devices to perform the experiment laboratory is to replace the real one. But it is not. You cannot replace the experience of the real work with Flash, ActiveX and Java applets are no longer suppor- for researchers or students. There may be several is- ted2.3. in Components browsers, so of theirVirtual use Laboratory is not appropriate. sues: the higher price of laboratory equipment, work- the VL. Although VL is better than no experience. VL place safety (depending on the experiment), or lack of should not be seen as providing the maximum possible interaction2.�. ��is�n� experience. �olu�ons quali�ied assistants. There are plenty of existing laboratories, but usu- In recent years, the development of virtual machi- ally, it is not possible to guarantee compatibility bet- nes has increased mainly due to the technological evo- There are currently many different virtual and re- ween them, because there is not a solid standard. Any- lution of software engineering. The progress of mo- mote laboratories, which are used by foreign univer- way, it is always possible to identify the basic compo- dern technology gives us the better approach to solve sities for teaching or research. This paper brie�ly re- nents that virtual laboratories can use. Some of them new challenges while creating whether the virtual sy- views often used laboratories that are accessible over can be even used more times. stems for online teaching or speci�ic virtual labora- the Internet. A comparison of functionality and the use Components: tories where physical processes can be simulated. In of technology can be seen in the Table 2, where diffe- - The experiment itself experiments conducted in a virtual environment, it is Fig. 1. The difference between a face-to-face and rent virtual laboratories created in the world are sum- possible to share resources of this environment for - The device with possibility to control and acquiring remotely controlled experiments marized. more connected users who want to perform the same data There are also some examples from Faculty of Elec- experiment, which would not be possible on our com- trical Engineering and Information technology, Slovak - Laboratory server, which provides control, monito- puters. This makes virtual laboratory a good comple- University2.2. �isa��anta�e� of Technology of ��is�n� in Bratislava �olu�ons in the Table 3. ring and data processing of the experiment ment to study whether research, where you can try dif- A typical example is the simulation experiment, - Server providing connection between remote users ferent variations of the experiment without risk to he- where the student interacts with the web/app inter- and laboratory server, usually via the internet alth or destruction of the device. Later, experiments face. Another possibility is a remote-controlled expe- At the beginning of the design of a virtual labora- can2. Virtual be tested Laboratories on real devices, if necessary. riment where the student interacts with the real de- tory, it was appropriate to examine the possibilities - Web camera connected to a server, which can be vice via the computer interface, although he can be far of existing solutions. Avoiding various design issues is used for remote user as a visual and audible feed- away. This is the case when a virtual laboratory turns important. Alternatively, technologies that have been back on the actual status of the experiment At the time when the Internet was not yet wide- into a remote laboratory. used are already outdated. Nowadays, the develop- - Tools enabling multi-user audio, video and chat spread in use, the experiments were done in real la- When the web excludes the second option, so we ment of new technologies is incredibly fast. Such an communication

14 15 Journal of Automation, Mobile Robotics & Intelligent Systems VOLUME 12, N° 1 2018 Journal of Automation, Mobile Robotics & Intelligent Systems VOLUME 12, N° 1 2018

Tab. 2. Comparison of Virtual Laboratories Created Outside of FEI STU [12] ���������� ���� J���S����� �� ������ ��� S����� S��� �� ��� ������� have the following de�inition: ”We call it a virtual la- ���������� ��� ���������� �� M���� R������ ����� M�������� �������� boratory where the student interacts with the experi- Name Client Server Simulation ment, which is physically at distant from him or her of VL techno- techno- software and not to demand any physical reality”. logy logy th th ��bm��ed: 15 December 2018; accepted: 15 March 2018 After explaining what is VL, look at the bene�its Tab.they 1. can Comparison bring. They of are Real, described Virtual and in the Remote Table 1. Laboratories [7] Weblab- AJAX, Web servi- Xilinx- Erich Stark, Erik Kučera, Pavol Bisták, Oto Haffner DEUSTO Flash, Java ces, Python, VHDL, Laboratory Advantages Disadvantages applets, LabVIEW, LabVIEW DOI: 10.14313/JAMRIS_1-2018/2 Type LabVIEW, Java, .NET, Remote C, C++ Abstract: boratories. It was important to keep on with different The paper demonstrates remote control of test experi- panel safety regulations to the possibility of personal injury ment in the virtual laboratory. This is a common problem, Real real data, in- time and place NCSLab AJAX, Flash PHP Matlab, Si- or damage to equipment. but another way can always be used to solve it. The paper teraction with restrictions, re- mulink �istance and lack of �inancial resources make real compares several exis�ng virtual laboratories and their real experi- quires schedu- ACT HTML, Java PHP Matlab, Si- experiments dif�icult to perform, especially in cases possible issues at present. To develop such a new solu�on ment, collabo- ling, expensive, applets mulink where it is necessary to have some advanced and so- JavaScript technology was used on both client and ser- rative work, supervision LabShare AJAX, Java Web servi- Java phisticated tools. Another encountered problem is the ver side using �ode.js run�me. The modern approach is interaction with required Sahara applets ces, Java lack of good teachers. Although at present there are al- a visuali�a�on of received data in mixed reality using �i- supervisor iLab HTML, Webservices, LabVIEW ready online courses that provide instructional videos, croso� �olo�ens or another compa�ble device with �in- Virtual good for con- idealized data, Active .NET but it solves the problem only partially. Thanks to in- dows �ixed �eality pla�orm. cept expla- lack of colla- X, Java ternet experiments can be structured for visualization nation, no boration, no applets Keywords: virtual experiment, virtual laboratory, java- and control remotely. Nowadays, a lot of equipment al- time and place interaction with RECOLAB HTML PHP Matlab, Si- script, Unity engine, virtual reality, mixed reality ready provides an interface to connect computer and restrictions, real equipment mulink process data from it. Experimenting over the internet interactive SLD AJAX, Web servi- Matlab, Si- �. ��troduc�o� allows the use of resources, knowledge, software and medium, low HTML ces, PHP mulink data when physical experiments cannot [15]. cost In this paper, we discuss the creation of virtual la- Remote interaction with only ”virtual Practical exercises in the laboratory are an impor- boratory (VL). Before we describe the list of technolo- real equipment, presence” in the analysis of existing solutions we have done in the pre- tant part of the process of training people with techni- gies to create VL, we must explain what we consider calibration, re- lab vious section. Our aim was to create a cross-platform cal background in general. Ancient Chinese philosop- under VL. Generally, we can say that VL is a computer alistic data, no solution using one programming language on client her Confucius once said: ”Tell me, and I will forget. program, where students interact with the experiment time and place and server side, which cannot be done with WCF or Show me, and I may remember. Involve me, and I by the computer via the Internet as it is depicted in the restrictions, COM technology as in the previous solutions. JMI is will understand” [20]. We know from experience that Fig. 1. medium cost only suitable for solutions where Java platform is used. man can learn in the fastest way when he tries things The server cannot also be used with LabVIEW techno- several times, and after that, he understands how it People often think that the main bene�it of a virtual logy or .NET (multi-platform version – .NET core is works. Unfortunately, you cannot always provide di- already under development). Client solutions such as rect access to real devices to perform the experiment laboratory is to replace the real one. But it is not. You cannot replace the experience of the real work with Flash, ActiveX and Java applets are no longer suppor- for researchers or students. There may be several is- ted2.3. in Components browsers, so of theirVirtual use Laboratory is not appropriate. sues: the higher price of laboratory equipment, work- the VL. Although VL is better than no experience. VL place safety (depending on the experiment), or lack of should not be seen as providing the maximum possible interaction2.�. ��is�n� experience. �olu�ons quali�ied assistants. There are plenty of existing laboratories, but usu- In recent years, the development of virtual machi- ally, it is not possible to guarantee compatibility bet- nes has increased mainly due to the technological evo- There are currently many different virtual and re- ween them, because there is not a solid standard. Any- lution of software engineering. The progress of mo- mote laboratories, which are used by foreign univer- way, it is always possible to identify the basic compo- dern technology gives us the better approach to solve sities for teaching or research. This paper brie�ly re- nents that virtual laboratories can use. Some of them new challenges while creating whether the virtual sy- views often used laboratories that are accessible over can be even used more times. stems for online teaching or speci�ic virtual labora- the Internet. A comparison of functionality and the use Components: tories where physical processes can be simulated. In of technology can be seen in the Table 2, where diffe- - The experiment itself experiments conducted in a virtual environment, it is Fig. 1. The difference between a face-to-face and rent virtual laboratories created in the world are sum- possible to share resources of this environment for - The device with possibility to control and acquiring remotely controlled experiments marized. more connected users who want to perform the same data There are also some examples from Faculty of Elec- experiment, which would not be possible on our com- trical Engineering and Information technology, Slovak - Laboratory server, which provides control, monito- puters. This makes virtual laboratory a good comple- 2.2.University �isa��anta�e� of Technology of ��is�n� in Bratislava �olu�ons in the Table 3. ring and data processing of the experiment ment to study whether research, where you can try dif- A typical example is the simulation experiment, - Server providing connection between remote users ferent variations of the experiment without risk to he- where the student interacts with the web/app inter- and laboratory server, usually via the internet alth or destruction of the device. Later, experiments face. Another possibility is a remote-controlled expe- At the beginning of the design of a virtual labora- can2. Virtual be tested Laboratories on real devices, if necessary. riment where the student interacts with the real de- tory, it was appropriate to examine the possibilities - Web camera connected to a server, which can be vice via the computer interface, although he can be far of existing solutions. Avoiding various design issues is used for remote user as a visual and audible feed- away. This is the case when a virtual laboratory turns important. Alternatively, technologies that have been back on the actual status of the experiment At the time when the Internet was not yet wide- into a remote laboratory. used are already outdated. Nowadays, the develop- - Tools enabling multi-user audio, video and chat spread in use, the experiments were done in real la- When the web excludes the second option, so we ment of new technologies is incredibly fast. Such an communication

14 15 Journal of Automation, Mobile Robotics & Intelligent Systems VOLUME 12, N° 1 2018 Journal of Automation, Mobile Robotics & Intelligent Systems VOLUME 12, N° 1 2018

Tab. 3. Comparison of Virtual Laboratories Created at FEI STU [13]

Year Author Simulation soft- �ata �low Client technology Server technology Meanwhile, it is necessary to prepare required for- ware mat of data for the web service. Thus, before sendingJSON- labthem to the REST API, it is suitable to wrap data to the JSON structure. We used the Matlab Fig. 3. Start Matlab in command line using shell.js 2011 R. Farkas Matlab, Simulink, JMI Sockets Java Java v1.2 [4]. library Real device A sequence of these two commands is requiredjson 2012 T. Borka Matlab, Simulink, WCF .NET, WPF .NET =to savejson(’result’, create the desired struct(’user’, JSON format userFromWeb, and send ’status’, it to Real device 4. Remote Control of Experiment ’Running’,Express.js ’data’, API. Create struct(’time’, JSON with timeFinal, the command ’you’, vyFinal, 4.1. Web Client Created with Angular Framework 2014 M. Kundrat Matlab, Simulink JMI, SOAP HTML, JS Tomcat, Java JSF, EJB3, MySQL ’y’, yFinal, ’�’ ��ine))) and trans�er it to the service with 2014 T. Cerveny Matlab, Simulink JMI, HTTP HTML, JS Jetty, Java response = webwrite (URL, JSON, options) 2015 S. Varga Matlab, Simulink COM, HTTP HTML, JS .NET, PHP get_param(model, ’SimulationSta- . Client application was created with the JavaScript tus’) framework Angular [6] (version 1.5.5). The role of the The command ”running” web client was to verify the functionality of the server - Client software controlling and representing data of is used to check current status of the simulation. status is ”stopped” that sends simulated data. The functionality has been the experiment [5] If the simulation is still running the status is . break veri�ied, and screens will be described speci�ically. It is important to realize which of these compo- As soon as the , the loop needs to be nents could be used, because for a creation of a vir- stopped using the keyword and we know that all tual laboratory it is not necessary to have them all. Al- 3.3.data Communi�a�on is transferred to �etween Node.js. Component� ternatively, others that are perfectly suited for a role can also be used. Sometimes it is used e.g. database server if experiments will be stored and processed la- One of the aspects of the individual components ter. It is also important to realize what type of VL we of the laboratory is communication. Although in each want to create. Certainly, differences will be in the de- component communication works differently, it is still sign of single-user as opposed to multi-user VL, even based on the HTTP protocol. with multiple experiments simultaneously. It should bear in mind as properly solve the scalability, poten- The sequence diagram in the Fig. 6 shows that tial safety issues, multi-user access and other possible communication starts from the web browser. The user issues. inserts the parameters of simulation, which are sent to 3. Architecture Proposal StarkLab via the REST web service. This service starts Fi�. �. �esi�n of �ommuni�a�on bet�een �omponents Matlab on the current with the ne- cessary �iles and simulation parameters. Meanwhile, As the main component, Node.js was selected. It the user waits until Matlab starts in the background. userFromWeb Simulation is immediately initialized and starts sen- is the server which handles communication between Fig. �. �ogin to �eb a��lica�on components of VL. The parts of architecture will be ex- last parameter is not necessary for si- ding data to StarkLab, which sends them directly to plained based on Fig. 2. The data are fetched periodi- mulation itself, but it is important to identify the user the web client from where the simulation has been ori- cally from Simulink into Matlab workspace. In the be- who runs the simulation. This makes it possible to as- ginated. All the received data will be re�lected in theSi- ginning, it was not sure whether it would be possible sign the simulation results in later processing from the mulationStatuschart, animation, == and ”running” table in the web browser. This Fig. 4 shows login page for web client application. to achieve to run multiplatform soft real-time Simu- database.3.2. Experiment Handler sequence is repeated until the condition contains It is authenticated against LDAP server of Slovak Uni- link basedReal-Time simulations. Pacer Because only Windows based . After stopping the simu- versity of Technology. solution was found directly from MathWorks. For our lation, the client sends a request to save data through The details of the login process via LDAP is not solution, [19] was used that allows us The second Matlab �ile is a handler code sending StarkLab directly into the document database Mon- interesting for this part of the paper. After success- to run simulations in soft real-time even under MacOS the data to Node.js. Because of its length of implemen- 3.4.goDB. Run Matlab from Command Line ful login, the dedicated page for the tested experi- or Linux. It is used to slow down the simulation to the tation, it is not possible to display the whole source ment is showed. Our experiment was projectile mo- soft real-time. webread code, so we describe only the key part. tion. It takes two parameters to run a simulation. In Towebwrite communicate with RESTful web service Matlab During initialization, the URL path is set for Ex- In the beginning, it was not clear how to run the http://localhost/matlabFig. 5 it can be seen the form that takes two para- R2015a uses the built-in rarely used function load_system(’projectile_motion’)press.js REST API where Matlab will send the data. simulation. It was necessary to determine whether meters to run a simulation. The page is redirected to and [14]. Firstly, the simulation must be run The model is preloaded usingprojectile_motion.mdl the Matlab function Node.js allows to carry out the commands of the ope- route, where the user is wai- through the web browser, after that data will be trans- . This function sear- rating system, respectively run programs. The simula- ting to see the data from Node.js REST API. ferred over socket.io library channel. These data will ches in the current folder for �ile tion was working in such a way that the Matlab was It redirects to the dashboard page, and the user has be shown in the graph of the web browser, and it is set_param(model,and sets it as the ’SimulationCommand’, top-level model. After ’Start’) this initial opened manually and we put there all the necessary to wait until the start of Matlab simulation. When it possible to save them to MongoDB database for later , simulation must be run using the command initialization �iles, then the simulation itself. But this starts, the user will see new data coming to graph, ani- 3.�.processing �e�erence (Fig. �imula�on2). �odel while . solution is not suf�icient in terms of automation and mation, and table in his web browser. This part could In the next block of the Matlab code, it is run- autonomy. be accelerated by a powerful server running with Mat- ning an in�inite loop that makes possible to It has been foundshell.js that Node.js can launch any soft- lab. For a development purpose, we used the simula- set_param(model,collect data from ’SimulationCommand’, the simulation to the ’WriteData- state until ware that can run through the terminal. To simplify Visualization of the received data is doneChart.js library on Fig. 7. Our implementation of chart implemented in Simulink that runs through the web provides such an option. was created using Angular directive with name interface. This simulation needs to be run with two �i- is called, which is looking for the current top- http://localhost/matlab/runThe sample of code in the Fig. 3 shows . Because of this approach (the les. The purpose of the �irst is the initialization of vari- level simulation. In the soft realtime the calculated how Matlab is started via Node.js route usage of Angular components), it can be used multiple ables needed to calculate the coordinates of the point. data are written to the Matlab workspace. Without . This route is called times with the same codebase. This experiment has three parameters. The �irst and that function, data would be written only after the si- immediately after the form was sent with initial In the beginning, it is necessary to get an element second parameter are initial values for simulation. The mulation ends. parameters of the experiment from the web browser. from DOM (Document Object Model) tree. Next step

16 17 Journal of Automation, Mobile Robotics & Intelligent Systems VOLUME 12, N° 1 2018 Journal of Automation, Mobile Robotics & Intelligent Systems VOLUME 12, N° 1 2018

Tab. 3. Comparison of Virtual Laboratories Created at FEI STU [13]

Year Author Simulation soft- �ata �low Client technology Server technology Meanwhile, it is necessary to prepare required for- ware mat of data for the web service. Thus, before sendingJSON- labthem to the REST API, it is suitable to wrap data to the JSON structure. We used the Matlab library Fig. 3. Start Matlab in command line using shell.js 2011 R. Farkas Matlab, Simulink, JMI Sockets Java Java v1.2 [4]. library Real device A sequence of these two commands is requiredjson 2012 T. Borka Matlab, Simulink, WCF .NET, WPF .NET =to savejson(’result’, create the desired struct(’user’, JSON format userFromWeb, and send ’status’, it to Real device 4. Remote Control of Experiment ’Running’,Express.js ’data’, API. Create struct(’time’, JSON with timeFinal, the command ’you’, vyFinal, 4.1. Web Client Created with Angular Framework 2014 M. Kundrat Matlab, Simulink JMI, SOAP HTML, JS Tomcat, Java JSF, EJB3, MySQL ’y’, yFinal, ’�’ ��ine))) and trans�er it to the service with 2014 T. Cerveny Matlab, Simulink JMI, HTTP HTML, JS Jetty, Java response = webwrite (URL, JSON, options) 2015 S. Varga Matlab, Simulink COM, HTTP HTML, JS .NET, PHP get_param(model, ’SimulationSta- . Client application was created with the JavaScript tus’) framework Angular [6] (version 1.5.5). The role of the The command ”running” web client was to verify the functionality of the server - Client software controlling and representing data of is used to check current status of the simulation. status is ”stopped” that sends simulated data. The functionality has been the experiment [5] If the simulation is still running the status is . break veri�ied, and screens will be described speci�ically. It is important to realize which of these compo- As soon as the , the loop needs to be nents could be used, because for a creation of a vir- stopped using the keyword and we know that all tual laboratory it is not necessary to have them all. Al- 3.3.data Communi�a�on is transferred to �etween Node.js. Component� ternatively, others that are perfectly suited for a role can also be used. Sometimes it is used e.g. database server if experiments will be stored and processed la- One of the aspects of the individual components ter. It is also important to realize what type of VL we of the laboratory is communication. Although in each want to create. Certainly, differences will be in the de- component communication works differently, it is still sign of single-user as opposed to multi-user VL, even based on the HTTP protocol. with multiple experiments simultaneously. It should bear in mind as properly solve the scalability, poten- The sequence diagram in the Fig. 6 shows that tial safety issues, multi-user access and other possible communication starts from the web browser. The user issues. inserts the parameters of simulation, which are sent to 3. Architecture Proposal StarkLab via the REST web service. This service starts Fi�. �. �esi�n of �ommuni�a�on bet�een �omponents Matlab on the current operating system with the ne- cessary �iles and simulation parameters. Meanwhile, As the main component, Node.js was selected. It the user waits until Matlab starts in the background. userFromWeb Simulation is immediately initialized and starts sen- is the server which handles communication between Fig. �. �ogin to �eb a��lica�on components of VL. The parts of architecture will be ex- last parameter is not necessary for si- ding data to StarkLab, which sends them directly to plained based on Fig. 2. The data are fetched periodi- mulation itself, but it is important to identify the user the web client from where the simulation has been ori- cally from Simulink into Matlab workspace. In the be- who runs the simulation. This makes it possible to as- ginated. All the received data will be re�lected in theSi- ginning, it was not sure whether it would be possible sign the simulation results in later processing from the mulationStatuschart, animation, == and ”running” table in the web browser. This Fig. 4 shows login page for web client application. to achieve to run multiplatform soft real-time Simu- database.3.2. Experiment Handler sequence is repeated until the condition contains It is authenticated against LDAP server of Slovak Uni- link basedReal-Time simulations. Pacer Because only Windows based . After stopping the simu- versity of Technology. solution was found directly from MathWorks. For our lation, the client sends a request to save data through The details of the login process via LDAP is not solution, [19] was used that allows us The second Matlab �ile is a handler code sending StarkLab directly into the document database Mon- interesting for this part of the paper. After success- to run simulations in soft real-time even under MacOS the data to Node.js. Because of its length of implemen- 3.4.goDB. Run Matlab from Command Line ful login, the dedicated page for the tested experi- or Linux. It is used to slow down the simulation to the tation, it is not possible to display the whole source ment is showed. Our experiment was projectile mo- soft real-time. webread code, so we describe only the key part. tion. It takes two parameters to run a simulation. In Towebwrite communicate with RESTful web service Matlab During initialization, the URL path is set for Ex- In the beginning, it was not clear how to run the http://localhost/matlabFig. 5 it can be seen the form that takes two para- R2015a uses the built-in rarely used function load_system(’projectile_motion’)press.js REST API where Matlab will send the data. simulation. It was necessary to determine whether meters to run a simulation. The page is redirected to and [14]. Firstly, the simulation must be run The model is preloaded usingprojectile_motion.mdl the Matlab function Node.js allows to carry out the commands of the ope- route, where the user is wai- through the web browser, after that data will be trans- . This function sear- rating system, respectively run programs. The simula- ting to see the data from Node.js REST API. ferred over socket.io library channel. These data will ches in the current folder for �ile tion was working in such a way that the Matlab was It redirects to the dashboard page, and the user has be shown in the graph of the web browser, and it is set_param(model,and sets it as the ’SimulationCommand’, top-level model. After ’Start’) this initial opened manually and we put there all the necessary to wait until the start of Matlab simulation. When it possible to save them to MongoDB database for later settings, simulation must be run using the command initialization �iles, then the simulation itself. But this starts, the user will see new data coming to graph, ani- 3.�.processing �e�erence (Fig. �imula�on2). �odel while . solution is not suf�icient in terms of automation and mation, and table in his web browser. This part could In the next block of the Matlab code, it is run- autonomy. be accelerated by a powerful server running with Mat- ning an in�inite loop that makes possible to It has been foundshell.js that Node.js can launch any soft- lab. For a development purpose, we used the simula- set_param(model,collect data from ’SimulationCommand’, the simulation to the ’WriteData- state until ware that can run through the terminal. To simplify Visualization of the received data is doneChart.js library on Fig. 7. Our implementation of chart implemented in Simulink that runs through the web provides such an option. was created using Angular directive with name interface. This simulation needs to be run with two �i- is called, which is looking for the current top- http://localhost/matlab/runThe sample of code in the Fig. 3 shows . Because of this approach (the les. The purpose of the �irst is the initialization of vari- level simulation. In the soft realtime the calculated how Matlab is started via Node.js route usage of Angular components), it can be used multiple ables needed to calculate the coordinates of the point. data are written to the Matlab workspace. Without . This route is called times with the same codebase. This experiment has three parameters. The �irst and that function, data would be written only after the si- immediately after the form was sent with initial In the beginning, it is necessary to get an element second parameter are initial values for simulation. The mulation ends. parameters of the experiment from the web browser. from DOM (Document Object Model) tree. Next step

16 17 Journal of Automation, Mobile Robotics & Intelligent Systems VOLUME 12, N° 1 2018 Journal of Automation, Mobile Robotics & Intelligent Systems VOLUME 12, N° 1 2018

&ŝŐ͘ ϱ͘ WĂƌĂŵĞƚĞƌƐ ŽĨ ƐŝŵƵůĂƟŽŶ ͬ ŝŶŝƟĂů ǀĞůŽĐŝƚLJ ĂŶĚ ĂŶŐůĞ ŝŶ ĚĞŐƌĞĞƐ

Fig. �. �a�le of sa�ed simula�on for �urrently logged Fig. �. �rap� and �nima�on of pro�e��le mo�on in �x� user y� posi�on

direct view of a physical, real-world environment whose elements are augmented (or supplemented) by computer-generated sensory input such as sound, vi- deo, graphics or GPS data. is an overlay of content on the real world, but that content is not anchored to or part of it. The real-world content and the CG content are not able to respond to each ot- her (Fig. 10 and Fig. 11).

&ŝŐ͘ ϲ͘ ŽŵŵƵŶŝĐĂƟŽŶ ďĞƚǁĞĞŶ ĐŽŵƉŽŶĞŶƚƐ

Fig. 10. Example of augmented reality is to obtain canvas context and create the object with When the one of the results is opened, the output initial data. looks the same as in Fig. 7, but it is possible to set data The plotted data at the bottom of the picture is sampling and time of simulation. The second option identical to the data in the graph. The difference is in is about time rendering. There are two options: to see the way of implementation as animation. This anima- data output immediately or soft real-time as it was �ir- tion was created using HTML Canvas technology. stly run. Fig. �. �a�le data � �me� x� y� �elo�ity �alues of The last section, where the data can be seen is a ta- �� �i��ali�a��� �� �i�t�al �a���at��y i� �i�e� pro�e��le mo�on experiment ble where data were added over time as well as chart Reality and animation before. In this table Angular databin- ding [6] is used to set received object as one row with 5.1. Differences Between Virtual, Augmented and their properties. As simulation runs, the Angular adds Modern forms of education are now realized on the Mixed Reality new rows to table dynamically. basis of the development of new ICT technologies (e.g. This system is not only about the real-time ren- interactive applications made in 3D engine [17], vir- dering of data, but also for later viewing and proces- tual reality or mixed reality). Visualisation of process Virtual reality (VR) replicates an environment that sing of them. On the site of simulations, we can see modelling, identi�ication and control of complex me- simulates a physical presence in places in the real all$http.get(url, the entries callback) for the currently logged in user - Fig. chatronic systems, elements and drives using or an imagined world, allowing the user to inte- 14. The list is obtained from MongoDB using Angular and mixed reality allows students to get a much bet- ract in that world. Devices for virtual reality are Google Fig. 11. Example of augmented reality function from web client to our ter and quicker understanding of the studied subject Cardboard, HTC Vive, Rift, etc. Node.js server, which can have access to database. compared to conventional teaching methods. Augmented reality (AR) is a live, direct or in-

18 19 Journal of Automation, Mobile Robotics & Intelligent Systems VOLUME 12, N° 1 2018 Journal of Automation, Mobile Robotics & Intelligent Systems VOLUME 12, N° 1 2018

&ŝŐ͘ ϱ͘ WĂƌĂŵĞƚĞƌƐ ŽĨ ƐŝŵƵůĂƟŽŶ ͬ ŝŶŝƟĂů ǀĞůŽĐŝƚLJ ĂŶĚ ĂŶŐůĞ ŝŶ ĚĞŐƌĞĞƐ

Fig. �. �a�le of sa�ed simula�on for �urrently logged Fig. �. �rap� and �nima�on of pro�e��le mo�on in �x� user y� posi�on

direct view of a physical, real-world environment whose elements are augmented (or supplemented) by computer-generated sensory input such as sound, vi- deo, graphics or GPS data. Augmented reality is an overlay of content on the real world, but that content is not anchored to or part of it. The real-world content and the CG content are not able to respond to each ot- her (Fig. 10 and Fig. 11).

&ŝŐ͘ ϲ͘ ŽŵŵƵŶŝĐĂƟŽŶ ďĞƚǁĞĞŶ ĐŽŵƉŽŶĞŶƚƐ

Fig. 10. Example of augmented reality is to obtain canvas context and create the object with When the one of the results is opened, the output initial data. looks the same as in Fig. 7, but it is possible to set data The plotted data at the bottom of the picture is sampling and time of simulation. The second option identical to the data in the graph. The difference is in is about time rendering. There are two options: to see the way of implementation as animation. This anima- data output immediately or soft real-time as it was �ir- tion was created using HTML Canvas technology. stly run. Fig. �. �a�le data � �me� x� y� �elo�ity �alues of The last section, where the data can be seen is a ta- �� �i��ali�a��� �� �i�t�al �a���at��y i� �i�e� pro�e��le mo�on experiment ble where data were added over time as well as chart Reality and animation before. In this table Angular databin- ding [6] is used to set received object as one row with 5.1. Differences Between Virtual, Augmented and their properties. As simulation runs, the Angular adds Modern forms of education are now realized on the Mixed Reality new rows to table dynamically. basis of the development of new ICT technologies (e.g. This system is not only about the real-time ren- interactive applications made in 3D engine [17], vir- dering of data, but also for later viewing and proces- tual reality or mixed reality). Visualisation of process Virtual reality (VR) replicates an environment that sing of them. On the site of simulations, we can see modelling, identi�ication and control of complex me- simulates a physical presence in places in the real $http.get(url,all the entries callback) for the currently logged in user - Fig. chatronic systems, elements and drives using virtual world or an imagined world, allowing the user to inte- 14. The list is obtained from MongoDB using Angular and mixed reality allows students to get a much bet- ract in that world. Devices for virtual reality are Google Fig. 11. Example of augmented reality function from web client to our ter and quicker understanding of the studied subject Cardboard, HTC Vive, , etc. Node.js server, which can have access to database. compared to conventional teaching methods. Augmented reality (AR) is a live, direct or in-

18 19 Journal of Automation, Mobile Robotics & Intelligent Systems VOLUME 12, N° 1 2018 Journal of Automation, Mobile Robotics & Intelligent Systems VOLUME 12, N° 1 2018

Mixed reality (MR) is the merging of real and vir- tely new segment of mixed reality. Mixed reality has laboratory in mixed reality. By this application, stu- was not in many of registered users, but only when we tual worlds to produce new environments and visu- unquestionable advantages over virtual reality, as the dents get better insight into the results of the experi- run multiple simulations in Matlab. In our test compu- alisations where physical and digital objects co-exist user perceives a real world and also a virtual world in ment. ter – MacBook Pro there was already a problem with and interact in real time. MR is an overlay of synthe- the same time. The use of this feature is in practice un- It was needed to connect Unity application with two parallel simulations. It can be improved using a tic content on the real world that is anchored to and disputed and it is assumed that mixed reality will be- Node.js laboratory. There is a free library for Unity cal- powerful server for Matlab calculations. interacts with the real world. The key characteristic come a new standard in many areas such as education, led Socket.IO for Unity [8] which was used in the pro- The work is not over yet and StarkLab can be of MR is that the synthetic content and the real-world marketing, modeling of complex mechatronic systems, posed application. extended with another interesting functionality such content are able to react to each other in real time. etc. In Fig. 16, it is possible to see the results from the as the creation of a uni�ied protocol for data inter- Technologies for mixed reality are Microsoft HoloLens virtual laboratory in Unity engine. The application was change. Suitable would be also interfaces for other cal- (Windows Mixed Reality platform), Android ARCore deployed on Microsoft HoloLens. The results in mixed culation and simulation software. Matlab deployment and Apple ARKit. reality, you can see in Fig. 17. on a separate server with an available domain would help to availability. Another interesting functionality would be uploading simulation and calculation scripts through a web interface. The future work will also focus on additional deve- lopment for Windows Mixed Reality platform and Mi- crosoft HoloLens headset. The source code of the virtual laboratory is availa- ble as open source at https://github.com/erichstark/. Fig. 1�. �i�ro�o� �olo�en� – mixed reality appli�a�on ACKNOWLEDGEMENTS (Volvo) [18]

This work has been supported by the Cultural and Fig. 1�. Example of mixed reality – �i�ro�o� �olo�en� Educational Grant Agency of the Ministry of Educa- For Microsoft HoloLens there are more education tion, Science, Research and Sport of the Slovak Re- applications. public, KEGA 030STU-�/2017, by the Scienti�ic Grant Application HoloTour [3] provides 360-degree Agency of the Ministry of Education, Science, Research spatial video of historical places like Rome or Peru. and Sport of the Slovak Republic under the grant VEGA The application complements 3D models of important 1/0733/16 and VEGA 1/0819/17, and by the Tatra landmarks that have not been retained or supplemen- banka Foundation within the grant programme Qua- tary holographic information about elements in the lity of Education, project No. 2017vs022 (Collabora- scene. tive education applications in mixed reality for mecha- Fig. 16. Results from virtual laboratory in Unity engine Application HoloAnatomy [10] allows interactive tronics). education of anatomy of the human body. The advan- AUTHORS tage is that if the application is used by more users in Erich Stark∗ the same time, everyone sees the same model of a part – Faculty of Electrical Engineering Fig. 13. Example of mixed reality – Android ARCore and of the human body. This allows an interaction between and Information Technology, Slovak University Apple ARKit students that results in a signi�icant multiplier educa- tion effect. of Technology in Bratislava, Ilkovicova 3, Bratis- From technical �ields there is an application cal- Eriklava, Slovakia,Kučera∗ e-: [email protected], www: led HoloEngine [1]. This application allows understan- www.uamt.fei.stuba.sk. Nowadays, there is a trend of using interactive 3D ding of the complex 3D mechanical structures of the – Faculty of Electrical Engineering applications and virtual reality in many prestigious combustion engine. The application allows you to see and Information Technology, Slovak University universities. the engine in the air, start it and even look inside it and of Technology in Bratislava, Ilkovicova 3, Bratis- Very interesting project is a virtual clinic [9]. This closely monitor the mutual interaction of the mechani- Pavollava, Slovakia, Bisták e-mail: [email protected], www: project is supported by the University of Miami or cal5.2. parts. Virtual Laboratory in Mixed Reality www.uamt.fei.stuba.sk. Charles R. Drew University of Medicine and Science in – Faculty of Electrical Engineering Los Angeles. This interactive application offers an in- and Information Technology, Slovak University Fig. 17. Results from virtual laboratory in mixed reality of Technology in Bratislava, Ilkovicova 3, Bratis- sight into the actual functioning of a larger clinic, and Node.js virtual laboratory UDP stream lava, Slovakia, e-mail: [email protected], www: they can also try to diagnose patients. Students are Unity application in ��i�roso� �olo�ens� Oto Haffner thus trained through a real experience with the health HoloLens www.uamt.fei.stuba.sk. system, but this complex system is modelled and si- – Faculty of Electrical Engineering mulated in virtual reality. 6. Conclusion and Information Technology, Slovak University There are also interactive applications from Ani- of Technology in Bratislava, Ilkovicova 3, Bratis- lava, Slovakia, e-mail: [email protected], www: mech Technologies. This company offers many educa- Fig. 1�. ���eme – vi��ali�a�on of virt�al la�oratory in ∗ tion modules like Virtual Car, Virtual Truck or Virtual mixed reality developed in Unity After the experience with this kind of develop- www.uamt.fei.stuba.sk. Gearbox [16]. Using these applications students can ment, we assess that the creation of virtual laboratory Corresponding author understand the functioning of mentioned devices and platform on Node.js development was easier thanks to REFERENCES they can look into their interior and detach their indi- the use of JavaScript on the server and client side. We vidual components in detail. For development Unity engine was used. Proposed thought that due to the single thread loop of Node.js An absolute novelty is Microsoft HoloLens [11], the Unity application for Microsoft HoloLens brings a vi- would handle more clients and simulations than the [1] 360world Europe Kft. “Holoengine”, 2016. arrival of which has led to the emergence of a comple- sualisation of results from described Node.js virtual similar solution on a different platform. The problem [2] Contributors. “shell.js”, 2017.

20 21 Journal of Automation, Mobile Robotics & Intelligent Systems VOLUME 12, N° 1 2018 Journal of Automation, Mobile Robotics & Intelligent Systems VOLUME 12, N° 1 2018

Mixed reality (MR) is the merging of real and vir- tely new segment of mixed reality. Mixed reality has laboratory in mixed reality. By this application, stu- was not in many of registered users, but only when we tual worlds to produce new environments and visu- unquestionable advantages over virtual reality, as the dents get better insight into the results of the experi- run multiple simulations in Matlab. In our test compu- alisations where physical and digital objects co-exist user perceives a real world and also a virtual world in ment. ter – MacBook Pro there was already a problem with and interact in real time. MR is an overlay of synthe- the same time. The use of this feature is in practice un- It was needed to connect Unity application with two parallel simulations. It can be improved using a tic content on the real world that is anchored to and disputed and it is assumed that mixed reality will be- Node.js laboratory. There is a free library for Unity cal- powerful server for Matlab calculations. interacts with the real world. The key characteristic come a new standard in many areas such as education, led Socket.IO for Unity [8] which was used in the pro- The work is not over yet and StarkLab can be of MR is that the synthetic content and the real-world marketing, modeling of complex mechatronic systems, posed application. extended with another interesting functionality such content are able to react to each other in real time. etc. In Fig. 16, it is possible to see the results from the as the creation of a uni�ied protocol for data inter- Technologies for mixed reality are Microsoft HoloLens virtual laboratory in Unity engine. The application was change. Suitable would be also interfaces for other cal- (Windows Mixed Reality platform), Android ARCore deployed on Microsoft HoloLens. The results in mixed culation and simulation software. Matlab deployment and Apple ARKit. reality, you can see in Fig. 17. on a separate server with an available domain would help to availability. Another interesting functionality would be uploading simulation and calculation scripts through a web interface. The future work will also focus on additional deve- lopment for Windows Mixed Reality platform and Mi- crosoft HoloLens headset. The source code of the virtual laboratory is availa- ble as open source at https://github.com/erichstark/. Fig. 1�. �i�ro�o� �olo�en� – mixed reality appli�a�on ACKNOWLEDGEMENTS (Volvo) [18]

This work has been supported by the Cultural and Fig. 1�. Example of mixed reality – �i�ro�o� �olo�en� Educational Grant Agency of the Ministry of Educa- For Microsoft HoloLens there are more education tion, Science, Research and Sport of the Slovak Re- applications. public, KEGA 030STU-�/2017, by the Scienti�ic Grant Application HoloTour [3] provides 360-degree Agency of the Ministry of Education, Science, Research spatial video of historical places like Rome or Peru. and Sport of the Slovak Republic under the grant VEGA The application complements 3D models of important 1/0733/16 and VEGA 1/0819/17, and by the Tatra landmarks that have not been retained or supplemen- banka Foundation within the grant programme Qua- tary holographic information about elements in the lity of Education, project No. 2017vs022 (Collabora- scene. tive education applications in mixed reality for mecha- Fig. 16. Results from virtual laboratory in Unity engine Application HoloAnatomy [10] allows interactive tronics). education of anatomy of the human body. The advan- AUTHORS tage is that if the application is used by more users in Erich Stark∗ the same time, everyone sees the same model of a part – Faculty of Electrical Engineering Fig. 13. Example of mixed reality – Android ARCore and of the human body. This allows an interaction between and Information Technology, Slovak University Apple ARKit students that results in a signi�icant multiplier educa- tion effect. of Technology in Bratislava, Ilkovicova 3, Bratis- From technical �ields there is an application cal- Eriklava, Slovakia,Kučera∗ e-mail: [email protected], www: led HoloEngine [1]. This application allows understan- www.uamt.fei.stuba.sk. Nowadays, there is a trend of using interactive 3D ding of the complex 3D mechanical structures of the – Faculty of Electrical Engineering applications and virtual reality in many prestigious combustion engine. The application allows you to see and Information Technology, Slovak University universities. the engine in the air, start it and even look inside it and of Technology in Bratislava, Ilkovicova 3, Bratis- Very interesting project is a virtual clinic [9]. This closely monitor the mutual interaction of the mechani- Pavollava, Slovakia, Bisták e-mail: [email protected], www: project is supported by the University of Miami or cal5.2. parts. Virtual Laboratory in Mixed Reality www.uamt.fei.stuba.sk. Charles R. Drew University of Medicine and Science in – Faculty of Electrical Engineering Los Angeles. This interactive application offers an in- and Information Technology, Slovak University Fig. 17. Results from virtual laboratory in mixed reality of Technology in Bratislava, Ilkovicova 3, Bratis- sight into the actual functioning of a larger clinic, and Node.js virtual laboratory UDP stream lava, Slovakia, e-mail: [email protected], www: they can also try to diagnose patients. Students are Unity application in ��i�roso� �olo�ens� Oto Haffner thus trained through a real experience with the health HoloLens www.uamt.fei.stuba.sk. system, but this complex system is modelled and si- – Faculty of Electrical Engineering mulated in virtual reality. 6. Conclusion and Information Technology, Slovak University There are also interactive applications from Ani- of Technology in Bratislava, Ilkovicova 3, Bratis- lava, Slovakia, e-mail: [email protected], www: mech Technologies. This company offers many educa- Fig. 1�. ���eme – vi��ali�a�on of virt�al la�oratory in ∗ tion modules like Virtual Car, Virtual Truck or Virtual mixed reality developed in Unity After the experience with this kind of develop- www.uamt.fei.stuba.sk. Gearbox [16]. Using these applications students can ment, we assess that the creation of virtual laboratory Corresponding author understand the functioning of mentioned devices and platform on Node.js development was easier thanks to REFERENCES they can look into their interior and detach their indi- the use of JavaScript on the server and client side. We vidual components in detail. For development Unity engine was used. Proposed thought that due to the single thread loop of Node.js An absolute novelty is Microsoft HoloLens [11], the Unity application for Microsoft HoloLens brings a vi- would handle more clients and simulations than the [1] 360world Europe Kft. “Holoengine”, 2016. arrival of which has led to the emergence of a comple- sualisation of results from described Node.js virtual similar solution on a different platform. The problem [2] Contributors. “shell.js”, 2017.

20 21 Journal of Automation, Mobile Robotics & Intelligent Systems VOLUME 12, N° 1 2018

[3] M. Corporation. “Holotour”, 2017. [4] Q. Fang. “Jsonlab: a toolbox to encode/decode json �iles”, 2016. IEEE Transactions on In- [5] L.dustrial Gomes Electronics and S. Bogosyan, “Current trends in remote laboratories”, , vol. 56, no. 12, 2009, 4744– 4756, 10.1109/TIE.2009.2033293. [6] M. Hevery and team. “Angularframework”, 2016. [7] Z. Nedic, J.33rd Machotka, Annual and Frontiers A. Nafalski, in Education, “Remote 2003.laboratories FIE 2003. versus virtual and real laborato- ries”. In: , vol. 1, 2003, T3E–1–T3E–6 Vol.1, 10.1109/FIE.2003.1263343. [8] F. Panettieri. “Socket.io for unity”, 2014. [9] D. Parvati, W. L. Heinrichs, and Y. Patricia, “Cli- Medicinenispace: a Meets multiperson Virtual 3d Reality online 18: immersive NextMed trai- ning environment accessible through a browser”, , vol. 163, 2011, 173. [10] S. Prajapati, E. Madrigal, and M. T. Fried- man, “Acquisition,DISCOVERIES visualization and potential applications of 3d data in anatomic patho- logy”, , vol. 4, no. 4, 2016, 1, 10.15190/d.2016.15. [11] P. Rauschnabel, A. Brem, and Y. Ro. “Augmented reality smart glasses: De�inition, conceptual in- sights, and managerial importance”, 07 2015. [12] I. Santana, M. Ferre, E. Izaguirre, R. Aracil, and L. Hernandez,IEEE “Remote Transactions laboratories on Indus- for trialeducation Informatics and research purposes in automatic control systems”, , vol. 9, no. 1, 2013, 547–556, 10.1109/TII.2011.2182518. [13] E. Stark. “Virtual laboratory using javascript on the server side (in slovak)”. Master’s Thesis, 2016. [14] M. team. “Web access”, September 2017. [15] V. team. “The philosophy of virtual labs”, Decem- ber 2017. [16] A. Technologies. “Animech technologies sho- wreel 2013”, 2013. [17] A. Thomas. “Variant: Limits”, 2017. IEEE Vehicu- [18] larE. Uhlemann, Technology“Connected-vehicles Magazine applications are emerging [connected vehicles]”, , vol. 11, no. 1, 2016, 25– 96. [19] G. Vallabha. “Real-time pacer for simulink”, Sep- tember 2016. 43rd [20] BiennialR. R. Wright, Convention “Using (07 3 dimensionalNovember-11 simulation November 2015)in nursing education”. In: S. Gennaro, ed.,

, vol. 1, no. 1, Las Vegas, Nevada, USA, 2015, 1.

22