Skip to content

Commit

Permalink
rs-sensor-control show ROI values
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown committed Feb 2, 2025
1 parent 4e86cca commit d0f24d2
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions examples/sensor-control/api_how_to.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,16 @@ class how_to
std::cout << " Description : " << description << std::endl;

// Get the current value of the option
float current_value = sensor.get_option(option_type);
std::cout << " Current Value : " << current_value << std::endl;

if (option_type != RS2_OPTION_REGION_OF_INTEREST)
{
float current_value = sensor.get_option(option_type);
std::cout << " Current Value : " << current_value << std::endl;
}
else
{
rs2_option_rect current_value = sensor.get_option_value(option_type)->as_rect;
std::cout << " Current Value : [(" << current_value.x1 << "," << current_value.y1 << "), (" << current_value.x2 << "," << current_value.y2 << ")]" << std::endl;
}
//To change the value of an option, please follow the change_sensor_option() function
}
else
Expand Down Expand Up @@ -307,6 +314,12 @@ class how_to
return;
}

if (option_type == RS2_OPTION_REGION_OF_INTEREST)
{
std::cerr << "Setting ROI is not demonstrated in this example. Check `set_region_of_interest` API" << std::endl;
return;
}

// Each option provides its rs2::option_range to provide information on how it can be changed
// To get the supported range of an option we do the following:

Expand Down

0 comments on commit d0f24d2

Please sign in to comment.