-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C# .NET Problem loading json files #5117
Comments
The code being used is as follows: var adv = AdvancedDevice.FromDevice(pp.Device); |
The C# wrapper still does not have access to the Advanced Mode instructions, as far as I know. A C# code example for loading a json file can be found here: In the case of this example, the filename '1.json' refers to the "Default" visual preset json. Substitute in your own json file-name if you are using your own choice of json other than Default. The easiest way to create your own json file is to define settings in the RealSense Viewer and then export them as a json using an icon on the toolbar at the top of the Viewer's options side-panel. |
I would like a response from Intel regarding this. The problem of loading these files was reported over a year ago. Accessing the advanced features of the camera is necessary for professional applications. |
I had some recollection of this subject being discussed earlier this year on the Intel Support forum and dug out the link. An Intel RealSense support team member advised accessing Advanced Mode in C# via a C# wrapper script called NativeMethods.cs |
I would rather investigate and fix the problem with the above code than search for a workaround at the moment. It could well be that the workaround suffers from the same problem. The following code should work: var adv = AdvancedDevice.FromDevice(pp.Device); Indeed I tried this in one of the sample projects and it works there. In my project however I get the following error message: System.Exception: 'hr returned: HResult 0x8007001f: "A device connected to the system does not work." rs2_load_json(dev:084AA598, json_content:1101ABC0, content_size:3595)' My project is naturally more complex as I need to be able to start / stop capture without memory leaks as well as analyse images etc. It carries things out in much the same way however in the same order. Understanding the above error message, why, where and how it happens would help. |
Hi @KarlAbson, A simple C# app with json file loading has no the issue. Do you have any librealsense log there when you run your app with this loading exception issue? |
Thanks for the reply. I managed to fix this. The problem was related to the following case: Simply there are a number of issues with the C# wrapper. The dlls are named wrong. He cannot find the realsense2.dll as it is now called realsense2d.dll. Also the C# projects are set to AnyPC by default. There are no mention of these things in the read me so it took time to identify the problem. |
Adding a note that I am now the Intel RealSense team member handling this case. |
Issue Description
On loading a json file a System.Exception occurs. This appears to be the case both for json files downloaded and those created through Realsense viewer.
The full error is:
hr returned: HResult 0x8007001f: "A device connected to the system does not work."
rs2_load_json(dev:07BDB9F8, json_content:11B39ED0, content_size:3595)'
Issues with loading json files in .Net were reported back in Dec 2018 in #2854.
This job was closed as fixed?
Is a simple way of changing the advanced settings available in .Net yet? This is really needed.
Many thanks,
Karl
The text was updated successfully, but these errors were encountered: