NormandErwan / ArucoUnity

Bring augmented reality to Unity by tracking Aruco markers in real time.
https://normanderwan.github.io/ArucoUnity/
BSD 3-Clause "New" or "Revised" License
203 stars 38 forks source link

Tracking Charuco Board not possible #45

Open juliasser opened 2 years ago

juliasser commented 2 years ago

When I try to open the "TrackMarkers" Scene, add an Empty and add the ArucoCharucoBoard Script plus Aruco Object Displayer and also add it to the ArucoObjects in the ArucoObjectTracker, then I get the following two error messages:

ApplicationException: Mutex is not owned System.Threading.Mutex.ReleaseMutex () (at <695d1cc93cca45069c528c15c9fdd749>:0) (wrapper remoting-invoke-with-check) System.Threading.Mutex.ReleaseMutex() ArucoUnity.Utilities.ArucoCameraSeparateThread.b25_0 () (at Assets/ArucoUnity/Scripts/Utilities/ArucoCameraSeparateThread.cs:93) System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) (at <695d1cc93cca45069c528c15c9fdd749>:0) System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at <695d1cc93cca45069c528c15c9fdd749>:0) System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at <695d1cc93cca45069c528c15c9fdd749>:0) System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) (at <695d1cc93cca45069c528c15c9fdd749>:0) System.Threading.ThreadHelper.ThreadStart () (at <695d1cc93cca45069c528c15c9fdd749>:0) UnityEngine.<>c:b0_0(Object, UnhandledExceptionEventArgs)

NullReferenceException: Object reference not set to an instance of an object ArucoUnity.Objects.Trackers.ArucoObjectsTracker.ArucoCamera_ImagesUpdated () (at Assets/ArucoUnity/Scripts/Objects/Trackers/ArucoObjectsTracker.cs:315) ArucoUnity.Cameras.ArucoCamera.OnImagesUpdated () (at Assets/ArucoUnity/Scripts/Cameras/ArucoCamera.cs:177) ArucoUnity.Cameras.ArucoCamera.Update () (at Assets/ArucoUnity/Scripts/Cameras/ArucoCamera.cs:67)

Is tracking a Charuco Board not supported?

Thanks!

egemenertugrul commented 1 year ago

Some discrepancies between the code on GitHub and the .unitypackage cause this.

This line: if (arucoCharucoBoard.DetectedIds.Size() > 0) should be: if (arucoCharucoBoard.DetectedIds != null && arucoCharucoBoard.DetectedIds.Size() > 0)

as seen here.