For this Category, a Unity simulation has already been given to you, is a flight simulation for pilots in outer space. You can find it under: WebChallengeScripts/WebChallengeScene.
Your tasks will be centered around being able to get data out of this simulation to a server and then onto a Frontend interface, so that ground control can monitor the Pilots training.
For your convinience everything you will need to modify or run is inside the folder Assets/WebChallengeScripts.
- Task: Modify
NetworkManager.csto:- Complete the SendPosition function to get the Position, Velocity and Rotation of the target object (use the helper functions already written)
- Leverage the
UDP_Datadata structure to package the most recent data (Hint: Research about JSONUtility) - Figure out how to use the UDPClient object to send the data to the server
- To verify proper functionality. Run the
server.exethat can be found in the WebChallengeScripts/Server folder and see if your messages are coming through
web_basic.mp4
- Task: Modify
main.jsandindex.htmlinside WebChallengeScripts/Server/static:- Parse the incoming data coming from the websocket messages. This is the API format for messages:
{ "posX": float, // X-coordinate of the object's position "posY": float, // Y-coordinate of the object's position "posZ": float, // Z-coordinate of the object's position "eulerX": float, // X-angle (roll) in Euler coordinates "eulerY": float, // Y-angle (pitch) in Euler coordinates "eulerZ": float, // Z-angle (yaw) in Euler coordinates "velX": float, // X-component of velocity "velY": float, // Y-component of velocity "velZ": float, // Z-component of velocity "velAbs": float, // Absolute velocity magnitude "time": float // Timestamp of the data }
- Use Javascript, CSS, and HTML to graph the incoming data
Feel free to use the same graphs from the Demo below but also feel free to be creative and come up with your own The use of the Javascript Canvas is encouraged but not required
- Make sure your final solution reflects changes in realtime as they are ocurring in the simulation
- To verify proper functionality. Run the
server.exethat can be found in the WebChallengeScripts/Server folder and then access the HTML via localhost:8080
- Parse the incoming data coming from the websocket messages. This is the API format for messages:
web_intermediate_comp.mp4
NOTE if you are not that comfortable with working on Backend or the
Golangprogramming language, feel free to stop at Part 2 and just make sure to make an outstanding and realtime frontend
- Task: Create a whole new pipeline to send video feed from Unity:
- Modify
NetworkManager.csto include another Coroutine specifically to send images. Leverage the helper functionGetImageBytes().Note: It's ok to send low resolution and small images
- Make sure you send the images to a different server port than the position message
- Modify
main.goinside WebChallengeScripts/server to create a new UDP listener at the new server port you have defined for image messages - Modify
main.goto enable relaying to the frontend the incoming images. There are multiple ways to achieve thisHint: Try to leverage the already existing Websocket connection with the frontend, not the most optimal but it's simple
- Moidfy
index.htmlandmain.jsthat you already modified for level 2, but this time add handling such that it can display the incoming images from the server. - To verify proper functionality just run
go run main.goor build itgo build -o server.exeand then run./server.exe
- Modify
NOTE for this task you must install the Golang programming language in your computer, if you don't have it go here