Nuitrack cannot initialize RealSense

General details:

  • OS: x64 Windows 10 Pro
  • Nuitrack License: Trial License
  • Unity Editor: 2021.3.11f1
  • Sensor: Intel RealSense D455

Let me walk you through what I did chronologically:
I created a new Unity project and imported the SDK, started following the first video linked in the tutorial section (LINK), skipped the build settings because for now I just want to get it working, got to 6:30 where you test the script and got this error: “CS0103: The name ‘CurrentUserTracker’ does not exist in the current context”.

One of the comments under that video links an updated tutorial on Github that supposedly avoids that error (LINK), so I start following that one instead, once again, I skip the build settings and try testing the script, this time, I get the following errors on the first frame:

<color=green><b>Test Nuitrack (ver.3607) init was successful! (type: Runtime)</b></color>
Current Scripting Backend Mono2x  Target:Standalone
Device  [Sensor Name: Intel RealSense D455, License: NONE]
UnityEngine.Debug:Log (object)
NuitrackSDKEditor.ErrorSolver.NuitrackChecker:PingNuitrack () (at Assets/NuitrackSDK/Nuitrack/Scripts/Editor/ErrorSolver/NuitrackChecker.cs:89)
NuitrackSDKEditor.ErrorSolver.NuitrackChecker:.cctor () (at Assets/NuitrackSDK/Nuitrack/Scripts/Editor/ErrorSolver/NuitrackChecker.cs:20)
UnityEditor.EditorAssemblies:ProcessInitializeOnLoadAttributes (System.Type[])

Perhaps the sensor is already being used in other program. Or some unexpected error.

UnityEngine.Debug:LogError (object)
NuitrackSDK.ErrorSolver.NuitrackErrorSolver:CheckError (string,bool,bool) (at Assets/NuitrackSDK/Nuitrack/Scripts/ErrorSolver/NuitrackErrorSolver.cs:95)
NuitrackSDK.ErrorSolver.NuitrackErrorSolver:CheckError (System.Exception,bool,bool) (at Assets/NuitrackSDK/Nuitrack/Scripts/ErrorSolver/NuitrackErrorSolver.cs:75)
NuitrackManager:NuitrackInit () (at Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:575)
NuitrackManager:StartNuitrack () (at Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:762)
NuitrackManager:Init () (at Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:283)
NuitrackManager:Awake () (at Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:271)

It is recommended to test on AllModulesScene
UnityEngine.Debug:LogError (object)
NuitrackSDK.ErrorSolver.NuitrackErrorSolver:CheckError (string,bool,bool) (at Assets/NuitrackSDK/Nuitrack/Scripts/ErrorSolver/NuitrackErrorSolver.cs:98)
NuitrackSDK.ErrorSolver.NuitrackErrorSolver:CheckError (System.Exception,bool,bool) (at Assets/NuitrackSDK/Nuitrack/Scripts/ErrorSolver/NuitrackErrorSolver.cs:75)
NuitrackManager:NuitrackInit () (at Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:575)
NuitrackManager:StartNuitrack () (at Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:762)
NuitrackManager:Init () (at Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:283)
NuitrackManager:Awake () (at Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:271)

