The Road to: A Data Journey in AR
The following is a partner blog by Oliver Rogers and Chris Choy of Bluefin Solutions.
A collaborative mentality and agile style is a winning combination to rapidly design, build and deploy innovative projects. This is certainly proven by the team from Bluefin who have combined the talent of several areas of expertise including HANA, iOS and Augmented Reality, to build out the A Data Journey in AR immersive experience, announced a few weeks back. This post takes you through the what and how:
How did this application come about?
A little over 6 months ago, SAP approached Bluefin to build an experience to showcase the power and versatility of SAP HANA. Settling on a concept that was equally as impressive as SAP HANA itself took several iterations! The announcement of Apple’s new augmented reality framework, ARKit, finally confirmed the concept of the “Augmented Reality HANA machine” – read Bluefin consultant Cal Loudon’s introduction to the project.
What does the application do?
The premise is simple: given your current location, the number of hours you are willing to fly, the month you want to go in and the type of break (Beach, City Break or Winter) we search for the top 3 vacation destinations that meet your criteria.
During the query, which has been purposefully slowed down so you can see what happens, the user gets to step inside the SAP HANA machine which builds a city in AR. We take you into the inner workings of HANA; explaining the various engines and functions, allowing you to explore this incredible digital world. Finally you can see the results of the query that was performed on SAP HANA in the IBM Bluemix Cloud and explore your exciting vacation options.
How was it built?
The solution is built in three components;
- An SAP HANA model that computes the query for the user and provides our database functions
- SAP Cloud Platform for iOS SDK driven mobile application providing robust, enterprise grade controls and data handling on your iOS device
- 3D model rendered using Apple’s new ARKit framework to allow the user to visualise and interact with SAP HANA in real life.
Tell me a little more about the HANA model?
The model brings in data from 3 locations:
- Weather data – Data has been collected from the National Centers for Environmental Information which includes multiple years data from 103,000 weather stations around the globe.
- Location data – Tightly connected to the weather station data, the longitudes and latitudes from the weather station closest to the vacation cities are used in the calculation in determining which cities are within the selected travel hours flight range.
- Twitter data – Publicly available tweets with <city name> + <vacation> are pulled from Twitter and loaded into HANA. The Text Analysis engine analyzes these to determine a city sentiment value from which the city ranking is based.
We then make use of several functions in SAP HANA to provide a ranked output of the 3 best suitable vacation locations:
- From the location of the user, we find all vacation cities within travelling range based on the hours to be travelled. The distance is based on average speed of air transport multiplied by hour.
- These cities are then checked to see if they are the type of vacation the user wants. This is established based on temperature ranges: above 70 is a beach holiday, below 40 is winter and any weather will be suitable for an urban adventure.
- Based on these ranges, we find the average temperature for the selected cities from the past few years and if there’s a match – it’s a potential holiday location!
- Now we need to rank these cities to give us a top 4 and we do this by integrating with Twitter to provide sentiment analysis on the cities vacation feasibility. Using the Data provisioning agent, we register a Twitter adapter in order to be able to communicate with Twitter from HANA and add Twitter as a remote source in HANA. We add our inputs parameters to the Search Virtual function to search throughout all of Twitter’s publicly available tweets.
- We take that resultset and insert it into a HANA table, for which we have a Text Analysis Index created for.
- We are using the Voice of Customer dictionary to run the tweets through and provide us sentiment on each tweet. The words which provide sentiment are assigned a score 0-1 based upon positivity with 1 being the most positive and 0 most negative. The scores are then aggregated based upon city to give us our sentiment scores for each city. This sentiment score becomes our new city ranking.
How does the SAP Cloud Platform SDK for iOS fit in?
We use the SAP Cloud Platform SDK for iOS (the current Beta for iOS 11) to provide the user inputted values to send back to SAP HANA and to layout the results and KPIs from the process.
We blended the SAP Fiori for iOS and the Apple Human Interface Design Guidelines together to provide a UI that is both aesthetically pleasing yet adherent to modern enterprise design principles.
The iOS platform gave us access to a range of hardware sensors native to iPhone and iPad. Components such as GPS, Gyroscope, Accelerometer and Camera sensors are used to track the end user’s physical location which we later use together with Apple’s MapKit and ARkit frameworks to really make SAP HANA come alive.
How did you build the augmented reality world?
Apple’s new ARkit framework performs a lot of the work to produce an AR experience. We make use of the new capabilities of scene understanding, recognizing surfaces in the real world and creating them as anchors for the app to place objects on.
ARkit also uses visual inertial odometry to accurately track the real world fusing data from the camera and any motion sensors the device has. What this does is make the object to appear as though it is fixed in place in the real world, to allow the user to physically walk around the room and to zoom in by just moving closer to it. This provides a much more natural viewing experience.
ARkit also allows the user to interact with these objects as they would do in real life. To tap them to reveal more information and provide an immersive experience. ARkit builds upon Apple’s SceneKit rendering engine to allow us to add in animations, real life textures and reflections on the metal components.
When can I get my hands on it?
We’re launching the experience this week at SAP TechEd 2017 Las Vegas – check it out on the UNLOCK BIG DATA campus on the show floor. Not at SAP TechEd? This AR experience will also be coming to the Apple app store later on in the year. Sign up to be notified when it’s available.