AR Objects in the the real world based upon gps location?

Has anyone worked on saving geo locations of objects dropped based upon the mobile location. I want to do some tests where I have an inventory of items and drop them outside in my local area, and then others with the app could see them in that location and pick them up.

This is just a basic simple example which If I can get working will expand into the game idea I have.

A few things I realize, would be needing to store the id of the object dropped and its gps location in a database, which then users that launch the app would need to do some sort of geo db query. Mongo DB uses $near with along with a min and max distance param to get data back.

Also accuracy would be not that great so you couldnā€™t really just drop an item with pin point accuracy on a bench outside and when users see it, it would be right on the bench where the user left it. Iā€™m assuming for cases like this items should just float in the airā€¦

Any thoughts suggestions?

Cheers

ARCore 1.2 comes with ā€˜cloud anchorsā€™ which would be an easier way to do what you are explaining there I guess:

ARKit is getting something similar in v2 as well.

1 Like

Nice, ill have into thatā€¦ ARKit 2 has a shared exp type of system, not sure though how they are doing it, most of the demos I saw where inside, and they probably create some sort of blutooth connection between devices to provide locationā€¦

I know Unreal has the ability on the iPhone to enable location detectionā€¦ just need to figure out how to store that with the objects location and save that to a mongo dbā€¦ then when the user launches the app it queries the db for give me anything $near lat/long with min/max distanceā€¦ then display thatā€¦ however items could be stick in trees etcā€¦

You can get location on andoid too. I hope we get some info soon, how to spawn object in AR to a lat/long position.

Is there any update on how to spawn objects based on GPS location yet?

ALso interested and itā€™s 3 years later and Unreal 5 nowā€¦

1 Like

From the little Iā€™ve seen UE5 dosnā€™t have the best AR support currently but should change at some point.

As for GPS locations, Iā€™ve built and released an app both on Android and iOS that uses GPS in conjunction with AR at the same time that used latitude and longitude and created squared off locations in the real world using the GPS coordinates.

I did not use shared experience/AR sessions since in order to complete the project within our timeline I didnā€™t take the time to learn or develop using saved ā€œitem dropsā€

Thanks for your reply. Did you make that app in Unreal?

Yes, it was using Unreal. The method worked in 4.25 through 4.27 last I checked

Awesome, I really need to make something like that, are there any tutorials or learning spots you can direct me to for the bits and bobs that you used please? My business got killed off because of Covid and the only thing left I can do is a make a digital version of basically a treasure hunt style experience with AR. The documentation for something like this is sooooo limited! :frowning:

We did this for iPhone a few years ago, you can get the app from the AppStore itā€™s called ā€œIllusions ARā€. I still create experiments for it, as we built our own CloudAR, and tools for UE4.

Anything working in UE5 to a reasonable and straightforward standard?

Im trying to find a way to do something along the lines of what is showcased in these videos:

  1. https://youtu.be/uWoxF9p61ho?feature=shared

Short answer is that, Yes this is possible.
Long answer is that itā€™s that GPS based Geolocation is complicated and hard and there doesnā€™t appear to be any pre-packaged solutions for UE.

The basic idea is straight forward enough. Youā€™d first need to have the GPS locations of the places you want to create markers for. If you have a pre-set places then you just construct a BP with the GPS info for that place. If you need it to be dynamic then itā€™ll be a little harder but i believe the Google Maps API will give you the GPS of places that you want.

So once you know the GPS of where these places are then, you get th userā€™s GPS and compass info and do some math to figure out where to spawn the markers in the UE 3D space. There are a couple of things out there on the Marketplace that can help you convert from GPS coordinates to 3D coordinates. I think Cesium Ion can do it, but there are others, or you write your own.

However, the big problem with this, is that the GPS and the compass arenā€™t quite reliable enough for a good line up. The compass is actually a worse problem than the GPS because the error in the compass compounds how far the marker is from the real location depending on how far the object is from the user. i.e. the further away the market is from the user the further off itā€™ll be.

The solution for this is to constantly, every second or so, update the GPS and compass info and recalculate the positions of all your markers. The other solution is to use the multi-sampled GPS locations to calcuate the heading/compass instead of relying on the device compass. Or combine these techniques.

If you are just developing for Android then you can take advantage of the Geospatial API stuff in ARCore that will do all this for you and will be better than using just the GPS & compass because they can Google street imagery to help with the localization.

i hope this helps.
-e

Can this work in Cesium?

that sorta depends on what you mean by, ā€œcan this work in Cesiumā€?

You can get GPS and compass from the device and then pass them into the Cesium geo node and Cesium will pop to where you are.

I think Cesium also has a GPS to UE world space function, so you could feed in the GPS of an ā€œitemā€ and Cesium should be able to place it in that spot in the UE Level.

-e