Reputation: 21
I want to place multiple azure anchors and set up pathfinding (like destination point ). I followed the (https://learn.microsoft.com/en-us/azure/spatial-anchors/tutorials/tutorial-new-unity-hololens-app?tabs=azure-portal) and was able to create and locate a single anchor on Hololens. Now I want to have multiple anchors, and pathfinding to reach a destination point but I don't know how to do it. Neither I am good at scripting. Could anyone help?
Upvotes: 0
Views: 766
Reputation: 82
I'm Wayne Wang from the Microsoft for Founders Hub team. Please allow me to share you some thoughts on another angle of path finding.
Azure Spatial Anchor Service is a perfect way of "Mapping Digital World and Real World", which means it was mostly used on recalibration of glitches between these two worlds.
It also has limitations, like the light condition change, like nearby signature decoration, like the size of session and query cost. Balancing these limitations means we cannot create spatial anchors everywhere/as much as possible.
On the other hand, path finding needs more points/dots to connect. Even if you are in single room, you may have paths from point A to B, among many furniture blocks you cannot pass. You may need dots on each meter or each corner, with a n-direction of graph data structure, and vetor2d on X,Z axis stored in you database. We shall call them waypoints, or business anchors.
Then we have 2 terms of points: Spatial Anchor and waypoint.
public class SpatialAnchorItem
{
public guid Id;
}
public class WayPointItem
{
public guid Id;
public SortedList<WayPointItem> LinkedWaypoints;
//SortedList can be sorted by direction so you can filter with angles/directions
public Vector2 Position;
public List<SpatialAnchorItem> NearByAnchors;
}
With clear terms, lets review our path finding consuming scene (waypoint A to B) broken down into these steps:
With agreement on these steps of consuming data, we can create more steps of building data scene, the "anchor and waypoint maker".
With these data, consuming steps 3 is possible.
Hope these ideas helps.
Upvotes: 3
Reputation: 1051
The next step is to follow the How-To Guide on How to create and locate anchors using Azure Spatial Anchors in Unity.
There are different options you can use when querying an anchor:
Using Identifiers, NearAnchor and NearDevice .
For your scenario I would leverage the Relationship Strategy to find anchors by making use of existing connected anchors.
See more about Location Strategy here: Understanding the AnchorLocateCriteria class
Upvotes: 0