Give us as much detail as possible regarding the issue you're experiencing.
Unity Editor version:
ML2 OS version:
MLSDK version:
Host OS: (Windows/MacOS)
Error messages from logs (syntax-highlighting is supported via Markdown):
I'm using camera feed for precise CV work where I need very correct locations of pixels for ray casting etc. So I'm following Intrinsic/Extrinsic Parameters | MagicLeap Developer Documentation to get the info to transform the results. The distortion correction seems to be doing its job (tough to be 100% sure) but when I try to get the camerapose, I hit catastrophic errors.
By way of example, when I uncomment in the following code, suddenly my app won't keep rendering past a few frames
private void SetCapturePose(MLCameraBase.ResultExtras resultextras)
{
Debug.Log($"Capture: Starting pose finder. \n" +
$"Timestamp: {resultextras.VCamTimestamp} \n" +
$"Intrinsics: {resultextras.Intrinsics?.ToString() ?? "null"}");
//Set pose info for later use in correction and raycasting.
Transform camTform = Cam.transform;
var cameraPose = new Pose(camTform.position, camTform.rotation);
// if (MLCVCamera.GetFramePose(resultextras.VCamTimestamp, out Matrix4x4 cameraTransform).IsOk)
// CapturePose = new Pose(cameraTransform.GetPosition(), cameraTransform.rotation);
// else
// Debug.LogError("Capture: Attempting to get pose from resultExtras failed: VCamTimestamp is 0");
Debug.Log($"Camera pose: {cameraPose} \n" +
$"Capture pose: {CapturePose}");
}
I'm wondering if the sample code is missing context for how we need to get at that information. It also seems like the informaiton I'm looking for (the pose of the physical camera) should have a static relationship to the virtual camera so I should be able to apply a single transformation to the virtual camera pose instead of this constant query, right? If so, what's the transformation matrix?
Here's some copies of the errors I'm getting:
2023/11/09 06:17:40.493 18182 18205 Error Unity Error: GetUnityPose in the Magic Leap API failed. Reason: MLResult_PoseNotFound
2023/11/09 06:17:40.493 18182 18205 Error Unity UnityEngine.XR.MagicLeap.MLResult:DidNativeCallSucceed(Code, String, Predicate`1, Boolean)
2023/11/09 06:17:40.493 18182 18205 Error Unity UnityEngine.XR.MagicLeap.MLAnchors:GetLocalizationInformation(LocalizationInfo&)
2023/11/09 06:17:40.493 18182 18205 Error Unity UnityEngine.XR.MagicLeap.MLAnchors:GetLocalizationInfo(LocalizationInfo&)
2023/11/09 06:17:40.493 18182 18205 Error Unity Argyle.Risa.AnchorTech.ML2.ML2RPManager:GetLocalizationInfo()
2023/11/09 06:17:40.493 18182 18205 Error Unity Argyle.RISA.AnchorTech.AnchorTechType:get_Current()
2023/11/09 06:17:40.493 18182 18205 Error Unity Argyle.RISA.<SelectRisaVersion>d__8:MoveNext()
2023/11/09 06:17:40.493 18182 18205 Error Unity System.Runtime.CompilerServices.AsyncVoidMethodBuilder:Start(TStateMachine&)
2023/11/09 06:17:40.493 18182 18205 Error Unity Argyle.RISA.RisaSelector:SelectRisaVersion()
2023/11/09 06:17:40.493 18182 18205 Error Unity
2023/11/09 06:17:40.495 18182 18205 Error Unity Error: GetUnityPose in the Magic Leap API failed. Reason: MLResult_PoseNotFound
2023/11/09 06:17:40.495 18182 18205 Error Unity UnityEngine.XR.MagicLeap.MLResult:DidNativeCallSucceed(Code, String, Predicate`1, Boolean)
2023/11/09 06:17:40.495 18182 18205 Error Unity UnityEngine.XR.MagicLeap.MLAnchors:GetLocalizationInformation(LocalizationInfo&)
2023/11/09 06:17:40.495 18182 18205 Error Unity UnityEngine.XR.MagicLeap.MLAnchors:GetLocalizationInfo(LocalizationInfo&)
2023/11/09 06:17:40.495 18182 18205 Error Unity Argyle.Risa.AnchorTech.ML2.ML2RPManager:GetLocalizationInfo()
2023/11/09 06:17:40.495 18182 18205 Error Unity Argyle.RISA.<SelectRisaVersion>d__8:MoveNext()
2023/11/09 06:17:40.495 18182 18205 Error Unity System.Runtime.CompilerServices.AsyncVoidMethodBuilder:Start(TStateMachine&)
2023/11/09 06:17:40.495 18182 18205 Error Unity Argyle.RISA.RisaSelector:SelectRisaVersion()
2023/11/09 06:17:40.495 18182 18205 Error Unity