Skip to content

Commit

Permalink
Merge pull request IntelRealSense#11001 from ev-mp/D4XX_OCC_WW43
Browse files Browse the repository at this point in the history
OCC/Tare integration with MIPI SKU
  • Loading branch information
ev-mp authored Nov 10, 2022
2 parents 44e8a80 + 4035ee7 commit d02beeb
Show file tree
Hide file tree
Showing 14 changed files with 439 additions and 38 deletions.
20 changes: 14 additions & 6 deletions common/on-chip-calib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ namespace rs2
on_chip_calib_manager::on_chip_calib_manager(viewer_model& viewer, std::shared_ptr<subdevice_model> sub, device_model& model, device dev, std::shared_ptr<subdevice_model> sub_color, bool uvmapping_calib_full)
: process_manager("On-Chip Calibration"), _model(model), _dev(dev), _sub(sub), _viewer(viewer), _sub_color(sub_color), py_px_only(!uvmapping_calib_full)
{
device_id_string = "Unknown";
if (dev.supports(RS2_CAMERA_INFO_PRODUCT_ID))
{
std::string dev_pid = dev.get_info(RS2_CAMERA_INFO_PRODUCT_ID);
if (val_in_range(dev_pid, { std::string("0AD3") }))
device_id_string = _dev.get_info(RS2_CAMERA_INFO_PRODUCT_ID);
if (val_in_range(device_id_string, { std::string("0AD3") }))
speed = 4;
}
if (dev.supports(RS2_CAMERA_INFO_FIRMWARE_VERSION))
Expand Down Expand Up @@ -405,6 +406,12 @@ namespace rs2
bool frame_arrived = false;
try
{
if (_sub->s->supports(RS2_OPTION_THERMAL_COMPENSATION))
{
thermal_loop_prev = _sub->s->get_option(RS2_OPTION_THERMAL_COMPENSATION);
_sub->s->set_option(RS2_OPTION_THERMAL_COMPENSATION, 0.f);
}

bool run_fl_calib = ( (action == RS2_CALIB_ACTION_FL_CALIB) && (w == 1280) && (h == 720));
if (action == RS2_CALIB_ACTION_TARE_GROUND_TRUTH)
{
Expand Down Expand Up @@ -908,7 +915,7 @@ namespace rs2
",\n \"apply preset\":" << (apply_preset ? 1 : 0) <<
",\n \"accuracy\":" << accuracy <<
",\n \"scan only\":" << (host_assistance ? 1 : 0) <<
",\n \"interactive scan\":" << 1 << "}";
",\n \"interactive scan\":" << 0 << "}";
}
else if (action == RS2_CALIB_ACTION_ON_CHIP_FL_CALIB)
{
Expand Down Expand Up @@ -961,7 +968,7 @@ namespace rs2

bool calib_done(!_new_calib.empty());

int timeout_sec(30);
int timeout_sec(10);
timeout_sec *= (1 + static_cast<int>(action == RS2_CALIB_ACTION_ON_CHIP_CALIB)); // when RS2_CALIB_ACTION_ON_CHIP_CALIB is in interactive-mode the process takes longer.
auto start = std::chrono::high_resolution_clock::now();
bool is_timed_out(std::chrono::high_resolution_clock::now() - start > std::chrono::seconds(timeout_sec));
Expand Down Expand Up @@ -2063,6 +2070,7 @@ namespace rs2
ImGui::SetTooltip("%s", "Calculate ground truth for the specific target");

ImGui::SetCursorScreenPos({ float(x + 9), float(y + height - ImGui::GetTextLineHeightWithSpacing() - 30) });
get_manager().host_assistance = (get_manager().device_id_string == std::string("ABCD") ); // To be used for MIPI SKU only
bool assistance = (get_manager().host_assistance != 0);
if (ImGui::Checkbox("Host Assistance", &assistance))
get_manager().host_assistance = (assistance ? 1 : 0);
Expand Down Expand Up @@ -2158,9 +2166,9 @@ namespace rs2
// ImGui::SetTooltip("%s", "On-Chip Calibration Extended");

ImGui::SetCursorScreenPos({ float(x + 9), float(y + height - ImGui::GetTextLineHeightWithSpacing() - 31) });
get_manager().host_assistance = (get_manager().device_id_string == std::string("ABCD") ); // To be used for MIPI SKU only
bool assistance = (get_manager().host_assistance != 0);
if (ImGui::Checkbox("Host Assistance", &assistance))
get_manager().host_assistance = (assistance ? 1 : 0);
ImGui::Checkbox("Host Assistance", &assistance);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("%s", "check = host assitance for statistics data, uncheck = no host assistance");

Expand Down
1 change: 1 addition & 0 deletions common/on-chip-calib.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ namespace rs2
const std::string Y8_FORMAT = "Y8";
const std::string Z16_FORMAT = "Z16";
const std::string RGB8_FORMAT = "RGB8";
std::string device_id_string;


void calibrate();
Expand Down
19 changes: 10 additions & 9 deletions include/librealsense2/h/rs_frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,18 @@ typedef enum rs2_frame_metadata_value
RS2_FRAME_METADATA_FRAME_LED_POWER , /**< Led power value 0-360. */
RS2_FRAME_METADATA_RAW_FRAME_SIZE , /**< The number of transmitted payload bytes, not including metadata */
RS2_FRAME_METADATA_GPIO_INPUT_DATA , /**< GPIO input data */
RS2_FRAME_METADATA_SEQUENCE_NAME , /**< sub-preset id */
RS2_FRAME_METADATA_SEQUENCE_ID , /**< sub-preset sequence id */
RS2_FRAME_METADATA_SEQUENCE_SIZE , /**< sub-preset sequence size */
RS2_FRAME_METADATA_SEQUENCE_NAME , /**< sub-preset id */
RS2_FRAME_METADATA_SEQUENCE_ID , /**< sub-preset sequence id */
RS2_FRAME_METADATA_SEQUENCE_SIZE , /**< sub-preset sequence size */

//mipi metadata_values
RS2_FRAME_METADATA_TRIGGER,
RS2_FRAME_METADATA_PRESET,
RS2_FRAME_METADATA_INPUT_WIDTH,
RS2_FRAME_METADATA_INPUT_HEIGHT,
RS2_FRAME_METADATA_SUB_PRESET_INFO,
RS2_FRAME_METADATA_CRC,
RS2_FRAME_METADATA_TRIGGER , /**< Frame trigger type */
RS2_FRAME_METADATA_PRESET , /**< Preset id, used in MIPI SKU Metadata */
RS2_FRAME_METADATA_INPUT_WIDTH , /**< Frame input width in pixels, used as safety attribute */
RS2_FRAME_METADATA_INPUT_HEIGHT , /**< Frame input height in pixels, used as safety attribute */
RS2_FRAME_METADATA_SUB_PRESET_INFO , /**< Sub-preset information */
RS2_FRAME_METADATA_CALIB_INFO , /**< FW-controlled frame counter to be using in Calibration scenarios */
RS2_FRAME_METADATA_CRC , /**< CRC checksum of the Metadata */

RS2_FRAME_METADATA_COUNT
} rs2_frame_metadata_value;
Expand Down
1 change: 1 addition & 0 deletions src/ds5/advanced_mode/advanced_mode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ namespace librealsense
default_430(p);
break;
case ds::RS455_PID:
case ds::RS457_PID:
default_450_mid_low_res(p);
switch (res)
{
Expand Down
Loading

0 comments on commit d02beeb

Please sign in to comment.