- Home /
Using device sensors to detect position in world space
Is there a way to currently do this? I've aware of Google's Project Tango but that's limited to Android devices. I'm looking to have the device pick up it's position and move the camera in the world view related to that devices position. I've been building and AR app and this functionality would be incredibly useful.
I've looked into using the accelerometer for this, but that would involve tilting your head to move in each direction, not exactly ideal.
Does anyone have a solution for this?
Thanks for your responses. To @tanoshimi I'm looking for something a bit more accurate, GPS only works up to around 10 metres or so. I'm needing as close as possible!
@Chris_Payne_QS I've used Vuforia before and I know what you mean, it would be a lot easier if I could use a trackable image of some sort but I don't think I'll be able to. I'm making an AR app to help golfers with putting, I'd prefer to not have to ask them to take something trackable along with them on the course.
I'm not sure what answer you're expecting that would be available using consumer hardware. GPS is the only publicly-available technology for detecting the position of an object at an arbitrary location anywhere in the world. (Good GPS devices can be accurate within 3m about 95% of the time)
Answer by tanoshimi · Jan 23, 2017 at 07:38 PM
Sounds like you're looking for Input.location, which will give you the device's position based on GPS or other location service.
@tanoshimi I'm needing something a bit more accurate than GPS, less than 1 metre if possible
Answer by Chris_Payne_QS · Jan 23, 2017 at 09:44 PM
I presume you're referring to a mobile device. Short answer is yes, but not easily.
Most mobile AR apps require something in front of the camera (a checkerboard or printed QR code) so that they can figure out where the viewport is in relation to that - but that's still a hardcore image processing problem. You may be able to integrate someone else's solution into your app though - give this a try, for example: http://www.justapixel.co.uk/how-to-make-an-ar-app-in-5-minutes-with-unity-and-vuforia/
@Chris_Payne_QS I've actually used Vuforia before, and I know it would be easier if I could use a trackable image of some sort. I'm making an AR app for golfers to help with putting, so would prefer if I could use a solution that doesn't need anything other than the device they own. I'd considered trying to access the pedometer but the maths is confusing the hell out of me haha!
Your answer