librealsense icon indicating copy to clipboard operation
librealsense copied to clipboard

Unity Wrapper / Ros Reader

Open frenchtouchXR opened this issue 8 years ago • 7 comments

Hello,

I tried to enable the recorder and reader on the Unity Wrapper in the realsenseconfiguration.cs file. The recorder works well but when I try to read the recorded file I have this error :

Exception: Failed to resolve request. Request to enable_device_from_file("my_file") was invalid, Reason: Failed to create ros reader: Bag unindexed rs2_config_resolve(config:000000003A92A230, pipe:000000003A929D90)

What do you think about that ?

Best regards

François

frenchtouchXR avatar Jun 08 '18 16:06 frenchtouchXR

Hi @frenchtouchXR Usually, Bag unindexed error indicates that the recording was not properly closed. When using the .NET wrapper it is especially critical to make sure all wrapper objects are cleaned-up using .Dispose() before closing the application / game.

dorodnic avatar Jun 08 '18 19:06 dorodnic

Thanks for your quick answer. You're talking about the .net Dispose() fonction.I tried all those lines :

m_pipeline.Stop(); GameObject.Find("ColorPointCloud").GetComponent().depthFrame.Dispose(); GameObject.Find("ColorPointCloud").GetComponent().vidFrame.Dispose();

    GameObject.Find("ColorPointCloud").GetComponent<ColorPointCloudGenerator>().pc.Dispose();
    GameObject.Find("ColorPointCloud").GetComponent<ColorPointCloudGenerator>().aligner.Dispose();
    m_config.Dispose();
    
    m_pipeline.Dispose();

    ActiveProfile.Device.Sensors[0].Stop();
    ActiveProfile.Device.Sensors[0].Close();
    ActiveProfile.Device.Sensors[1].Stop();
    ActiveProfile.Device.Sensors[1].Close();

None of them works. It seems the file is recorded but not closed until the Unity session is closed. And the index is never integrated to the file.

frenchtouchXR avatar Jun 08 '18 22:06 frenchtouchXR

Any news so far ?

frenchtouchXR avatar Jun 14 '18 01:06 frenchtouchXR

[Realsense Customer Engineering Team Comment] Hi @frenchtouchXR,

Need to check internally about this feature request and see how soon it can be available.

[Realsense Customer Engineering Team Comment] Hi @frenchtouchXR,

Please try librealsense 2.14.0 to see how it works.

Hello,

It works fine. Thank you. I' m now trying to make a multicam rec on Unity. I changed the static function in the realsensedevice inspector script to a public one. Then I try to get the realsense device by entering its serial number from the other scripts. I get this error :

The same field name is serialized multiple times in the class or its parent class. This is not supported: Base(MonoBehaviour) myRealSenseDevice

frenchtouchXR avatar Jul 31 '18 05:07 frenchtouchXR

I think i il close this thread and open a new one.

frenchtouchXR avatar Jul 31 '18 05:07 frenchtouchXR