View my account

Setting and Querying Options in Matlab with D405

Comments

3 comments

  • MartyG

    Hi Daniel S Esser  Thanks very much for your questions.

     

    1.  Could you provide further information please about the meaning of "trying to query the range for the accuracy object".

     

    For example, if you are trying to find the distance from the camera to the target object then uint16_t would typically be used, like in the MATLAB code example at the link below.

    https://github.com/IntelRealSense/librealsense/issues/8241#issuecomment-769735273

     

    2.  The link below has a discussion about multicam with MATLAB.

    https://github.com/IntelRealSense/librealsense/issues/3733

    0
    Comment actions Permalink
  • Daniel S Esser

    Thanks for the quick reply. I realized my initial question was confusing (I didn't mean the camera depth range, I meant the range/set of allowed option values for a particular option). I think I have figured out how to change options.

    First I select the device and sensor:

    myDevice = profile.get_device();
    d_sensor = myDevice.first('depth_sensor');

    Then I create an option enumerator and set/get the option value

    option = realsense.option(uint64(1));
    d_sensor.get_option(option);
     
    My issue now is that most of the options do not seem to be supported. Only options 0-11 appear to work. I would like to change options such as accuracy (14), filter_option (16), min_distance (33) and max_distance(34) etc.
     
    How can I change these options? They appear to be valid options in realsense viewer fpor the D405 camera.
     
    Thank you!
     
    0
    Comment actions Permalink
  • MartyG

    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

     

    I note your mention that only options 0-11 are apparently working.  These are all RGB options.  The rest after 11 are depth options.  I see that you are accessing the depth sensor in your script, so the options after 11 should be accessible.

     

    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
    0
    Comment actions Permalink

Please sign in to leave a comment.