Furkan Karakocaoglu 12037fc648 changes in lab преди 2 години
..
Assets 12037fc648 changes in lab преди 2 години
Packages 12037fc648 changes in lab преди 2 години
ProjectSettings 12037fc648 changes in lab преди 2 години
TEST_BP 12037fc648 changes in lab преди 2 години
TestServer 12037fc648 changes in lab преди 2 години
UnityPlayerStub 12037fc648 changes in lab преди 2 години
.gitignore 12037fc648 changes in lab преди 2 години
.vsconfig 12037fc648 changes in lab преди 2 години
BPTestServer.zip 12037fc648 changes in lab преди 2 години
LICENSE 12037fc648 changes in lab преди 2 години
Nutzendendokumentation.pdf 12037fc648 changes in lab преди 2 години
README.md 12037fc648 changes in lab преди 2 години
Stream_06.01.2021_09.21.56.bin 12037fc648 changes in lab преди 2 години
Stream_06.01.2021_09.23.51.bin 12037fc648 changes in lab преди 2 години
Stream_06.01.2021_09.27.53.bin 12037fc648 changes in lab преди 2 години
UnityCommon.props 12037fc648 changes in lab преди 2 години
unityProject.vrmanifest 12037fc648 changes in lab преди 2 години

README.md

CityModell

Steuerung

In 2D debug:

Nutzung des SteamVR debug Modus

  • W,A,S,D Bewegung
  • Shift + Bewgungstaste für schnelles Bewegen
  • C wechseln der Detailstufen
  • 0 = LoD
  • 1 Abstrakte Objektdarstellung
  • 2 unidentifizierbare Entitäten
  • 3 identifizierbare Entitäten
  • Zeitmanipulation per Buttons am oberen Rand der UI
  • * Event Radar am oberen rechten Bildschirmrand
  • Combo Box für Events am oberen linken Rand der UI
  • Eine Zeitleiste am unteren Rand der UI
  • zeigt die aktuelle Position in der Zeit
  • Zeigt events an

In VR:

Nur mit VR Equipment nutzbar

  • Hintere Griptaste Dinge in die Hand nehmen
  • seitliche Griptaste Virtuelle Controller feststellen
  • Rechter virtueller Controller: Joystick horizontal Geschwindigkeit beeinflussen, Vertikal Detailstufe anpassen, drücken Zeit anhalten/fortsetzen
  • Linker virtueller Controller: Mit Zeigestab bedienen (hintere Griptaste), Zeitsprünge auf Leiste oder in Combo-Box zu Ereignissen

Input

Das Programm unterstützt input über einen Server und über Dateien. Benötigte input Datein sind: die anzuzeigenden Objekte, die Events und die Sensoren.

Sensoren:

  • Werden immer als Datei im SensorHandler gesetzt. Es wird davon ausgegangen das sich das File im Ordner "./Assets/CSVInput/" befindet

Objekte und Events:

  • Server: Im ManagerObject "Use Stream" auf true setzen und die "IP Adresse" setzen. Sicherstellen dass der Server läuft bevor das Programm gestartet wird.
  • Kein Server: Im ManagerObject "Use Stream" auf false setzen und im Feld "File Path" und "Event Filename" die Namen der Dateien für Objekte und Events eintragen. Auch hier müssen die Dateien im Ordner "./Assets/CSVInput/" liegen

Data Flow (For Developers)

This section will give you a brief overview over the Data flow of this program.

  • This application features a client server infrastructure for the Object and Event data. We assume the Object and Event Server to be hosted on the same IP Address but on different ports. The defaults are 13000(Objects) and 13001(Events)
  • The sensors however are not part of this transmission and are in a static file.
  • We have provided a Server to simulate this behavior. It can be found TestServer/BPTestServer.exe. This server features different modes for sending, and they can be explored by using "--help" in the command line.

  • The Unity application receives this data with its NWreader and NWEventreader. The NWEventreader dumps the received events to a .csv file. The NWreader buffers Objects for a time period depending on the sample rate and dumps them to a .bin file afterwards.

  • The bin file containing the Objects is read from a Thread in the Processor which buffers data that will be needed in the next update cycle of the UI

  • the Events are directly read from the Unity script "ManagerWithProcessor". This script also reads the Buffered data from the Processor when necessary

Data Protokolls

Entities:

Please take note that rotation and position are dependent on the sensor

  • int32 - objectID
  • float64 - timestamp
  • 3*float32 - position (x, y, z)
  • 3*float32 - view point
  • 2*unsigned int32 - RGB(a) color values. The first value is the Top color the Second the bottom color(bottom color only used on human entity, ignored by other models)
  • int32 - type of Entity 0=Human, 1=PKW, 2 = Bus, 3 = Bicycle
  • int32 - ID of sensor
Adding new Entity types:
  • 1. Add new EntityType to the EntityType enum in the InputObject.cs class
  • 2. Add SerializedField for the new Prefab in AbstractObjectHandler.cs class
  • 3. Add case in the Create function in the ObjectHandler.cs class
  • 4. Drag and drop Prefab into the newly created SerializedField of the ObjectHandler in Unity
  • 5. Add Movement.cs Script to the Prefab
  • 6. Add Details.cs Script to the Prefab
  • 7. Add DataObject.cs Script to the Prefab
  • 8. Add Animator Component to the Prefab
  • 9. Add LODGroup Component to the Prefab
  • 10. Add case for the new Entity type for model, animator and renderer assignment in the Start function in Details.cs
  • 11. Add EntityType to the corresponding if statement of the SetColor function in Details.cs

Scripts and Components for the new Prefab:

  • Movement.cs should be on the parent object
  • Details.cs should be on the parent object
  • DataObject.cs should be on the parent
  • LODGroup should be on the parent object
  • Animator no fixed position (handled in 10.)

Events

Please take note that rotation and position are dependent on the sensor

  • byte - length type
  • int32 - sensorID
  • float64 - timestamp
  • float64 - endtimestamp (if length type is 1 or 3)
  • 3*float32 - position (x, y, z)
  • 3*float32 - ideal viewing Position (x, y, z) (if length type is 2 or 3)
  • int32 - type of event, 0=car crash, 1 = falling person, 2 = Konfettikanone, 3 = Explosion

Adding new Event types:

  • 1. Insert Sprite into the Prefab folder
  • 2. Add new EventType to the EventType enum in the EventObject.cs class
  • 3. Open Event Prefab in Prefab folder
  • 4. Increase Size of Event Images Array in the EventScript Component
  • 5. Drag and Drop the Sprite Prefab into the last Entry of the Event Images Array
  • 6. Open the Scene KantPlatz in Unity
  • 7. In the Scene open HierachicalCanvas -> TimelineCanvas->SliderEventCanvas repeat step 4 and 5.
  • 8. In the Scene open TimeUIHandheld -> StatusScreen -> Canvas -> TimelineCanvas->SliderEventCanvas repeat step 4 and 5.