Device Localisation Logging

Give us as much detail as possible regarding the issue you're experiencing.

Unity Editor version: 2022.3.38f1
Magic Leap MRTK3 1.2.0
MLSDK 2.4.0
Mixed Reality OpenXR Plugin 1.10.0
OpenXR Plugin 1.11.0
ML OS 1.9.0

Hi,
I am wondering whether it is possible to log the ML2 location in 3D space (3D coordinates) as a user moves in a particular space. I am assuming a Space would need to be created?

Following any necessary preparations, how could one log such data please?

Thanks

Hello,

There are various ways that you can log information, including spatial poses.

If you're using Unity, you could log the current transform of the gameobject that tracks the current location of the ML2 (eg- the object that has an instance of the TrackedPoseDriver, probably the Camera if you're using the ML rig prefab or you added Unity's default XR origin object)

Whether or not you would want to use a Space depends on your requirements. If you don't localize into a Space, positional head tracking will still work and you'll still get coherent poses. The origin will just change every time that headtracking is reset. If you're using OpenXR, there are a few options for different OpenXR reference spaces that you can use to control how the origin behaves-

If you need to log poses that are relative to a consistent location in your physical environment, then that might be a reason to create a Space. If you localize into a Space, then you can use the LocalizationMap feature to get a consistent world origin or create a spatial anchor and log poses relative to that-

As for how to log information, the easiest way to log from Unity would be to just use the Unity debug log functions-

When run on a ML2, calls to Unity's Debug.Log will write data to Android logcat, which you can monitor using adb-

Best,
Adam

1 Like

Many thanks Adam, very helpful.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.