ARCore Geospatial Creator With Unity

Today, I'm thrilled to share with you the latest offering from Google: the Geospatial Creator Tools, which are now available for Unity and Aero. In this post and YouTube video, I guide you through the process of creating a project, deploying it to your iOS and Android device, and even showcase an exciting experiment I've developed using these new tools. So, buckle up and let's delve into the magic of these tools!

iOS deployment may seem a bit tricky at first, but don't worry, I've meticulously documented the entire process for you. I've encountered some challenges along the way, but I can assure you, with the README.md documentation I've prepared, the process will become significantly easier.

To illustrate the power of these tools, I've created an experiment: transforming downtown Salt Lake City into a scene of an alien invasion. Now, it might sound ambitious, but trust me, it's a simplified version of such an encounter. Having the world as our canvas truly revolutionizes augmented reality, and this experiment is a prime example (take a look at all the mages below to see results from my Geospatial Creator experiment).

ARCore Geospatial Map Tiles API Cost And Limits:

Next, I like to guide you through the APIs costs and limitations associated with these tools. Unfortunately, this information isn't easily accessible in their documentation, and it took some digging into numerous documents to uncover. But fear not! I've compiled all the necessary API and Limits info below that I believe will be instrumental for you.

  • Maximum 300 root tileset queries per day. This is calculated as the sum of all requests for all applications using the credentials of the same project.

  • Maximum 250,000 renderer’s tile requests per day. This is calculated as the sum of all requests for all applications using the credentials of the same project.

  • Rate limit is 12,000 queries per minute for the tile renderer.

  • Cost (FREE): ONLY during experimental stages. (I will update this post once new pricing becomes available)

ARCore Geospatial Creator AR Experiment (Alien Invasion)

Now, let's discuss the experiment I created by using the Geospatial Creator Tools. After spending a few days testing these new tools (finally an excuse to step outside of my usual workspace!), I embarked on a search for perfect outdoor locations in Salt Lake City. Utilizing a mix of Google Earth and Google Maps, I identified several high-rise buildings to test the technology. Moreover, I also ran tests at lower altitudes, providing a comprehensive view of how the tool functions in different scenarios.

After recording the latitude, longitude, and altitude of each location, I input these details into Unity. With everything set, I was able to successfully deploy the application to both iOS and Android devices.

Be sure to check out some of the screenshots below, which highlight important aspects of the Geospatial Creator tools in Unity.

ARCore Geospatial Creator Unity Project Steps:

Fig 1.0 - ARSessionOrigin: this shows you all components required on this game object.

I know that some of you may like to see a step-by-step outline with all the steps required to create a Geospatial Creator prototype in Unity, which is why I have put the steps below together:

  • Unity Project Creation Steps:

    • First, use a create a new 3D (URP) Unity Project by using the Unity Hub, I recommend using Unity 2022.2.16 or greater which is what I used when creating multiple prototypes.

    • Go to Windows > Package Manager > Click on + to “Add package from git url…” then enter https://github.com/google-ar/arcore-unity-extensions.git.

    • In the Package Manager > Click on + once again and this time “Add package from tarball.. (this will install features to render 3D Photorealistic tiles in Unity).

    • In the Package Manager, find ARCore Extensions which we installed on step 2 and click on it, then go to the Samples tab to import “Geospatial Sample” demo.

  • Google Cloud Steps:

    • Go to https://console.cloud.google.com and enable Google’s Map Tiles API and ARCore API (if you need help with this, watch the video and refer to the description to find out which video chapter to watch for these steps).

    • Create or copy your API Key generated during the previous step, we will need this API Key for our Unity project.

Fig 1.1 - ARCoreExtensions: this shows you all associations required for this component to work. CameraConfigFilter is optional.

  • Unity Project Scene Steps:

    • Create a new scene or use the default created scene, be sure to delete all components in the hierarchy by just leaving the default light.

    • Go to the ARCore samples imported and open the “Geospatial” scene, then copy the ARSessionOrigin component and pasted into the previous created scene.

    • Remove all components from ARSessionOrigin except for “AR Session Origin”, “AR Anchor Manager”, and “AR Earth Manager” later on we will add additional components once I cover new features.

    • Copy the “Geospatial Manager” from here and add it to your project

    • Create a new Empty game object “GeospatialManager” and add “Geospatial Manager” as a component

    • Associate all “Geospatial Manager” fields to its respective components, for instance “Earth Manager” to “Earth Manager” from AR Session Origin…(see Fig 1.0)

    • Create a new “ARCore Extensions” feature by right clicking on the hierarchy > XR > ARCore Extensions, also associate all of its fields to respective components. For AR Core Extensions Config, you will need to create a new config, to do this go to your project panel, right click > Create > XR > “ARCore Extensions Config”. Associate the newly created scriptable object “ARCore Extensions Config” to the “ARCore Extensions” component config option. (see Fig 1.1)

    • Go to File > Build Settings > Player Settings > XR-Plugin Management and enable “Apple ARKit” for iOS and “Google ARCore” for Android.

      • Under XR-Plugin Management, go to “ARCore Extensions” and enable "iOS Support” if needed, then paste your API Key into “Android API Key” and “iOS API Key”, you also need to set the authentication strategy to API Key.

      • Enable Geospatial and Geospatial Creator under ARCore extensions

    • Right click on the hierarchy > XR > Add “AR Geospatial Creator Origin”

      • Paste your API Key into the “Google Map Tiles API Key”

      • Open Google Maps or Google Earth and find an interesting location, then copy the latitude, longitude, and altitude

      • Paste the previous copied values into the “AR Geospatial Creator Origin” > “Cesium Georeference” component fields.

      • At this point you should see 3D tiles in Unity, yeah let’s celebrate!

    • Now let’s add some content, right click on the hierarchy > XR > Add “AR Geospatial Creator Anchor”, set the Altitude Type to manual, terrain, or rooftop depending on what you like to test, for simplicity let’s do manual.

    • Find a 3D model and place it under the “AR Geospatial Creator Anchor” then align it with the location you like to test with.

    • To deploy your experience, I recommend watching my YouTube video or look at this project which has a list of all the player setting requirements under the README.md as well as a full Unity project you can use to test all of these features.

To ensure access to my Geospatial Creator Unity Project, make sure to clone or download it from GitHub at: https://github.com/dilmerv/GeospatialCreatorDemos

Well that’s it and In conclusion, Google's Geospatial Creator Tools for Unity and Aero are an exciting development in the augmented reality sphere. From creating a project to deploying it on your device and experimenting with real-world scenarios, the possibilities are endless. Despite a few bumps in the process, these tools pave the way for turning your wildest imaginations into reality!

Consider subscribing to my YouTube channel here as it helps me in providing you with more videos and blog posts !

Thank you!

Previous
Previous

What Is Google ARCore?

Next
Next

Meta Scene Understanding For Richer VR Passthrough Experiences!