GPS and Compass Aided Augmented Campus Guide
Total Page:16
File Type:pdf, Size:1020Kb
CALIFORNIA STATE UNIVERSITY SAN MARCOS Computer Science Department GPS and Compass Aided Augmented Campus Guide Project Report for CS 698 by Sabareesh Kannan Subramani April 2013 1 Abstract Augmented Reality (AR) is a view of a physical, real-world environment in real-time in which some elements are augmented by computer-generated object such as sound, video, graphics or plain text. Early stages of AR primarily used head-mounted display that includes a helmet and a display screen. To support such display, people need to carry computers with them to process complex calculations. But as mobile devices started to house powerful processors as well as sensors such as GPS and compass, researchers are now able to use mobile devices for running AR applications. Computer vision has been commonly used in AR applications to track objects in the real world and determine what virtual objects should be augmented based on the tracking information from the real world. However, image recognition is an expensive process. The GPS and Compass Aided Augmented Campus Guide project proposes a method to identify a landmark without image recognition. The system is composed of two parts, backend database and a frontend iPad application. The database consists of GPS coordinates of landmarks and iPad application uses them to identify landmarks by comparing them with geo location and compass heading of the device. Landmark boxes are augmented to the user screen in real-time as they come into the camera view of the device. Events associated with a landmark are stored either in database or in the user’s calendar. The application adds them to the user view when the user is interested in a landmark. In addition, this application allows tagging of a 3d object at a location. These 3d objects are augmented to the user view when he/she approaches the location. The implementation of this project demonstrates greater understanding and integration of sensor GPS, compass, gyroscope with native iOS applications. 2 Table of Contents 1 Background .......................................................................................................................... 5 2 Project Overview ................................................................................................................. 8 2.1 Project Scope .......................................................................................................................................... 8 2.2 Web Interface for Collecting GPS Coordinates of Landmarks .............................................................. 14 3 Key Technology .................................................................................................................. 16 3.1 iOS Apps ................................................................................................................................................ 16 3.2 MongoDB .............................................................................................................................................. 17 3.3 Apache Web Server .............................................................................................................................. 18 4 Project Design & Implementation ..................................................................................... 19 4.1 Database Design ................................................................................................................................... 19 4.1.1 Collection – landmarks ................................................................................................................. 20 4.1.2 Collection – events ....................................................................................................................... 22 4.1.3 Collection- Media ......................................................................................................................... 23 4.1.4 Collection – threeD ....................................................................................................................... 23 4.2 Exchange between MongoDB and iPad App ......................................................................................... 24 4.3 IOS Application ...................................................................................................................................... 26 4.3.1 Models .......................................................................................................................................... 26 4.3.2 Locating Landmark ....................................................................................................................... 27 4.3.2.1 User inside a landmark ......................................................................................................... 28 4.3.2.2 Camera viewing angle and Compass .................................................................................... 28 4.3.2.3 Angle of a GPS coordinates against the user location.......................................................... 29 4.3.2.4 Determining whether a point is within camera viewing angle ............................................ 31 4.3.2.5 Selecting Two Optimal Points in Landmark .......................................................................... 31 4.3.2.6 Using landmark anchors to determine the location of landmark ........................................ 33 4.3.2.7 Calculating box location of landmark ................................................................................... 33 4.3.3 Views and their Controllers .......................................................................................................... 34 5 Concluding Discussions ...................................................................................................... 37 6 Acknowledgements ........................................................................................................... 39 7 References ......................................................................................................................... 40 3 Table of Figures Figure 1.1 ARMAR, an AR application from Columbia University ............................................. 5 Figure 1.2 Word Lens – a Mediated Reality application from Quest Visual .............................. 5 Figure 1.3 Virtual reality in marine ............................................................................................ 6 Figure 1.4 Google glasses ........................................................................................................... 6 Figure 1.5 AR Paris - an AR application based on GPS and compass ......................................... 7 Figure 1.6 Wikitude .................................................................................................................... 8 Figure 2.1 Permission to access current location and calendar ................................................ 9 Figure 2.2 Application Home View ............................................................................................ 9 Figure 2.3 View when inside a landmark ................................................................................. 10 Figure 2.4 Displays list of events and schedules at landmark ................................................. 11 Figure 2.5 Sample Detail View of an event .............................................................................. 12 Figure 2.6 Sample Detail view of the event with video ........................................................... 13 Figure 2.7 Augmented 3d Object ............................................................................................. 14 Figure 2.8 Select landmark type .............................................................................................. 15 Figure 2.9 Sample view shows adding new location ............................................................... 15 Figure 3.1 Viewing and editing a document in Rock Mongo ................................................... 18 Figure 4.1 Overall designs ........................................................... Error! Bookmark not defined. Figure 4.2 Relationship between collections ........................................................................... 20 Figure 4.3 Class Hierarchies ........................................................ Error! Bookmark not defined. Figure 4.4 Spatial Query ........................................................................................................... 25 Figure 4.5 Sample response from the server ........................................................................... 26 Figure 4.6 Checking if user is inside landmark ......................................................................... 28 Figure 4.7 Viewing Angle ............................................................ Error! Bookmark not defined. Figure 4.8 Calculating Angle between two points ...................... Error! Bookmark not defined. Figure 4.9 Method used to find angle between two points .................................................... 30 Figure 4.10 Quadrant adjustment ........................................................................................... 30 Figure 4.12 Choosing landmark anchors.................................................................................. 32 Figure 4.13 Method calculateAngleBAC .................................................................................. 33 Figure 4.14 Calculating button location ................................................................................... 34 Figure