I have used a the code provided by magic leap for marker detection. the object is in world space, all the XR rig and main camera is at its origin or 0 position. It seems that selecting ArUco Dict does not help much either. I need the accurate position for the QR Code.
I have also tried with vuforia and that is also not accurate in this case.
also when you change the position and go further away from the QR or Marker offset is increasing.
here is the code
private void OnTrackerResultsFound(MLMarkerTracker.MarkerData data)
{
Debug.Log($"{data.Type}===================dataType================");
string id = "";
float markerSize = .01f;
switch (data.Type)
{
case MLMarkerTracker.MarkerType.Aruco_April:
id = data.ArucoData.Id.ToString();
markerSize = ArucoMarkerSize;
break;
case MLMarkerTracker.MarkerType.QR:
id = _asciiEncoder.GetString(data.BinaryData.Data, 0, data.BinaryData.Data.Length);
markerSize = QrCodeMarkerSize;
break;
case MLMarkerTracker.MarkerType.EAN_13:
case MLMarkerTracker.MarkerType.UPC_A:
id = _asciiEncoder.GetString(data.BinaryData.Data, 0, data.BinaryData.Data.Length);
Debug.Log("No pose is given for marker type " + data.Type + " value is " +
data.BinaryData.Data);
break;
}
Debug.Log($"{id}===================dataType================");
if (id == "TMF Center")
{
Debug.Log($"{data.ReprojectionError} Your reprojection error ===================");
marker.transform.position = data.Pose.position;//-new Vector3(0.2f,0f,0f);
marker.transform.rotation = data.Pose.rotation;
}
}
Unity Editor version: 2022.3.7f1
ML2 OS version:1.6.0
Unity SDK version:1.4.0-dev2
Host OS: Windows
current Image target is for
public MLMarkerTracker.ArucoDictionaryName ArucoDict = MLMarkerTracker.ArucoDictionaryName.DICT_5X5_100;
Darshak Sitapara is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.