- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When I try to apply a preset by using the rs2_set_option(..., RS2_OPTION_VISUAL_PRESET, 1, ...) it doesnt work. There is no error but also there is no effect at all.
However, if I load one of your json-presets (from https://github.com/IntelRealSense/librealsense/wiki/D400-Series-Visual-Presets) by using rs2_load_json() everything works fine.
Are there any special steps to consider when doing it the rs2_set_option way??
regards
Mats B
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What settings are you trying to change with the json please? Earlier in the year (May 2018), it was not possible to set FPS and resolution with a json because the pipeline sets them instead. Intel were thinking about looking into how to change this, but I don't know if they have implemented that yet.
In the link below is a statement about it from Sergey 'Dorodnic' Dorodnicov, the RealSense SDK Manager.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No we are not trying to these two parameters. We just try to set the parameters relevant to HighAccuracy etc.
/MB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello matspetter,
Thank you for your interest in the Intel RealSense D435 camera.
On GitHub issue https://github.com/IntelRealSense/librealsense/issues/1217 Using advanced mode presets via C API, dorodnic have posted a code that you can use as a start-up for your project. It uses the rs2_set_option function.
Best regards,
Eliza
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes I have looked into that example and we are (more or less) doing the same thing without any luck.
But isn't it strange that I can set presets with your json-files but not with set_option ?
The HighAccuracy, Default, Hand etc presets, they are not possible to over-write or? I mean if we by mistake could have overwritten them?
Are there any preconditions that are different when setting presets via json compared to set_option ?
/MB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello matspetter,
Is it possible to provide us the code that you are using in order to test it?
Thank you in advance,
Eliza
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi. Our code typically looks like this:
context = rs2_create_context(API_VERSION, error)
deviceList = rs2_query_devices(context, error)
device = rs2_create_device(deviceList, 0, error)
list = rs2_query_sensors(device, error)
n = rs2_get_sensors_count(list, error)
for (i=0 ; i
sensor = rs2_create_sensor(list, i, error)
if (rs2_is_sensor_extendable_to(sensor, RS2_EXTENSION_DEPTH_SENSOR, error)) {
depthSensor = sensor
}
}
rs2_delete_sensor_list(list)
serial = rs2_get_device_info(device, RS2_CAMERA_INFO_SERIAL_NUMBER, error)
pipelineD = rs2_create_pipeline(context, error)
configD = rs2_create_config(error)
rs2_config_enable_device(configD, serial, error)
rs2_set_option(depthSensor, RS2_OPTION_LASER_POWER, 360.0)
if (setPresetViaOption) {
//========= this does not =====================
preset = 3.0 // HighAccuracy
rs2_set_option(depthSensor, RS2_OPTION_VISUAL_PRESET, preset, error)
//=============================================
} else {
//========= this WORKS ========================
rs2_load_json(device, jsonBytes, jsonBytes.size, error)
//=============================================
}
rs2_config_enable_stream(configD, RS2_STREAM_DEPTH, 0, width, height, RS2_FORMAT_Z16, fps, error)
pipelineProfileD = rs2_pipeline_start_with_config(pipelineD, configD, error)
rs2_set_option(depthSensor, RS2_OPTION_ENABLE_AUTO_EXPOSURE, 1.0)
after that we start reading frames. Both when we load the preset via set_option and via json it works to load frames. The difference is that when doing it via set_option it does not have any effect on the frames.
After each call above we also check that we didn't get any error in the error-variable.
/MB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello matspetter,
Thank you!
Could you please use: rs2_set_option((const rs2_options*)depthSensor, RS2_OPTION_VISUAL_PRESET, preset, error); instead of rs2_set_option(depthSensor, RS2_OPTION_VISUAL_PRESET, preset, error)?
Looking for ward to your reply!
Best regards,
Eliza
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page