I had a few questions on what is possible with spatial anchors/mapping. I had wanted very accurate placement of certain objects in my space, but because I am not using AR cloud, the anchors don't persist. I thought that maybe placing objects by coordinate upon start in the space might work but have found that the coordinates only stay consistent for a few sessions. I am wondering if anyone has suggestions for this.
I tried using ArUco markers as well but found that the objects didn't exactly match the true positioning of the anchor and would be placed differently based on where the user was standing relative to the marker. I'm wondering if there's some user error regarding that and if there's a way to have the positioning be more accurate. The object seemed to always be offset towards the user.
Hi @kritig
you can persist anchors without AR cloud, AR cloud just allows for a much larger space. Spatial Anchor Overview | MagicLeap Developer Documentation
This is the current documentation on it, but that api will be changing in the next release to get a bit simpler. The ideas will stay the same though so it would be a good start. If you have any questions about it I am happy to help.
-Sidney
Thank you! I am looking into it. I'm wondering if some of the recent changes have affected the api already? I tried installing OpenXR so that this script (Spatial Anchors Storage Example | MagicLeap Developer Documentation) would compile, but am having compilation issues with the OpenXR stuff.
That script should still work if the environment is setup correctly for ML2 and openxr. Upgrading a project from mlsdk to openxr is possible, but there are some difficulties, if possible I would suggest starting a fresh project and then using the setup tool Magic Leap Setup Tool | Integration | Unity Asset Store to get the environment setup correctly for openxr.
Sidenote: everything looks good in the Magic Leap Setup Tool. The only prompt left is it wants me to update MLSDK. I have a slightly older version because I had seen somewhere that for Unity version 1.4 is better.
Edit: Could there be issues if using Unity 2022.2 instead of 2022.3?
Sidenote: everything looks good in the Magic Leap Setup Tool. The only prompt left is it wants me to update MLSDK. I have a slightly older version because I had seen somewhere that for Unity version 1.4 is better.
I was referring to the Magic Leap SDK. I ended up updating it and making a few other changes and the project builds, but I'm having some trouble configuring the objects/controllers to act the same way as with MLSDK. The controllers no longer have ray casting and the objects stay static in the headset field of view instead of static in its position in the room--I set up the scene as instructed here ( Building a Simple App with OpenXR | MagicLeap Developer Documentation). I am wondering if there are some simple steps I have overlooked of if this is truly a set up issue.
In addition to this behavior, I am finding that about every other time I try to build the build gets stuck at the script compilation stage regardless if I even changed something or not. Could this be related to some incorrect set up?
It sounds like things are not tracking at all. Double check your OpenXR settings and make sure you have the correct Rig prefab in the scene. You may need to remove all references to the old legacy sdk. If you could post some screenshots of your xr settings that could help. Also yes especially with OpenXR try to keep up to date with the sdk.
One issue I am having is I cannot launch Magic Leap Hub via the project anymore. Could this be an indication of what is going wrong? I changed the settings there so that the most updated SDK was being used.
This is what my settings looks like. The one difference I'm seeing is that the xr interaction tool kit is not under xr plug in management. Could this be an issue?
To test, I put it in a basic scene just to see if the anchors would persist. However, it seems that I can create anchors but not delete them. When I close the app and open the app again, the anchors I created also no longer exist.