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

DQT prevent depth calibration profile streaming #13558

Merged
merged 2 commits into from
Dec 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions common/subdevice-model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1419,6 +1419,45 @@ namespace rs2
return is_cal_format;
}

bool subdevice_model::is_depth_calibration_profile() const
Nir-Az marked this conversation as resolved.
Show resolved Hide resolved
{
// Check if D555 at depth resolution of 1280x800
std::string dev_name = "";
if( dev.supports( RS2_CAMERA_INFO_NAME ) )
dev_name = dev.get_info( RS2_CAMERA_INFO_NAME );

if( dev_name.find( "D555" ) != std::string::npos )
{
// More efficient to check resolution before format
if( ui.selected_res_id > 0 && res_values.size() > ui.selected_res_id && // Verify res_values is initialized
res_values[ui.selected_res_id].first == 1280 && res_values[ui.selected_res_id].second == 800 )
{
for( auto it = stream_enabled.begin(); it != stream_enabled.end(); ++it )
{
if( it->second )
{
int selected_format_index = -1;
if( ui.selected_format_id.count( it->first ) > 0 )
selected_format_index = ui.selected_format_id.at( it->first );

if( format_values.count( it->first ) > 0 && selected_format_index > -1 )
{
auto formats = format_values.at( it->first );
if( formats.size() > selected_format_index )
{
auto format = formats[selected_format_index];
if( format == RS2_FORMAT_Z16 )
return true;
}
}
}
}
}
}

return false;
}

std::pair<int, int> subdevice_model::get_max_resolution(rs2_stream stream) const
{
if (resolutions_per_stream.count(stream) > 0)
Expand Down
2 changes: 2 additions & 0 deletions common/subdevice-model.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ namespace rs2
return false;
}

bool is_depth_calibration_profile() const;

viewer_model& viewer;
std::function<void()> on_frame = [] {};

Expand Down
4 changes: 2 additions & 2 deletions tools/depth-quality/depth-quality-model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ namespace rs2
if (devices.size())
{
auto dev = devices[0];
bool usb3_device = true;
if (dev.supports(RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR))
{
std::string usb_type = dev.get_info(RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR);
Expand Down Expand Up @@ -550,7 +549,8 @@ namespace rs2

if (_depth_sensor_model->draw_stream_selection(_error_message))
{
if (_depth_sensor_model->is_selected_combination_supported())
if (_depth_sensor_model->is_selected_combination_supported() &&
!_depth_sensor_model->is_depth_calibration_profile())
{
// Preserve streams and ui selections
auto primary = _depth_sensor_model->get_selected_profiles().front().as<video_stream_profile>();
Expand Down