Close
0%
0%

VR Integration in Stationary Bikes

I bring the outside... inside

Similar projects worth following
221 views
0 followers
The product will make the user pedal on a stationary bike to move faster in the VR game.

In the American Time Use Survey Summary which was published by the Bureau of Labor Statistics in 2017, it was reported that 21 percent of Americans participated in sports, exercise, or recreation on an average day while also stating that the average amount of TV that 15-44 year old watched per day was around 2.0 hours. What if we could motivate those 1 in every 3 these Americans to exercise everyday in a fun way? Developing a project that integrates virtual reality games with biking can help people stay fit while having fun. The project involves sensing and tracking data from stationary bicycle, transferring the data stream into virtual reality space and using Unity software to render the bike simulation.

Portable Network Graphics (PNG) - 860.03 kB - 11/02/2017 at 18:12

Preview
Download

  • 1 × Samsung Gear VR headset
  • 1 × Bike stand
  • 1 × Standard bicycle
  • 1 × Arduino IMU
  • 1 × Arduino Uno

View all 7 components

  • Final Update

    nitya.n.agrawal06/01/2018 at 14:02 0 comments

    Methods to make project: 

    Designing VR Race Car Game

    Before designing my own virtual reality game, I first learned the foundations of Unity through an online Udacity Nanodegree course. After learning about the basics tools, I started out by making a 3D plane object for the terrain and lowering and raising the terrain in order to make the mountains and valleys. Rocks, asphalt, and grass textures were then imported in order to make the virtual reality more real. A standard asset car was then placed into the scene through the Assets provided by Unity and a camera stabilization code was attached in order to reduce motion sickness. Two different tree objects were later placed throughout the scene in order to prevent the player from cutting across the map and finishing the game early. The billboard start value was also adjusted so that the trees would be rendered nicely and not just appear as soon as the car came closer. To test this game, users were asked questions and improvements were made throughout the process (Appendix A).

    Development of Hardware

    A photoelectric sensor was implemented and attached to the bicycle in order to determine the rate that the player was pedaling at. A photoelectric sensor detects the light beam reflected from the pedal when it passes (Appendix G). Data is continuously collected for two seconds and the number of times the pedal has passed the sensor is counted. After comparing if the user has sped up, slowed down, or stayed constant from the previous two seconds, commands are transmitted to Unity. A “3” means that the user has increased their speed, a “2” means that the user has stayed constant, and a “1” means that the user has reduced their speed. The readings from the SerialMonitor were recorded in order to determine that the code was efficiently working. One of the main issues that arose from this setup was that the baseline value for the sensor would change because of external light and a calibration reading was implemented to make for easy changes (Appendix F).  

    Integration of Unity and Arduino

    The first approach to integrating Unity and Arduino was through the serial port. Because Unity doesn’t have the needed libraries to do this, I included the full .NET 2.0 library in the player settings. To initialize the port, the port and the baud rate was needed and the System.IO.Ports was imported in order to do so. Using the commands of Serial.write and Serial.flush help to transmit the data from Arduino (Appendix E). Unable to make the direct connection between the two softwares using serial port, I realized through research that direct serial connection doesn’t work on Macs (Appendix D).  Instead, a SerialProxy implementation was attempted in order to configure the connection, however, that link also failed to be established (Appendix C). Because of the problem that occurs with Macs, in the future I would transfer all my work to a Windows computer and try again.

    Results of my project: 

    The game terrain was overall designed very efficiently and was engaging for the user. Because user testing was really important in determining the quality of the game, if it was fun to play, and how players felt in the environment, I asked my peers and family on their input. I not only wanted their overall opinion, but I also asked tailored questions such as, “Does the environment make you feel like you are playing a race car game?”, “How does the audio make you feel”,  and “Is the size of the car accurate in relation to the other game elements?” Most of my testing was done through my mom who helped me improve the environment and the map that was made. Vaishnavi Mantha noted that the game was entertaining, however, she very quickly found a shortcut and way to cut through the middle of the map. After seeing this, I added barriers to the side of the road to force players to stay on the designated...

    Read more »

  • Final Update

    nitya.n.agrawal06/01/2018 at 13:59 0 comments

    Methods to make project: 

    Designing VR Race Car Game

    Before designing my own virtual reality game, I first learned the foundations of Unity through an online Udacity Nanodegree course. After learning about the basics tools, I started out by making a 3D plane object for the terrain and lowering and raising the terrain in order to make the mountains and valleys. Rocks, asphalt, and grass textures were then imported in order to make the virtual reality more real. A standard asset car was then placed into the scene through the Assets provided by Unity and a camera stabilization code was attached in order to reduce motion sickness. Two different tree objects were later placed throughout the scene in order to prevent the player from cutting across the map and finishing the game early. The billboard start value was also adjusted so that the trees would be rendered nicely and not just appear as soon as the car came closer. To test this game, users were asked questions and improvements were made throughout the process (Appendix A).

    Development of Hardware

    A photoelectric sensor was implemented and attached to the bicycle in order to determine the rate that the player was pedaling at. A photoelectric sensor detects the light beam reflected from the pedal when it passes (Appendix G). Data is continuously collected for two seconds and the number of times the pedal has passed the sensor is counted. After comparing if the user has sped up, slowed down, or stayed constant from the previous two seconds, commands are transmitted to Unity. A “3” means that the user has increased their speed, a “2” means that the user has stayed constant, and a “1” means that the user has reduced their speed. The readings from the SerialMonitor were recorded in order to determine that the code was efficiently working. One of the main issues that arose from this setup was that the baseline value for the sensor would change because of external light and a calibration reading was implemented to make for easy changes (Appendix F).  

    Integration of Unity and Arduino

    The first approach to integrating Unity and Arduino was through the serial port. Because Unity doesn’t have the needed libraries to do this, I included the full .NET 2.0 library in the player settings. To initialize the port, the port and the baud rate was needed and the System.IO.Ports was imported in order to do so. Using the commands of Serial.write and Serial.flush help to transmit the data from Arduino (Appendix E). Unable to make the direct connection between the two softwares using serial port, I realized through research that direct serial connection doesn’t work on Macs (Appendix D).  Instead, a SerialProxy implementation was attempted in order to configure the connection, however, that link also failed to be established (Appendix C). Because of the problem that occurs with Macs, in the future I would transfer all my work to a Windows computer and try again.

    Results of my project: 

    The game terrain was overall designed very efficiently and was engaging for the user. Because user testing was really important in determining the quality of the game, if it was fun to play, and how players felt in the environment, I asked my peers and family on their input. I not only wanted their overall opinion, but I also asked tailored questions such as, “Does the environment make you feel like you are playing a race car game?”, “How does the audio make you feel”,  and “Is the size of the car accurate in relation to the other game elements?” Most of my testing was done through my mom who helped me improve the environment and the map that was made. Vaishnavi Mantha noted that the game was entertaining, however, she very quickly found a shortcut and way to cut through the middle of the map. After seeing this, I added barriers to the side of the road to force players to stay on the designated path and further...

    Read more »

  • March Summary

    nitya.n.agrawal04/19/2018 at 17:29 0 comments

    This month I ran into a lot of problems. Firstly, I uploaded the game from the computer onto my android phone and the car started going in the wrong direction. I tried changing the direction of the camera and the car and also modifying the values and location of the mobiletiltcontrolrig prefab that I was using. Despite all this I was unable to fix the direction of the car, so I started researching on solutions and looking deeper at the code. I think instead of using the mobile tilt I will use buttons or I will try remaking my entire terrain and seeing if the same problem occurs. Secondly, I had trouble sending the data from Arduino to Unity, however, I think that should be pretty easy to fix because I found a website explaining how to do so. Hopefully, next month I will make more progress than having setbacks. 

  • February Summary

    nitya.n.agrawal04/19/2018 at 17:10 0 comments

    So far, I have been able to get the car to move on the track that I have designed and this month I moved onto the hardware side. I attached a photoelectric sensor to an Arduino to measure the speed of the user pedaling and convert the data I receive into the speed. I also continued to research on how to transmit this data into unity and found out that  I need to use the serial port for that and I started to configure this.

  • January Update

    nitya.n.agrawal04/19/2018 at 17:00 0 comments

    This month I completed designing the entire maze. I started from designing the terrain (the different trees and different heights in the land) and added the path for the car to follow. I also decided to add stones on the edge so the car doesn't go out of the track. I also am using the standard asset car that unity provides and I wrote a script for the camera to stabilize so that the user won't have a lot of motion sickness. 

    Top view of the race car track

    Camera view 

  • November Summary

    nitya.n.agrawal12/05/2017 at 15:40 0 comments

    I worked further on the Unity code and learned about how to place objects in the scenery and adjust their position and size. I also started to work on shaders and lighting in the game. I looked at different sources to better understand how to implement Arduino and Unity such as: https://www.alanzucconi.com/2015/10/07/how-to-integrate-arduino-with-unity/. I also continued to look at different research articles such as: https://www.ethz.ch/content/dam/ethz/special-interest/baug/ivt/ivt-dam/vpl/reports/1201-1300/ab1244.pdf. The article also brought up other concerns such as smoothing the data received from the sensor and possible filtering methods.

  • October Summary

    nitya.n.agrawal11/02/2017 at 18:11 0 comments

    This month I wrote 2 article reviews on the pros and cons of Google Cardboard and on Oculus Vs Vive. I also finalized my project design and wrote the proposal along with presented it to the class. Through feedback from my classmates I realized that I need to research on how the sensor will update the phone in real time. 

View all 7 project logs

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates