The Inception of a Virtual Reality Bike Experience
Mindgrub is always looking for ways to play around with new tech and we are eager to explore the possibilities of virtual reality. Facebook CEO Mark Zuckerberg has called the future of VR “the most social platform.” Virtual Reality continues to disrupt the tech industry, so we decided to challenge ourselves to build a VR bike experience with Oculus Rift, a big innovation that’s been regarded as revolutionary for the gaming industry. It’s been creating a buzz for years, which is why Zuckerberg purchased the company for $2 billion in 2014.
First, we assembled a Mindgrub Labs team that consisted of a senior project manager, mobile development lead, and our Director of Creative Strategy. The idea was to create a stationary bike experience that allowed users to ride the bike while traveling in a virtual reality with the Oculus Rift. Cycling is a pretty big part of our corporate culture, so we were pretty excited for this project.
Using a combination of hardware and software, the Mindgrub team strategized the construction of the Oculus Rift Virtual Reality Bike. To assemble a fully functioning VR experience, Mindgrub took the following steps…
Creating Motion in the Virtual Reality Space
An arduino board, with a magnetic reed switch that would open and close every time a magnet passed by it, was installed onto a physical bicycle. When the switch was attached to a bicycle frame and the magnet to the wheel, it became possible to measure how fast the wheel was spinning. This information could then be relayed to the game engine powering the Oculus Rift’s virtual city.
While this set-up works well on a cycle-computer, it felt very unnatural for the Oculus Bike. In order to get a speed reading, you’d have to do at least two full wheel rotations to calculate how fast it was spinning. Even though a user would begin pedalling, the bike wouldn’t start moving forward in the virtual city right away. There were a few seconds of delay.
In order to solve this, more magnets were added to the wheel in six inch intervals. This created a much more natural pedalling motion, syncing up the real motions of the wheel with the timing of the virtual bike in the game.
Leveraging the Steering of the Bike
Without the implementation of steering control abilities within the code, people would be running their virtual bikes into obstacles and buildings. Steering, however, also presented potential hazards, as people might attempt to lean the bike certain ways as if they were riding a real one.
We added two tiny micro-switches to the frame to facilitate left and right turns. However, they were impossible to use with an Oculus Rift headset on. To counter this, a potentiometer, a rotating variable resistor, was attached to the handlebars. We then fabricated an aluminum bracket to hold the switch and an extension arm that engaged a few rubber bumpers, both of which were attached to the neck of the bike. This allowed movement for steering while the user wore the Oculus Rift headset.
Circuit Board Creation
The circuit is comprised of an arduino, a protoboard, two resistors, and a button. There are also several wires connecting the outputs of the knob for turning, and a magnetic switch for speed, to the arduino’s inputs.
We used one digital input and a pulldown resistor with a switch to trigger speed input, and another digital input for the button. When this input is triggered by pressing the button, it moves the player within the game to the starting position. This allows for an easy reset of the demo for each player. The last input reads the direction of the handlebars. All of these components and wire routes are soldered onto the protoboard, which sockets into the arduino. This allows us to remove the circuit to modify it, or potentially use the arduino with another project.
Programming the Virtual Terrain
Uniduino, an input for the Unity game engine commonly used for powering Oculus Rift Virtual Reality demos, was a key component to pushing the immersive experience of the VR bike. After purchasing a 3D explorable city model from the Unity Asset Store, we initiated working on construction of the city. We had acquired a “blank canvas” virtual city, so the original code in the game engine was modified, in order to create an authentic virtual bike experience.
Originally, the model of the city that was purchased from the Unity asset store had allowed bikers to clip right through buildings or obstacles, as if they weren’t there. With new coding the bike would now stop, instead of biking straight through a wall.
The Finished Virtual Reality Oculus Rift Bike Product
After a few days of dedicated work, we successfully calibrated a virtual biking experience that allowed users to pedal around a city. Upon being (literally) dropped into the city, people could then steer around while viewing their surroundings through the Oculus Rift headset.
Mindgrub is always looking for ways to get involved in bettering the community. We thought that a virtual reality bike was perfect to help raise awareness for the Ulman Cancer Fund for Young Adults, who hosted a cycling fundraising event that Mindgrub participated in for the third consecutive year, at the SmartCEO’s Corporate Culture Awards. It was a big hit at the event; some people didn’t even seem to want to get off of it.
The Mindgrub team is looking forward to our next creative tech project. Phase II of the virtual bike will include custom billboards, detailed textures, cars, and citizens. The bike will also have a fan on the handlebars so riders can feel the breeze on their face.
If you’re interested in learning more about our Oculus Bike, the potential applications of virtual reality, or are looking to create a similar experience for your company, get in touch with us here.