How to make Shared Anchors in the XR-Simulator with ParrelSync work?
Hi y'all, has anyone ever figured out how to make shared anchors in the XR-Simulator work, meaning two Unity-Version running at the same time with Parrelsync? Everything else works, if you have one Version running as Client, the other as Host, but the Anchors can not be shared, probably because the "localsharing_mock_server" is not actually connected to Meta's servers and of course it would be way tot easy to have a way of local sharing this valuable data without Meta in between. I've tried several different ways, currently having Usersettings with testusers and "Standalone Platform" but, the loading (and probably sharing) the Shared anchors has failed everytime. Host and Client can see each other, so Unity Netcode runs fine in the Simulator. Best Regards Florian Buchholz351Views0likes2CommentsShared Spatial Anchors and, Testing, and Uploading unity build issues.
I am trying to get Co-Location via shared anchors to work in unity. The project also uses mainly uses the Meta XR SDK, and Meta Platform SDK, but instead of photon (as used in sample colocation sample projects) this project uses Netcode. I am unable to get the application to actually get the users ID and unable to share the Anchor when building directly to the headset. My core problems. The login callback on Core results in the USER ID of 0 Sharing the anchors never completes I tried Creating a org Creating a app Verifying the org Get access for Data Checkup User ID and User Profile Adding App ID info to the Platform Settings I read somewhere that i need to Upload a build to meta before the headset will allow you to access the apis. So i... Adding all the necessary manifest stuff from here Create Manifest Application Manifests for Release Builds | Oculus Developers Add Keystore Android Application Signing | Oculus Developer Making sure im not building with development stuff In general verifying the project with Meta XR tools (everything ok) Tried Build with the token from unit, and the dev software (none of the builds gets accepted when uploading to store) All i get is this error : WARNINGS: • This app contains both 32-bit (armeabi-v7a) and 64-bit (arm64-v8a) libraries. This consumes extra storage and increases download times. Consider updating your build to target 64-bit only. • APK er feilsøkbar (android:debuggable i AndroidManifest.xml). Merk: Du kan bare distribuere feilsøkbare APK-er via private kanaler. :white_heavy_check_mark:Successfully Validated Build ⬆ Retrieving upload files APK: 97.8MB ⬆ Uploading APK :cross_mark:ERROR: Signer eller bygg om APK-et ved å bruke et produksjonssertifikat, eller bekreft at innstillingene for nøkkellagerversjonen er riktig. For some reason parts of the error is in Norwegian despite my pc lang being in eng, but it seems to ask me to provide a production certificate or verify that the keystore version is correct. And from what i can tell i have done that. How do i get co-location to work, do i have to upload a valid build before i can even access the relevant api's? How to i properly upload a build correctly, nothing i do seems to work. Here is a snippet of the code i have to handle the Sharing of spatial anchors: private async void InitializeCoLocationAnchorAsync() { var anchor = CreateNewAnchor(transform); Log("1. Created Anchor"); var localized = await WaitForAnchorLocalized(anchor); Log("1. Anchor Localized"); Log("2. Trying to save Anchor"); bool save = await anchor.SaveAsync(new SaveOptions() { Storage = OVRSpace.StorageLocation.Cloud }); if (!save) { Debug.LogError("Failed to save anchor to cloud, retrying"); return; } Log("2. Saved Anchor"); // 3. Share cloud anchor with users (Gives users access to the anchor) Log("3. Trying to Share Anchor with users"); OperationResult share = OperationResult.Success; try { share = await anchor.ShareAsync(SpaceUsers.Values); // !!! // THIS IS WHERE THE sharing fails, // not even logging the error gets executed. // !!! Debug.LogError("ShareResult: " + share.ToString()); } catch { Debug.LogError("Failed to share anchor with users" + share.ToString()); return; } Log("3. Shared Anchor"); Log("4. Setting Anchor ID in network variable"); // 4. Share UUID with users (Gives users access to the anchor) // This should fire the OnAnchorUuidChanged event AnchorUuid.Value = new MetaSessionAnchorIds() { Ids = anchor.Uuid.ToByteArray() }; } Also a snippet from the get logged in user callback that only seems to give me ID of zero private void GetLoggedInMetaUserCallback(Message<User> message) { LocalMetaAccount = message.GetUser(); if(message.IsError) { Debug.Log(message.GetError().Message); } UpdatePlayerData(); Logger.Log("Got Logged In user"); if(LocalMetaAccount.ID == 0) Debug.LogError("You Are not Authorized to use this app"); OnApplicationIsReady.Invoke(); IsReady = true; }How 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.2KViews2likes2CommentsShared Anchor Alignment is different per headset. Unity
Some headsets work, others dont. I landed on a alignment solution that seems to work well on 4 different headsets. This is surprisingly more simple than what the meta sample code does (that i never got working). But we have 1 singular headset that consistently seems align to the shared anchor about 180 degrees wrongly rotated around the anchor. Why is this, is it not supposed to be the same? _cameraRigTransform.position = _cameraRigTransform.position - anchor.transform.position; _cameraRigTransform.rotation = anchor.transform.rotation; Semi-related to my other post about how to do it in general: How to propperly Align Players/OVRCameraRigs to Sh... - Meta Community Forums - 1170624 (atmeta.com)469Views1like0CommentsQuest 3 shared spatial anchors
So, we have a project in development with shared anchors, but we cannot save or retrieve anchors from cloud. This work in quest2 but not in quest3. There is something else to configure to work with the quest 3? We are using: Unity 2022.3.4f1 and oculus integration v57.0. ThanksSolved4.9KViews1like4CommentsUnreal Shared Spatial Anchor Sample
My team and I have been struggling to get this sample working. We have packagedthe project for the store and submitted a data use checkup so we have access to UserID and cloud storage. We have also downloaded our packaged build from the AppLab and are still not able to share anchors between 2 Quest Pro devices running on the same local network. We're getting the following message in the device log: 13:10:22.826 OVRPlugin [CreateSpaceUser] called for spaceUserId 0 13:10:22.826 Telemetry [OpenXR_Anchor] userId cannot be 0; 13:10:22.826 OVRPlugin [XRCMD][failure] [XR_ERROR_VALIDATION_FAILURE]: xrCreateSpaceUserFB(m_xrSession, &info, (XrSpaceUserFB*)spaceUser), arvr/projects/integrations/OVRPlugin/Src/Util/CompositorOpenXR.cpp:11830 (arvr/projects/integrations/OVRPlugin/Src\Util/CompositorOpenXR.h:328) Are we missing something that is not stated in the documentation?Solved2.5KViews1like1CommentSharing Anchors failed - oculus_spatial_anchor_cloud=false
Hello, 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! 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 ?1.3KViews0likes2Comments