simovni2:implementation

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
simovni2:implementation [2022/10/16 20:11]
laurentc [SimOvni 2 Implementation]
simovni2:implementation [2025/01/31 22:54] (current)
laurentc [Hardware]
Line 1: Line 1:
 ====== SimOvni 2 Implementation ====== ====== SimOvni 2 Implementation ======
 +[[simovni2:implementation#development_environment_selected|Downloads]]
  
-Source code / Unity Project https://github.com/albion2000/simovni2 +{{:simovni2:implementation:client_server.png?600|}}
- +
-But, first you need to install the [[simovni2:implementation#development_environment_selected|development environment]] +
- +
-When opening the project in unity for the first time, at the end of import, you may have 3 errors (oculus related) and 1 warning (about a duplicate identifier) that you can ignore. +
- +
-the same project can generate  +
-  * the target client application for the HoloLens 2  (**simovni2** scene. That scene has the 3 client objects) +
-  * the server application on PC (**simovni2_fastdev** scene compiled with the 3 client objects inactive) +
-  * during development, client+server in the same application   (**simovni2_fastdev** scene with the 3 client objects active) that you can run in the integrated player, or as a standalone exe. The CGI is the client side, the UI overlayed is the server side. It starts very fast. All the coms are logged into the unity console for checks. That way to debug is much faster than using the HoloLens or 2 separate APIs.  +
-  * during development when the client is installed on the HL2, the server application can still be played in unity. (**simovni2_fastdev** scene with the 3 client objects inactive) that you can run in the integrated player, it can communicate with the HL2. +
- +
-The trajectory.txt file is loaded/created interactively using the server & client. You can start without any trajectory.txt file and create it from scratch by adding keypoints. +
- +
-The trajectory file is handled by the server (PC) only. +
- +
- +
-Things to tune  +
-  * the ip address of the SERVER should be put into the code of TCPServer.cs and TCPClient.cs ---  replace "192.168.43.121" by your specific ip.  (in Assets/Scenes/scripts) +
-  * When running the server API standalone, that is, outside of the unity editor/debugger, you should copy the trajectory.txt into the build directory (side by side with simovni2.exe) +
-  * to tune the firewall on the server to accept TCP connections from the HoloLens. Private Network, Accept incoming TCP connections on all ports (even though we use only port 9005, it seems that it is necessary to not only specify explicitly TCP (not “all protocols”) and also open all the ports in order for the TCP connection to succeed). +
-  * shape of the UAP (png or 3d object) +
-    +
- +
-A quick test to know that it works in unity alone (at least) +
-  * open the **simovni2_fastdev** scene ; activate the 3 client objects in the scene graph tree (select on the left, activate then on the right in the "inspector"). Press Play (Button of the Unity IDE).  Look at the console at the bottom. You should see the log that the server is connected to a client. +
-  * then press the buttons [load trajectory], [Show +], [Set North...], [Play]  at ten seconds, the UAP should appear. +
-  * you can ignore the warning "Lock input to game view..." +
- +
-For tests, on the PC side, you can run in the IDE+
 ===== Witness Side ===== ===== Witness Side =====
 ==== Hardware ==== ==== Hardware ====
Line 59: Line 31:
 ===== Investigator Side ===== ===== Investigator Side =====
 ==== Hardware ==== ==== Hardware ====
 +{{ :simovni2:implementation:laptop.png?400|}}
 laptop PC |  phone | tablet laptop PC |  phone | tablet
  
-Les premieres appli protosseront sur PC portable pour aller beaucoup plus vite, pour avoir plus de place écran pour placer les contrôles en vrac. +The first prototype apps runs on laptop PC for a fast dev, for more room to place sliders/buttons. 
 + 
 +La premiere appli protoest sur PC portable pour aller beaucoup plus vite, pour avoir plus de place écran pour placer les contrôles en vrac. 
 ==== Software ==== ==== Software ====
 Software stack Identical to the witness side. Software stack Identical to the witness side.
 +
 +The advantage of Unity3d is its ability to retarget an API for mobile as well as PC. Mobile : not now. Now we make it run on a laptop PC for a much faster dev.
  
 L'avantage de unity3d est de pouvoir re-targeter l'appli plus facilement ensuite pour mobile. Mais il y a peut-être beaucoup de travail à cause des différences de gestion des boutons ?  L'avantage de unity3d est de pouvoir re-targeter l'appli plus facilement ensuite pour mobile. Mais il y a peut-être beaucoup de travail à cause des différences de gestion des boutons ? 
 +
  
 Trajectory key-points interpolation: Trajectory key-points interpolation:
-  * if on investigator side (current implementation)+  * if on investigator side
     * easier to debug and make evolve the logic.     * easier to debug and make evolve the logic.
     * big visual jitter guarantied in the HMD (that's the main issue)     * big visual jitter guarantied in the HMD (that's the main issue)
Line 75: Line 53:
     * ensures fluid trajectories      * ensures fluid trajectories 
  
 +Both are implemented since v0.1.0
 ====== Development environment selected ====== ====== Development environment selected ======
  
 All these softwares are free. All these softwares are free.
  
-In what follows, you +In the Microsoft guidelines linked below, you 
    * need    * need
      * Visual Studio. Preferably the same version as mine, to be sure. Visual Studio Community 2019 v16.9.4       * Visual Studio. Preferably the same version as mine, to be sure. Visual Studio Community 2019 v16.9.4 
Line 96: Line 75:
  
 {{ :simovni2:implementation:unity_interface.png?800|}} {{ :simovni2:implementation:unity_interface.png?800|}}
 +
 +===== Unity Project =====
 +
 +Source code / Unity Project https://github.com/albion2000/simovni2
 +
 +But, first you need to install the [[simovni2:implementation#development_environment_selected|development environment]]
 +
 +When opening the project in unity for the first time, at the end of import, you may have 3 errors (oculus related) and 1 warning (about a duplicate identifier or importer generated inconsistent result for asset) that you can ignore.
 +
 +the same project can generate 
 +  * the target client application for the HoloLens 2  (**simovni2** scene. That scene has the 3 client objects)
 +  * the server application on PC (**simovni2_fastdev** scene compiled with the 3 client objects inactive)
 +  * during development, client+server in the same application   (**simovni2_fastdev** scene with the 3 client objects active) that you can run in the integrated player, or as a standalone exe. The CGI is the client side, the UI overlayed is the server side. It starts very fast. All the coms are logged into the unity console for checks. That way to debug is much faster than using the HoloLens or 2 separate APIs. 
 +  * during development when the client is installed on the HL2, the server application can still be played in unity. (**simovni2_fastdev** scene with the 3 client objects inactive) that you can run in the integrated player, it can communicate with the HL2.
 +
 +The trajectory.txt file is loaded/created interactively using the server & client. You can start without any trajectory.txt file and create it from scratch by adding keypoints.
 +
 +The trajectory file is handled by the server (PC) only.
 +
 +
 +Things to tune 
 +  * the ip address of the SERVER should be put into the code of TCPServer.cs and TCPClient.cs ---  replace "192.168.43.121" by your specific ip.  (in Assets/Scenes/scripts)
 +  * When running the server API standalone, that is, outside of the unity editor/debugger, you should copy the trajectory.txt into the build directory (side by side with simovni2.exe)
 +  * to tune the firewall on the server to accept TCP connections from the HoloLens. Private Network, Accept incoming TCP connections on all ports (even though we use only port 9005, it seems that it is necessary to not only specify explicitly TCP (not “all protocols”) and also open all the ports in order for the TCP connection to succeed).
 +  * shape of the UAP (png or 3d object)
 +   
 +
 +A quick test to know that it works in unity alone (at least)
 +  * open the **simovni2_fastdev** scene ; activate the 3 client objects in the scene graph tree (select on the left, activate then on the right in the "inspector"). Press Play (Button of the Unity IDE).  Look at the console at the bottom. You should see the log that the server is connected to a client.
 +  * then press the buttons [load trajectory], [Show +], [Set North...], [Play]  at ten seconds, the UAP should appear.
 +  * you can ignore the warning "Lock input to game view..."
 +
 +For tests, on the PC side, you can run in the IDE
  
 ===== Option 1 using OpenXR ===== ===== Option 1 using OpenXR =====
Line 125: Line 137:
 I recommend that before each new deploy to the HL2, you uninstall the previous version of simovni2. Worked more often that way for me. I recommend that before each new deploy to the HL2, you uninstall the previous version of simovni2. Worked more often that way for me.
  
 +For compiling/building for the PC target (server standalone exec) :
 +  * scene to build : scenes/fastdev_simovni only (menu file>build settings. With the client objects disabled. Click on [add open scene] if fastdev_simovni is not already selected)
 +  * Platform to select in Unity3d : PC, MAC. You may need to switch platform.  (menu file>build settings)
 +  * click build in unity -> then select/create a (new) directory where the generated files will be produced.
 +  * after the generation, unity will open a file explorer. Open the (new) directory. You should find the exec file
 +  * optionally copy a previously created trajectory.txt file along the simovni.exe file
 +  * press ALT-F4 to leave the API. Press ALT+ENTER to leave full screen.
  
  
Line 143: Line 162:
 A new icon "Simovni2" should appear. A new icon "Simovni2" should appear.
 ====== Unity3d Scene Graph ====== ====== Unity3d Scene Graph ======
 +
 ===== Server (Investigator, PC) ===== ===== Server (Investigator, PC) =====
  
Line 214: Line 234:
   * time (current time on trajectory in seconds, starting from 0)   * time (current time on trajectory in seconds, starting from 0)
     * if moved while playing, allows to move back and forth along the recorded trajectory in a fast way     * if moved while playing, allows to move back and forth along the recorded trajectory in a fast way
-    * if moved while in pause, the behavior is completely different. It is for trajectory editing, with the intend to create a new key-point at a new time.+    * if moved while in pause, the behavior is completely different. It is for trajectory editing, with the intend to create a new key-point at a new time; starting with the current settings when pause was pressed (alt, az, roll, size, brightness, etc...).
  
 == movable only while in pause for trajectory editing == == movable only while in pause for trajectory editing ==
Line 233: Line 253:
 ===== Client (Witness, HMD) ===== ===== Client (Witness, HMD) =====
 ==== Scene Graph ==== ==== Scene Graph ====
 +{{ :simovni2:implementation:client_scene_graph.png|}}
   * Controller Client (running the polarControlClient.cs script): this is the main object. It manages all the parameters under control of the witness and received data updates from the investigator. It communicates using the Messaging Client object   * Controller Client (running the polarControlClient.cs script): this is the main object. It manages all the parameters under control of the witness and received data updates from the investigator. It communicates using the Messaging Client object
   * Messaging Client (running the messaging.cs script): It sends any detected changes to the data toward the server. It communicates with the server using of the TCP Client object. It is the same source file as for the server.   * Messaging Client (running the messaging.cs script): It sends any detected changes to the data toward the server. It communicates with the server using of the TCP Client object. It is the same source file as for the server.
  • simovni2/implementation.1665943866.txt.gz
  • Last modified: 2022/10/16 20:11
  • by laurentc