Archery is ‘mixed’ reality project. It’s simple VR game combined with real bow as a controler. Main design brief is combine vr experience with real feel of objects. This was my first project in Unity but i still want to share this. I think whole idea comes from 6DOF MPU-6050 sensor nearly and desire to send values from it into Unity.
So, after some development and learning Unity it’s time to show my project for my coleagues, it was few days before chrismas so game has SOME chrismas tone. In game all we had to do was ( follow the damn train CJ?) was shoot as many stars as we can. Game is just for fun, so there is not any scoreboard or arrows limit. My colleagues after putting vr set on head, were able to pick bow in hands so i take that as a little succes of mixed reality 🙂
Lets talk about technical soultions. Main part of controller, bow, is microcontroller based on ESP8266 module, NodeMCU. It’s a low cost Wi-Fi module which is programmed by Arduino IDE. Communication beetwen application was based on web sockets. Microcontroler was set as acces point with implemented web sockets server.
Actual bow rotation in each axis were obtained form MPU-6050 module. Long story short, its a sensor contains 3-axis accelerometer and 3-axis gyro. Raw data form sensors allow to calculate actual pitch, roll and yaw angles. Thanks to Jeff Rowberg liblary, it wasnt that hard. MPU communicate with controler through I2C-bus. To check actual bowstirng force I’ve used flex sensor and calculate value from its actual resistance (its a kind of resistor whos resistance increases as the body of the component bends).
Microcontroler sends data about actual bow rotation and bowstring tension as bytes to keep communication as fast as possible. In meantime it’s nessesary to process IMU data in every interrupt triggered by MPU. Holding every intterupt is very important for getting stable data without spikes.
Main part of application was class responsible for holding comunication with server and getting data from it. Data must be decrypted afterwars is passed to matching variables.
-As you can see on movies, real position of bow in higher angles is little diffrent than recived from IMU values. Thats caused by that, 6DOF doesnt have any inforation about actual word base direction (for example phone have from build in magnetometer). To prevend that is nessesary to add 3-axis magnetometer and combine sensors data. Best way to do that is use upgraded 6050 module, MPU-9250, whitch have build in AK8963 chip(3-axis magnetometer). With magmetometer, data would be more stable and can be calculated in word base axis. I am sure to buy 9250 module and rewrite whole project in some free time.
-That sort of experience of virtaul reality realy throws us to game. Its hard to describe how you feel after put vr set down. Its something like you know all the time you stay in office, but one part of your brain engage to put correct tension to bowstirng and shoot correctly.