Also look Nuitrack Troubleshooting page:github.com/3DiVi/nuitrack-sdk/blob/master/doc/Troubleshooting.md
If all else fails and you decide to contact our technical support, do not forget to attach the Unity Log File (https://docs.unity3d.com/ScriptReference/Debug.Log.html or ADB) and specify the Nuitrack version
UnityEngine.Debug:LogError (object)
NuitrackSDK.ErrorSolver.NuitrackErrorSolver:CheckError (string,bool,bool) (at Assets/NuitrackSDK/Nuitrack/Scripts/ErrorSolver/NuitrackErrorSolver.cs:101)
NuitrackSDK.ErrorSolver.NuitrackErrorSolver:CheckError (System.Exception,bool,bool) (at Assets/NuitrackSDK/Nuitrack/Scripts/ErrorSolver/NuitrackErrorSolver.cs:75)
NuitrackManager:NuitrackInit () (at Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:575)
NuitrackManager:StartNuitrack () (at Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:762)
NuitrackManager:Init () (at Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:283)
NuitrackManager:Awake () (at Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:271)

nuitrack.ModuleNotInitializedException: NuitrackException (ModuleNotInitializedException)
  at nuitrack.NativeImporter.throwException (nuitrack.NativeImporter+ExceptionType type) [0x00080] in <057f99c1c0624ebab0b6fa7b4951aaa2>:0 
  at nuitrack.NativeColorSensor..ctor () [0x00012] in <057f99c1c0624ebab0b6fa7b4951aaa2>:0 
  at nuitrack.ColorSensor.Create () [0x0000a] in <057f99c1c0624ebab0b6fa7b4951aaa2>:0 
  at NuitrackManager.NuitrackInit () [0x002d8] in D:\Projects\Tests\Nuitrack Test\Assets\NuitrackSDK\Nuitrack\Scripts\NuitrackManager.cs:513 
UnityEngine.Debug:LogError (object)
NuitrackSDK.ErrorSolver.NuitrackErrorSolver:CheckError (string,bool,bool) (at Assets/NuitrackSDK/Nuitrack/Scripts/ErrorSolver/NuitrackErrorSolver.cs:104)
NuitrackSDK.ErrorSolver.NuitrackErrorSolver:CheckError (System.Exception,bool,bool) (at Assets/NuitrackSDK/Nuitrack/Scripts/ErrorSolver/NuitrackErrorSolver.cs:75)
NuitrackManager:NuitrackInit () (at Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:575)
NuitrackManager:StartNuitrack () (at Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:762)
NuitrackManager:Init () (at Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:283)
NuitrackManager:Awake () (at Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:271)

ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
System.Collections.Generic.List`1[T].get_Item (System.Int32 index) (at <d6232873609549b8a045fa15811a5bd3>:0)
NuitrackManager.get_Users () (at Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:199)
NuitrackSDK.Calibration.CalibrationHandler.Update () (at Assets/NuitrackSDK/Nuitrack/CalibrationRotationScripts/CalibrationHandler.cs:81)

ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
System.Collections.Generic.List`1[T].get_Item (System.Int32 index) (at <d6232873609549b8a045fa15811a5bd3>:0)
NuitrackManager.get_Users () (at Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:199)
NativeAvatar.Update () (at Assets/NativeAvatar.cs:10)

And then the follwing errors on subsequent frames:

ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
System.Collections.Generic.List`1[T].get_Item (System.Int32 index) (at <d6232873609549b8a045fa15811a5bd3>:0)
NuitrackManager.get_Users () (at Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:199)
NuitrackSDK.Calibration.CalibrationHandler.Update () (at Assets/NuitrackSDK/Nuitrack/CalibrationRotationScripts/CalibrationHandler.cs:81)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
System.Collections.Generic.List`1[T].get_Item (System.Int32 index) (at <d6232873609549b8a045fa15811a5bd3>:0)
NuitrackManager.get_Users () (at Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:199)
NativeAvatar.Update () (at Assets/NativeAvatar.cs:10)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

I try the AllModulesScene, I get the following errors on the first frame:

<color=green><b>Test Nuitrack (ver.3607) init was successful! (type: Runtime)</b></color>
Current Scripting Backend Mono2x  Target:Standalone
Device  [Sensor Name: Intel RealSense D455, License: NONE]
UnityEngine.Debug:Log (object)
NuitrackSDKEditor.ErrorSolver.NuitrackChecker:PingNuitrack () (at Assets/NuitrackSDK/Nuitrack/Scripts/Editor/ErrorSolver/NuitrackChecker.cs:89)
NuitrackSDKEditor.ErrorSolver.NuitrackChecker:.cctor () (at Assets/NuitrackSDK/Nuitrack/Scripts/Editor/ErrorSolver/NuitrackChecker.cs:20)
UnityEditor.EditorAssemblies:ProcessInitializeOnLoadAttributes (System.Type[])

ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
System.Collections.Generic.List`1[T].get_Item (System.Int32 index) (at <d6232873609549b8a045fa15811a5bd3>:0)
NuitrackManager.get_Users () (at Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:199)
NuitrackSDK.Calibration.CalibrationHandler.Update () (at Assets/NuitrackSDK/Nuitrack/CalibrationRotationScripts/CalibrationHandler.cs:81)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

Perhaps the sensor is already being used in other program. Or some unexpected error.

UnityEngine.Debug:LogError (object)
NuitrackSDK.ErrorSolver.NuitrackErrorSolver:CheckError (string,bool,bool) (at Assets/NuitrackSDK/Nuitrack/Scripts/ErrorSolver/NuitrackErrorSolver.cs:95)
NuitrackSDK.ErrorSolver.NuitrackErrorSolver:CheckError (System.Exception,bool,bool) (at Assets/NuitrackSDK/Nuitrack/Scripts/ErrorSolver/NuitrackErrorSolver.cs:75)
NuitrackManager:NuitrackInit () (at Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:575)
NuitrackManager:StartNuitrack () (at Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:762)
NuitrackManager:Init () (at Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:283)
NuitrackManager:Awake () (at Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:271)

Also look Nuitrack Troubleshooting page:github.com/3DiVi/nuitrack-sdk/blob/master/doc/Troubleshooting.md
If all else fails and you decide to contact our technical support, do not forget to attach the Unity Log File (https://docs.unity3d.com/ScriptReference/Debug.Log.html or ADB) and specify the Nuitrack version
UnityEngine.Debug:LogError (object)
NuitrackSDK.ErrorSolver.NuitrackErrorSolver:CheckError (string,bool,bool) (at Assets/NuitrackSDK/Nuitrack/Scripts/ErrorSolver/NuitrackErrorSolver.cs:101)
NuitrackSDK.ErrorSolver.NuitrackErrorSolver:CheckError (System.Exception,bool,bool) (at Assets/NuitrackSDK/Nuitrack/Scripts/ErrorSolver/NuitrackErrorSolver.cs:75)
NuitrackManager:NuitrackInit () (at Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:575)
NuitrackManager:StartNuitrack () (at Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:762)
NuitrackManager:Init () (at Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:283)
NuitrackManager:Awake () (at Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:271)

nuitrack.ModuleNotInitializedException: NuitrackException (ModuleNotInitializedException)
  at nuitrack.NativeImporter.throwException (nuitrack.NativeImporter+ExceptionType type) [0x00080] in <057f99c1c0624ebab0b6fa7b4951aaa2>:0 
  at nuitrack.NativeColorSensor..ctor () [0x00012] in <057f99c1c0624ebab0b6fa7b4951aaa2>:0 
  at nuitrack.ColorSensor.Create () [0x0000a] in <057f99c1c0624ebab0b6fa7b4951aaa2>:0 
  at NuitrackManager.NuitrackInit () [0x002d8] in D:\Projects\Tests\Nuitrack Test\Assets\NuitrackSDK\Nuitrack\Scripts\NuitrackManager.cs:513 
UnityEngine.Debug:LogError (object)
NuitrackSDK.ErrorSolver.NuitrackErrorSolver:CheckError (string,bool,bool) (at Assets/NuitrackSDK/Nuitrack/Scripts/ErrorSolver/NuitrackErrorSolver.cs:104)
NuitrackSDK.ErrorSolver.NuitrackErrorSolver:CheckError (System.Exception,bool,bool) (at Assets/NuitrackSDK/Nuitrack/Scripts/ErrorSolver/NuitrackErrorSolver.cs:75)
NuitrackManager:NuitrackInit () (at Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:575)
NuitrackManager:StartNuitrack () (at Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:762)
NuitrackManager:Init () (at Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:283)
NuitrackManager:Awake () (at Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:271)

ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
System.Collections.Generic.List`1[T].get_Item (System.Int32 index) (at <d6232873609549b8a045fa15811a5bd3>:0)
NuitrackManager.get_Users () (at Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:199)
NuitrackSDK.Calibration.CalibrationHandler.Update () (at Assets/NuitrackSDK/Nuitrack/CalibrationRotationScripts/CalibrationHandler.cs:81)

And the following on subsequent frames:

ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
System.Collections.Generic.List`1[T].get_Item (System.Int32 index) (at <d6232873609549b8a045fa15811a5bd3>:0)
NuitrackManager.get_Users () (at Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:199)
NuitrackSDK.Calibration.CalibrationHandler.Update () (at Assets/NuitrackSDK/Nuitrack/CalibrationRotationScripts/CalibrationHandler.cs:81)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

I got the following error(s) running Nuitrack.exe (as admin):

Getting a 3D sensor list...
3D sensor list was updated
Starting test...
    3D sensor serial number: 044422250571
    3D sensor provider name: Realsense2DepthProvider
ERROR: Sample failed. Exit code: 3

Also I tried executing nuitrack_sample.exe just to see if it works (Nuitrack is installed as admin, nuitrack_sample.exe is also run as admin), and the output window is black with a white square in the top left corner, with the following error log:


Sorry I couldn’t copy the log or capture the output window, both windows close automatically and quickly.

Oh, also I tested my RealSense and it works just fine.

I’ll provide any other necessary details, so please help solve this problem!

Why is my question being ignored?
Did I provide too much detail?

Hello @Rab
Launch the Realsense Viewer. What USB version is shown there?
image

@Stepan.Reuk
It turns out I have a USB 2.1.
I’ll admit I only installed the RealSense viewer now so I never bothered to check before.

Could the USB be the problem?
What’s the recommended version?

For Realsense to work properly, you need usb 3

@Stepan.Reuk
I did test the RealSense using it’s official Unity SDK (And RealSense viewer just now), and it’s point cloud mapping was working, but not as well as I was hoping not that I think about it.
I also tested it using an app called VUP and it did track my 3D head movement and face expressions accurately, in hindsight I guess it treated it as a normal webcam.

I did read somewhere else on this forum that you need at least USB 3.0 or higher, so this just confirms it, thank you.
Please keep this thread open until I conform the issue is solved.

1 Like

Hi @Rab

Has your issue been solved after connecting the sensor to USB 3 port?

@Stepan.Reuk
Yes it did actually, thank you.
But then other, issues started happening with the sensor and I thought I’d wait until I received and tested the replacement to close this thread, but I guess that won’t be necessary, as I’ve been told it works just fine.

Thank you so much for your help, you may close this thread.

1 Like