I am trying to use a prerecorded .bag file as input to Nuitrack in Unity instead of a RealSense camera. To do so I have changed the FileRecord module of the nuitrack.config file to the exact path of the desired .bag file. The code is as follows:
However when I run Nuitrack after giving it the new path, the Realsesnse depth camera is still used as the input. If I unplug the camera, I get the following error:
nuitrack.ModuleNotInitializedException: NuitrackException (ModuleNotInitializedException): Can’t create DepthSensor module
AstraProPerseeDepthProvider: Can’t open device ( DeviceOpen using default: no devices found)
AzureKinectDepthProvider: No devices detected
OpenNI2DepthProvider: Can’t open device ( DeviceOpen using default: no devices found
Am I taking the wrong aproach to using a bag file as an input? Any help would be appreciated.
I am using Unity 2018.4.11 and the latest version of Nuitrack.
Use a slash instead of a backslash
Or you can use record files in NuitrackManager component
Thanks for your quick reply. I’ve just tried replacing the backslashes with forward slashes as you suggested but now when I press run the Unity just closes and I don’t know why, any thought?
Also, when I look in NuitrackScrips, there is no “Use record file” in the NuitrackManager section. Could it be because of the version of Unity I am using?
When I look in NuitrackScrips, there is no “Use record file” in the NuitrackManager section. Could it be because of the version of Unity I am using?
Yep, maybe. You can download latest version NuitrackSDK.unitypackage from github https://github.com/3DiVi/nuitrack-sdk/tree/master/Unity3D
I tried dowloading and importing the newest version of the NuitrackSDK.unitypackage to my project but many errors occured so I tried installing and transferring my project to Unity 2021.1.13 thinking that might some it but I still get the following errors when trying to import the new package:
… or, now that I have upgraded to the newest version of Unity, when I put the .bag file path into the nuitrack.config FileRecord module I get the following error:
Which of these issues would be easier to resolve?
It looks like there is a problem with the file. Is this recording being played in RealsenseViewer? (And what streams are recorded in it?)
I have now changed the bag file to a recording that has depth, color and infrared streams and I am now getting the same problem as previously where Unity seems to just close/crash when I hit run with no error or crash message. Any thoughts?
@john can you send this file to us so we can check?
I have sent you the files, any idea what is going wrong?
Your file does not work correctly with us either (on windows, but for some reason it works fine on linux). We also see errors when playing it in realsense viewer. Try writing a small file with only the color and depth streams. You can also experiment with other settings when recording