Closed konstyanchev closed 3 years ago
Hi
In order to have the anchors linked with each other they have to be created in the same session. There is also a documentation page explaining how to use different Anchor Locate strategies: https://docs.microsoft.com/en-us/azure/spatial-anchors/concepts/anchor-locate-strategy#nearanchor
Also, in your steps your not mentioning that you're setting the source anchor. Please make sure you set a source anchor when using NearAnchor strategy
Hello,
Thank you for the reply. I am indeed creating my anchors in the same session so I don't think that is the problem.
Also, in your steps your not mentioning that you're setting the source anchor. Please make sure you set a source anchor when using NearAnchor strategy'
Do you mean that an anchor has to be designated as a source anchor during the upload to ASA or as a source for NearAnchorCriteria? If it's the latter I'm doing that in step 3. This is the code I'm using to create the criteria for the watcher. The anchor that gets passed is the first I've created during a session (I've verified the IDs). I've checked the samples app and the NearbyDemo code but apart from changing the strategy and setting a SourceAnchor I don't see anything different.
private void LocateNearbyAnchors(CloudSpatialAnchor inStartAnchor)
{
NearAnchorCriteria naCriteria = new NearAnchorCriteria();
naCriteria.SourceAnchor = inStartAnchor;
naCriteria.DistanceInMeters = _sas.NearbyDistance;
AnchorLocateCriteria locateCriteria = new AnchorLocateCriteria();
locateCriteria.NearAnchor = naCriteria;
locateCriteria.Strategy = LocateStrategy.Relationship;
if (_currentWatcher != null)
{
_currentWatcher.Stop();
_currentWatcher = null;
}
_currentWatcher = _cloudSpatialAnchorSession.CreateWatcher(locateCriteria);
Debug.Log("Anchor Watcher created.");
}
Can i ask you to try the following to make sure it's not the device, network or Azure Service set up:
Does this demo work as expected and you can create 3 anchors, find the first one and then the other 2?
I'll try that and report back. Unfortunately I won't have access to a HL2 device until Thursday so I will update after that. I have tried the NearbyDemo sample on the same device with the same network and credentials and it worked correctly. It finds the first anchor, changes its scale and then finds the 2 other anchors and turns them green. (small note, no anchor is deleted between the placement and location stage as it's the case for the basic demo, but looking at the code that seems to be intentional). This was done with the 2.9.0 SDK and Unity 2020.3.12f1. I was waiting for the Remote Rendering SDK to be compatible with OpenXR before transitioning to Unity 2020. I just saw that it was recently updated so I will update the project to the new Unity version and update the ASA SDK to the latest supported version and try again.
So as mentioned the demo works just fine. Unfortunately it will take me some time to update my project to Unity 2020 and ASA 2.10 as I need to rewrite a significant part of the code. Unrelated to the issue but it looks like now that the world anchor components are replaced by ARAnchors and the NativeToCloud requires that a SpatialAnchorManager.cs is present in the scene. In the demo project an ARFoundation object is added automatically when the scene starts. Could you please tell me how this is happening? I don't think the documentation has been updated yet.
Hello,
I'm having trouble locating any anchors when trying to use NearAnchorCriteria.
I'm currently testing on: Unity 2019.4.24f1 ASA: 2.8.1
My steps are as following:
However, this watcher doesn't locate any anchors. I also tried removing the local anchor for B (B can still be downloaded from the cloud if using a NearDeviceCriteria or Identifiers) but nothing is found. My understanding is that if I already have anchor A, that I found using the 2 other methods, I can use NearAnchorCriteria and A as a starting point to find B or any other anchors that have been created after A. Is there a step that I'm missing? Also, whenever I attempt a NearAnchorCriteria search I'm no longer able to delete any anchors currently visible in the scene. What is the reason for that? Resetting the session and the watcher doesn't seem to help.