-
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
Set present mode using Matlab wrapper #9839
Comments
Hi @aramir28 Whilst I do not have a pre-made script for setting this preset in the RealSense MATLAB wrapper, I did handle a case An alternative approach would be to configure settings in the RealSense Viewer that are comparable to the Short Range preset and then export the settings in the Viewer as your own custom json file using the json export button on the toolbar near the top of the Viewer's options side-panel. You could then load that custom json file into the MATLAB wrapper using the MATLAB script provided in #5236 - 'json' is another name for a Visual Preset file. The easiest way to configure the Viewer to match the Short Range preset would be simply to select 'Short Range' from the preset drop-down as the settings in the Viewer will automatically update to those of the Short Range preset. Those settings can then be exported in your own json file. |
I have exported the preset and try using the example from #5236 as: ctx = realsense.context(); and I get the following error: "Error using librealsense_mex null pointer passed for argument "dev" It seems I have used "adv.load_json(json_string);" incorrectly. What should I change? Also, Where should I place the .json file? Inside the +realsense folder? |
The MATLAB wrapper's advanced_mode_example.m example script provides an example of setting up Advanced Mode in the wrapper and defining json_string. In regard to the location to place the custom json: I am not certain of this. Putting it in the same folder that your MATLAB program script is in would be a logical location to try though. |
if I use that example script, I get this error Error using realsense.advanced_mode_example (line 10) Somebody commented in 7182#issuecomment that this camera model does not support Advanced Mode interface. However, It seems that there is a workaround for the python wrapper as shown in 6902 Any suggestion about how to get it to work in MATLAB? |
I researched the subject extensively but was unfortunately able to find a solution to getting around a lack of Advanced Mode on L515 when using the MATLAB wrapper. A workaround that I considered may be to replicate some of the main effects of loading the Short Range preset by instead using set_option to configure the values of the Laser Power and Receiver Gain settings of the camera. Two key effects of the Short Range preset is that it sets Laser Power to '93' (default 100) and Receiver Gain to '18' (default 9). In #3358 (comment) a RealSense team member provides an example of MATLAB code for setting an option value with set_option.
Please note that in the line if d_sensor.supports_option(optionemitter_enabled) there is an apparent typo, where optionemitter_enabled should be option.emitter_enabled The link below has a list of options settings in the MATLAB wrapper that could be substituted into the above code in place of emitter_enabled https://github.com/IntelRealSense/librealsense/blob/master/wrappers/matlab/option.m I apologize that on this particular question I could not provide the desired answer. |
What option correspond to Receiver Gain? I did not find an item with the same name in the link you provided. I only found gain, digital gain, and receiver_sensitivity. Also, when trying option = realsense.option.gain(); I get the error object doesn't support option # 4 |
Do you mean that Receiver Gain is not listed in the option.m list of MATLAB wrapper settings, please? If so, I could not find a Receiver Gain configuration option either. How does the program perform if you only configure Laser Power? |
Hi @aramir28 Do you require further assistance with this case, please? Thanks! |
Case closed due to no further comments received. |
Unable to set the visual preset mode using Matlab on an L515 depth camera
While trying to set the general configuration for data acquisition using Matlab, I haven't been able to use the options class correctly.
So far, I've tried the idea from https://support.intelrealsense.com/hc/en-us/community/posts/360038122553-how-do-I-set-rs2-options-in-the-python-examples-
option = realsense.option.visual_preset
preset = realsense.l500_visual_preset.short_range
depth_sensor = depth_sensor.set_option(option, preset)
but this returns the error: _"Unable to resolve the name realsense.l500_visual_preset.short_range."
I also tried the idea in https://github.com/IntelRealSense/librealsense/issues/1011
depth_sensor = profile.get_device();
depth_sensor.set_option(option, preset)
and in this case the error reads "Unrecognized method, property, or field 'set_option' for class 'realsense.device'."
What is the correct way to use the options class while using Matlab?
The text was updated successfully, but these errors were encountered: