-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
default user name
committed
Oct 12, 2022
1 parent
8dea143
commit c5a992c
Showing
9 changed files
with
146 additions
and
193 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,52 @@ | ||
# 3.1. Data & Channels | ||
|
||
|
||
## **_<span style="text-decoration:underline;">LIT Lab - AR Data & Channels for VIsual Effects Documentation, March 2022</span>_** | ||
|
||
## **_<span style="text-decoration:underline;">How do the data models and Photon work?</span>_** | ||
|
||
### Photon basics | ||
|
||
|
||
|
||
* Read about Photon Unity Networking: [https://doc.photonengine.com/en-us/pun/current/getting-started/pun-intro](https://doc.photonengine.com/en-us/pun/current/getting-started/pun-intro) | ||
* Connectivity: | ||
* Photon connects multiple users through a cloud service. All users need to be connected to the internet, not necessarily on the same local network. | ||
* Photon connects multiple users through a cloud service. All users need to be connected to the internet, not necessarily on the same local network. | ||
* Synchronization: | ||
* Networked data is synchronized between all users by Photon, through PhotonViews. | ||
* See [documentation about Photon](./3.6_Photon_Synchronization_of_Custom_Data.md) for more details about synchronizing data | ||
* Networked data is synchronized between all users by Photon, through PhotonViews. | ||
* See [documentation about Photon](./3.6_Photon_Synchronization_of_Custom_Data.md) for more details about synchronizing data | ||
* Ownership: | ||
* Only one user controls a PhotonView at one time. Only they can change its values. This user is called the ‘owner’ of the PhotonView. | ||
* This means when another user wants to change the data, they need to request ownership first. | ||
* Only one user controls a PhotonView at one time. Only they can change its values. This user is called the ‘owner’ of the PhotonView. | ||
* This means when another user wants to change the data, they need to request ownership first. | ||
|
||
### Data models basics | ||
|
||
|
||
|
||
* Summary: Data in our project flows through named entities called channels. A channel can get data from a Hololens or from the PC or from Arduino or all of the above. Channel data can be controlled in a variety of ways (ex: knobs, buttons) and displayed in a variety of ways (ex: graphs, text, colors) | ||
* Data is stored/synchronized through **AtomicDataModel**(ADM) objects. Each of these holds a value (typically float), which is automatically synchronized by Photon to all users. | ||
* When one user changes an ADM model value, that model is synchronized by Photon to all other users. | ||
* An ADM value can only be changed by the user who is the current owner of the PhotonView. | ||
* ![](.\Images\2022-10-12-11-38-09-image.png) | ||
* ^ this figure shows a simplified view of an ADM object being shared by multiple users | ||
* | ||
* When one user changes an ADM model value, that model is synchronized by Photon to all other users. An ADM value can only be changed by the user who is the current owner of the PhotonView. | ||
* ![](.\Images\2022-10-12-11-39-03-image.png) | ||
* ^ this figure is more accurate: in reality all users have a local ADM object, which Photon synchronizes through the PhotonViews that have the same ID | ||
* | ||
* Channels: | ||
* Channels allow easy access to sensor data. Channels are basically labels for specific ADM objects. | ||
* They are stored in the “CHANNELS and MODELS” gameobject and accessed through the **ChannelManager** class. | ||
* Some channels come from Arduino (see Arduino Connection section below), and some are within the Unity project (some of these are automatically simulated by the “**SimulatedChannels**” gameobject; and some are manually controlled, possibly through “**ManualDataChannel**” prefabs) | ||
* Channels allow easy access to sensor data. Channels are basically labels for specific ADM objects. | ||
* They are stored in the “CHANNELS and MODELS” gameobject and accessed through the **ChannelManager** class. | ||
* Some channels come from Arduino (see Arduino Connection section below), and some are within the Unity project (some of these are automatically simulated by the “**SimulatedChannels**” gameobject; and some are manually controlled, possibly through “**ManualDataChannel**” prefabs) | ||
* Simulated Channels | ||
* Only the user running in the UNITY EDITOR controls these channels. No other users will be generating these signals. | ||
* They are generated within the “**SimulatedChannels**” gameobject. | ||
* **AtomicDataSwitches**(ADS) are objects that look like AtomicDataModels but they actually can provide values from with different channels. For example, ADS pointed at channel C1 will act like the ADM model associated with C1; if we point it at C2 it acts like the ADM model associated with C2. | ||
* Only the user running in the UNITY EDITOR controls these channels. No other users will be generating these signals. | ||
* They are configured through the **ConfigurationProfile** object (as described below) | ||
* Arduino Channels | ||
* Some of the data in channels could come from the Arduino, as configured in the **ConfigurationProfile** object. (Please see the [Arduino documentation](./3.2_Arduino_Connection.md) for how to connect/disconnect channels from the Arduino) | ||
* **AtomicDataSwitches**(ADS) are objects that look like AtomicDataModels but they actually can provide values from with different channels. For example, ADS pointed at channel C1 will act like the ADM model associated with C1; if we point it at C2 it acts like the ADM model associated with C2. It's basically a way of accessing data from an ADM, but it can be switched at runtime to different channels. | ||
|
||
### Simulated Channels | ||
|
||
* Unity can generate simulated data. It can be configured via the **ConfigurationProfile** object, to send simulated data on any channel: | ||
|
||
* ![](.\Images\2022-10-12-11-42-22-image.png) | ||
|
||
* The way this works is, there's a “**SimulatedChannels**” gameobject generates fake data into several channels. | ||
|
||
* The “**SimulatedChannels**” gameobject generates fake data into several channels: | ||
|
||
|
||
|
||
<p align="center"> | ||
<picture> | ||
<img align="center" alt="Simulated Channels" src="https://github.com/shankar-r19/CYBS-MArkdown-files/blob/5145db920b350e5ab5fb17170f35c465a4e63d5f/Images/Simulated_Channels.png" width= "400" height="400"> | ||
</picture> | ||
</p> | ||
|
||
|
||
* The “FakeDataBroadcaster” child object generates these signals: | ||
|
||
* Sensor 1: sawtooth spiky | ||
* Sensor 2: sine wave | ||
* Sensor 3: square wave | ||
* Sensor 4: constantly increasing | ||
|
||
* The fake data is sent to channels as specified in the “SimulatedChannels” object (see screenshot above). | ||
* **If you don’t want a channel to be populated with fake data, just set the Sensor Model to point to nothing.** | ||
|
||
**Arduino note** | ||
|
||
|
||
|
||
* Some of the data in channels could come from the Arduino. (Please see the [Arduino documentation ](./3.2_Arduino_Connection.md)for how to connect/disconnect channels from the Arduino) | ||
|
||
* * 1: sawtooth spiky | ||
* 2: sine wave | ||
* 3: square wave | ||
* 4: constantly increasing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.