Skip to content
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

D435 (matlab) change laser power and exposure time #3358

Closed
aneim opened this issue Mar 1, 2019 · 9 comments
Closed

D435 (matlab) change laser power and exposure time #3358

aneim opened this issue Mar 1, 2019 · 9 comments

Comments

@aneim
Copy link

aneim commented Mar 1, 2019

Hello, I'm using D435 with matlab wrapper.
i have long tried to figure that out, but still don't know how to turn off/on the IR Projector or how to change its Laser Power manually which should be possible according to the data sheet. Same goes for controlling the exposure time.
Can anyone tell me what the coding for that would look like?
thanks in advance!

@MartyG-RealSense
Copy link
Collaborator

Code used with the MATLAB wrapper is said to be almost 1:1 the same as C++ code. So you should be able to adapt C++ examples for the wrapper.

The link below may be of use to you.

#1663

@aneim
Copy link
Author

aneim commented Mar 6, 2019

Thank you for your answer. Sadly i still did not manage to figure out the correct syntax. Working with the mex file implemented in the matlab wrapper is kind of confusing for me so its basically try and error. I would therefore appreciate some further tips very much.
Thank you very much in advance

@MartyG-RealSense
Copy link
Collaborator

I do not have any further information on this subject unfortunately. Hopefully one of the Intel guys on this forum can provide help. Good luck!

@RealSenseCustomerSupport
Copy link
Collaborator


Hi aneim,

You can do something like following:

profile = pipe.start();
dev = profile.get_device();
d_sensor = dev.first('depth_sensor');
disp(d_sensor.is('depth_sensor'));
if d_sensor.supports_option(optionemitter_enabled)
    d_sensor.set_option(option.emitter_enabled, <_**0 OR 1**_>);
end

And then similarly for changing exposure time (with supported options here: https://github.com/IntelRealSense/librealsense/blob/master/wrappers/matlab/option.m)

Thanks!

@RealSenseCustomerSupport
Copy link
Collaborator


Hi aneim,

Wonder if you have any update?
If nothing else is needed, this one will be closed out soon.

Thanks!

@aneim
Copy link
Author

aneim commented Mar 26, 2019

Hello.
Thank you very much and sorry for my delayed answer. That one solved it for me.
Thanks again,
aneim

@RealSenseCustomerSupport
Copy link
Collaborator


Hi aneim,

Thanks for the update. Glad that it works for you.
Closing this one.

Thanks!

@danielesser1
Copy link

I tried using this code to change the options for a D405 camera in matlab, however it seems that only a few of the options are supported. Why can't I change options such as filter_option, accuracy, sensor_mode...

These options are available in realsense viewer, so it seems that the D405 camera supports them.

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Sep 2, 2023

Hi @danielesser1 The MATLAB wrapper's programming language is almost 1:1 with the SDK's C++ language, so if an option is supported for the D405 then it should be possible to access it through the MATLAB wrapper. A list of the wrapper's options can be found at the link below.

https://github.com/IntelRealSense/librealsense/blob/master/wrappers/matlab/option.m

Options 0-11 are all RGB options. The rest after 11 are depth options.

The D405 does not have a separate RGB sensor and so its RGB options are accessed via the depth sensor, as RGB is provided by the depth sensor on D405.

It is possible to set an option in MATLAB with the option name instead of its number, so you could try that to see whether it makes a difference.

profile = pipe.start();
dev = profile.get_device();
d_sensor = dev.first('depth_sensor');
disp(d_sensor.is('depth_sensor'));
if d_sensor.supports_option(option.emitter_enabled)
d_sensor.set_option(option.emitter_enabled, <_**0 OR 1**_>);
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants