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 depth clamp min/max from C++ and python code #2199
Labels
Comments
You can set the sensors options with that, from this file (I don't know if this is going to help) :
|
Depth clamp controls for the D400 are exposed as part of "advanced mode" API, please take a look at python-rs400-advanced-mode-example.py, the relevant properties are part of |
Thanks for your help, it works (also in C++). The code (based on multicam exemple)void DeviceWrapper::enable_device(Camera &camera, unsigned int export_flag) {
std::string serial_number(camera.getSerial());
std::lock_guard<std::mutex> lock(_mutex);
if (_devices.find(serial_number) != _devices.end()) {
std::cout << "Camera already enabled : " << serial_number << std::endl;
return; //already in
}
// Create a pipeline from the given device
rs2::pipeline p;
rs2::config cfg;
cfg.enable_device(serial_number);
rs400::advanced_mode advanced_device(camera.getDevice());
auto depth_table = advanced_device.get_depth_table();
depth_table.depthClampMax = 1300; // 1m30 if depth unit at 0.001
advanced_device.set_depth_table(depth_table);
// Start the pipeline with the configuration
rs2::pipeline_profile profile = p.start(cfg);
//apply the chosen preset
applyPresetFromFlag(preset_flag, camera.getDevice());
camera.deviceContent = DeviceContent{{}, {}, p, profile, {}, {}};
// Hold it internally
_devices.emplace(serial_number, &(camera.deviceContent));
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I would like to set depth clamp min/max from my code without exporting a .json from the viewer and without decease of the depth quality.
Thanks!
I tried without success :
sensor.set_option(RS2_OPTION_MAX_DISTANCE, 1.f);
The text was updated successfully, but these errors were encountered: