Colocation Discovery Sample App
The
Mobile OpenXR SDK includes a complete example of how you can integrate Colocation Discovery using the
SampleXrFramework
provided by the SDK. The sample app is under
XrSamples/XrColocationDiscovery
.
- Discover nearby users
- Share metadata between nearby users (could be useful for matchmaking)
- Establishing shared reference frames between nearby users (using Shared Spatial Anchors)
As a user of the sample app, you will see a simple UI that allows you to initiate calls to the underlying Colocation Discovery OpenXR API. The UI should also contain instructions on how to interact with the sample.
To start the experience, you can click the “A” button on your right controller anywhere in the space. This will create a spatial anchor and share it with a random Group UUID (Can read more about
Shared Spatial Anchors API here).
Once you’ve created a shared spatial anchor, you can start a colocation advertisement. When starting the colocation advertisement, the sample app passes the Group UUID to the xrStartColocationAdvertisementMETA
API by writing it to the advertisement’s buffer request field.
The user will also see a button to start colocation discovery. Once discovery has successfully started, the sample will receive async events upon discovering other nearby users. Upon receiving a discovery event, the sample app will read the Group UUID from the discovered colocation advertisement buffer and attempt to localize the spatial anchor which was shared with this Group UUID. If successful, the sample app will render the localized shared anchor.
To try this out, install the sample app under
XrColocationDiscovery/Projects/Android
onto the Meta Quest device. For instructions on launching samples, refer to the
README.md
located at
XrSamples/README.md
in the
OpenXR Mobile SDK.