Spatial Anchor Sharing using router without internet
Hello, I am currently working on a MR app using Unreal Engine 5.3.2 and we have successfully implemented spatial anchor sharing within our app for local multiplayer on an internet connection. However, for security reasons, we need our app to work without internet connection. But after many tests, we have realized that the spatial anchor sharing does not work on a router that is not connected to the internet. Spatial anchor sharing most probably uses Oculus cloud services to save the spatial anchors to be shared on the cloud. Using routers without internet is a crucial aspect of our app. Each headset connects to the router and within the app, we are still able to create and join multiplayer sessions using LAN. The fact that the spatial anchor sharing does not work in these conditions is a huge blocker for us. Do I have that right? Is there a way to bypass this requirement? If not, what can be done? Thank you in advance for the help!2.5KViews4likes6CommentsTesting Shared Spatial Anchors during dev
Hello everyone, I am building an app that requires shared spatial anchors, thus it is a multiplayer app. So I have two questions: 1- Quest development requires using Quest Link when trying the app in Unity, which is fine, but when I want to test in multiplayer, I often use ParallelSync and open two Unity editors. But it seems abit difficult to do the same now on the same PC connecting 2 Quest devices. Any suggestion around this? 2- Sharing spatial anchors requires App ID, which seems to only work after you build the app and upload to App Lab, this will be incredibly time consuming, is there a way to use and share spatial anchors using Unity Editor and Meta Quest Link without building every time? Thanks alot everyone.1.6KViews0likes0CommentsSharedSpatialAnchors sample does not work, showing "Saving Spatial Anchor Failed".
When I tried to build and run the SharedSpatialAnchors sample, the sample UI displayed the message "Saving Spatial Anchor Failed" and I could not save the Saving Spatial Anchor to Cloud. Strangely enough, some Quest3 saved successfully and some Quest3 failed. I tested these repeatedly and the results remained the same. Logcat in Android Studio showed "com.facebook.spatial_persistence_service : AnchorResultCode::ERROR_CLOUD_ACCESS_DENIED (-11000)". It is possible that the connection to Meta's server is failing. Does anyone have a solution? development environment: Windows11 Pro Quest3(v65) sample(https://developer.oculus.com/documentation/unity/unity-shared-scene-sample/)597Views0likes0CommentsHow to propperly Align Players/OVRCameraRigs to Shared Spatial Anchors?
I have a net code project where i try to use spatial anchors to achieve co-location type of game. I am using Meta Core SDK and the provided OVR Camera Rig (OVR Manager, OVR Camera Rig)... I am using netcode I am trying to align the Player in the camera rig to the spatial anchor. I managed to synchronize the anchor location, both players see the anchor in the same real life physical location. What I'm struggling with is aligning the joining players to the anchor so their characters overlap with their real life bodies. The flow of logic so far. 1. I spawn the anchor at 0,0,0 for the host 2. Save it, and Share it with players in the lobby 3. Re-Share with joining players. 4. bind unbound anchor for client players, and wait for it to be created and localized (to this point everything is fine, both players see the anchor, but are not align to it yet.) :exclamation_mark:5. Align the client player to the anchor (this is where everything aligns wrongly) The alignment code is basically the same as the one found in sample packages, i take in a OVRSpatialAnchor, then set the "OVRCameraRig" position to 0,0, then setting the "OVRCameraRig" position to the "anchorTransform.InverseTransformPoint(Vector3.zero)" The problem is that after running the alignment code the "zero zero" is put far away outside the playable space about exactly 5 meters wrong on x and z. And if i try to manually correct for this using "camerarigwhatevr += new vector(-5,0,-5)" it just becomes more wrong. Bellow you find my alignment code. I know its something about this code, cause the anchor itself is always physically in the same spot for all players, its only the aligning that is wrong. I constantly compare to both the sample projects, and i cannot find any differences that should affect this. Based on these Samples Unity-Discover/Packages/com.meta.xr.sdk.colocation/Anchors/AlignmentAnchorManager.cs at main · oculus-samples/Unity-Discover (github.com) Unity-SharedSpatialAnchors/Assets/SharedSpatialAnchors/Scripts/AlignPlayer.cs at main · oculus-samples/Unity-SharedSpatialAnchors (github.com) My alignment code (with debugging stuff) (i manually trigger the align with a button bind so i can see what happens more easily): using System; using System.Collections; using System.Collections.Generic; using UnityEngine; // A Script to bind local player positions to the networked player. public class LocalPlayer : MonoBehaviour { public static LocalPlayer Instance; [Header("Colocation Alignment")] [SerializeField] Transform _cameraRigTransform; [SerializeField] Transform _playerHandsTransform; private void Awake() { Instance = this; } private void Update() { if (OVRInput.GetDown(OVRInput.RawButton.A)) AlignPlayerToColocation(); } private Coroutine _alignmentCoroutine; public static void AlignPlayerToColocation() { if (CoLocationAnchorManager.Singleton.LoadedAnchor == null) { Logger.Log("No colocation anchor"); return; } Instance?.AlignPlayerToAnchor(CoLocationAnchorManager.Singleton.LoadedAnchor); } public void AlignPlayerToAnchor(OVRSpatialAnchor anchor) { Debug.Log("AlignmentAnchorManager: Called AlignPlayerToAnchor"); if (_alignmentCoroutine != null) { StopCoroutine(_alignmentCoroutine); _alignmentCoroutine = null; } _alignmentCoroutine = StartCoroutine(AlignmentCoroutine(anchor, 2)); } OVRSpatialAnchor _currentAlignement; private IEnumerator AlignmentCoroutine(OVRSpatialAnchor anchor, int alignmentCount) { Debug.Log("PlayerAlignment: called AlignmentCoroutine"); while (!anchor.Created) { yield return null; } while (!anchor.Localized) { yield return null; } Logger.Log("BEFORE ALIGN [" + alignmentCount + "]: Player Transform : " + _cameraRigTransform.position); Logger.Log("BEFORE ALIGN [" + alignmentCount + "]: Anchor Transform : " + anchor.transform.position); while (alignmentCount > 0) { if (_currentAlignement != null) { // Reset the position to zero _cameraRigTransform.position = Vector3.zero; _cameraRigTransform.eulerAngles = Vector3.zero; Logger.Log("ALIGN [" + alignmentCount + "]: Player Transform : " + _cameraRigTransform.position); Logger.Log("ALIGN [" + alignmentCount + "]: Anchor Transform : " + anchor.transform.position); // wait one frame for anchor to move yield return null; } var anchorTransform = anchor.transform; if (_cameraRigTransform != null) { // set the position to be the inverse of the Ancor Transform Position (Relative to its new position) // this kinda gets the anchors releative position to the world origin. _cameraRigTransform.position = anchorTransform.InverseTransformPoint(Vector3.zero); Logger.Log("ALIGN Inverse [" + alignmentCount + "]: Player Transform : " + _cameraRigTransform.position); Logger.Log("ALIGN Inverse [" + alignmentCount + "]: Anchor Transform : " + anchor.transform.position); _cameraRigTransform.eulerAngles = new Vector3(0, -anchorTransform.eulerAngles.y, 0); } else { Logger.Log("ALIGN: CameraRigTransform is invalid"); } if (_playerHandsTransform != null) { _playerHandsTransform.localPosition = -_cameraRigTransform.position; _playerHandsTransform.localEulerAngles = -_cameraRigTransform.eulerAngles; } _currentAlignement = anchor; alignmentCount--; yield return new WaitForEndOfFrame(); } Logger.Log("ALIGN FINAL [" + alignmentCount + "]: Player Transform : " + _cameraRigTransform.position); Logger.Log("ALIGN FINAL [" + alignmentCount + "]: Anchor Transform : " + anchor.transform.position); Debug.Log("PlayerAlignment: Finished Alignment!"); Logger.Log("Alignment Finished?"); OnAfterAlignment.Invoke(); } public Action OnAfterAlignment; }2.1KViews2likes2CommentsShared Spatial Anchors - AnchorPersistenceRuntimeIpcServer: Request denied based on storage location
Hello, We are trying to implement the sample scene from this repository: https://github.com/oculus-samples/Unity-SharedSpatialAnchors This way we hope to test the Colocation to ultimately use it in our experiences. However, when creating an anchor and then sharing it, we come across an error on the app logs: "Saving anchor(s) failed. Possible reasons include an unsupported device." When I check the adb logs, I get the following errors: SP:AP:AnchorPersistenceConfig: getCloudPermissionEnabled: oculus_spatial_anchor_cloud=false SP:AP:AnchorPersistenceRuntimeIpcServer: Request denied based on storage location for package com.Oculus.UnitySharedSpatialAnchors, sessionUuid:e0d791ec-49a1-4948-abd4-e4754812554b SP:AP:AnchorPersistenceRuntimeIpcServer: Aborting saveAnchorV3 for package name: com.Oculus.UnitySharedSpatialAnchors SP:AP:AnchorPersistenceRuntimeIpcClient: Failed RPC for saveAnchor, rpcAllowed: false, CallServerRPCResult: 9 SP:AF:AnchorFrameworkSlamAnchor: saveAnchor failed! I have tested it on two Oculus Pro and an Oculus Quest 2 without success... Do you have any idea how to resolve this issue (I can't seem to find anything on internet) ? Could it come from a missing Android permission ?3.5KViews0likes7Comments