A custom Unreal VR controller to navigate through the world. Using Arduino and an MPU6050 gyroscope sensor. Including a curated VR game to explore.
I decided to experiment with different libraries I could use with the sensor. After figuring out the Adafruit library for the MPU6050 gyroscope sensor I saw that it was outputting some normal values compared to the exceedingly large values from using the basic wire library.To begin in Unreal I brought in the Arduino blueprinting on a basic cube set as a pawn. Once I go the correct values hooked in, I could control its positioning based on the sensor. I was printing the x and y values on the accelerometer to the serial monitor, then retrieving those values and setting my own parameters in Unreal to hold them. After that, I brought the Arduino coded into my VR pawn and had it add movement input based on the rotation of the camera.
When I brought these values into Unreal I was having trouble controlling the speed of the test cube I set up. I thought it was because of the values the sensor was outputting, so I ditched the Adafruit library and moved back to my original code. It turned out the problem I was experiencing had nothing to do with the library, but to get the sensor to work at all there must be a delay in the code. The issue was being caused by the delay being too long. So, after a lot of experimenting, I could bring the value of that delay down to the point the movement of the pawn was fixed. I decided to keep using my original code because it was simpler and still gave me the values I was looking for.
I learned how to implement Arduino into Unreal. Opening up the possibility for more interactive projects. Involving the use of outside sensors and getting those to effect the virtual reality experience. I also learned how to manually change the serial port being used by the Arduino, since the code is dependent on what port the Arduino is connected to.