azure-spatial-anchors

Is there a way to set an initial position for the tracked object?


Is there a way to explicitly set an initial position for the object tracker, other than just placing the bounding box around the object? I have my objects already detected but want to use AOA to improve the tracking accuracy. It would be nice if I could just initialize the tracker with the object position I already have.


Solution

  • For C++ you can set the search area as a position/rotation like this:

    auto searchArea = ObjectSearchArea::FromLocation(coordinateSystem, float3(0, 0, 0), quaternion::identity());
    

    for Unity/C# you can set the search area as a position/rotation like this:

    var searchArea = ObjectSearchArea.FromLocation(coordinateSystem.Value, Vector3.zero.ToSystem(), Quaternion.identity.ToSystem());