In the process of making a homemade Mech Combat game that features robot-like piloted tanks capable of turning the cockpit independent of the direction of movement, [Florian] realized that while the concept was intuitive to humans, implementing it in a VR game had challenges. In short, when the body perceives movement but doesn’t feel the expected acceleration and momentum, motion sickness can result. A cockpit view that changes independently of forward motion exacerbates the issue.
To address this, [Florian] wanted to use a swivel chair to represent turning the Mech’s “hips”. This would control direction of travel and help provide important physical feedback. He was considering a hardware encoder for the chair when he realized he already had one in his pocket: his iPhone.
By making an HTML page that accesses the smartphone’s Orientation API, no app install was needed to send the phone’s orientation to his game via a WebSocket in Unity. He physically swivels his chair to steer and is free to look around using the VR headset, separate from the direction of travel. Want to try it for yourself? Get it from [Florian]’s GitHub repository.
A video is embedded below, but if you’re interested in details be sure to also check out [Florian]’s summary of insights and methods for avoiding motion sickness in a VR Mech cockpit.
This project incorporates a physical element into the VR environment, but there’s neat work being done in the other direction as well; how about spicing up your stationary bike with a VR headset and Google street view data?
10 thoughts on “VR Mech’s Missing Link: The Phone In Your Pocket”
I use my Galaxy S6 with VR goggles to fly my quad copter (Phantom 3 Pro) in VR or First Person Video FPV.
That setup with the Litchi app allows my goggles with the S6 control the quad’s camera.
Could you document this setup? I would like to know more.
this is a stroke of genius, we have perfectly capable sensors in our phones, why not use them.
i am a bit worried about the latency but that would probably be very phone and software dependant.
I imagine part of the problem is getting specs on some of those sensors.
granted, but i do think there is at least some standardisation, even if accidental or through context, i doubt there is a different accelerometer in every phone, they probably have their goto parts just as any other industry.
iPhone 6 uses a Bosch Sensortec BMA280. https://www.chipworks.com/about-chipworks/overview/blog/comparing-invensense-and-bosch-accelerometers-found-iphone-6 . Newer iPhones use newer generations of those accelerometers AFAIK.
Or put an encoder on your office chair.
Or just strap the phone to the chair.
Or just build a real mech and lay waste to the neighbourhood.
I woulda probably glued onto the chair the two Wii nunchuks I won at a thrift shop for $1 apiece and hooked up via ATmega328P to be a 10-axis HID joystick, and then derived rotation from the differential motion. But hey, as long as your phone’s in your pocket then that’s def. clever enough.
Please be kind and respectful to help make the comments section excellent. (Comment Policy)