Added API for depth auto calibration. - #5346
Conversation
# Conflicts: # src/core/advanced_mode.h
| RS2_EXTENSION_UPDATE_DEVICE, | ||
| RS2_EXTENSION_L500_DEPTH_SENSOR, | ||
| RS2_EXTENSION_TM2_SENSOR, | ||
| RS2_EXTENSION_AUTO_CALIBRARED_DEVICE, |
| } | ||
|
|
||
| std::shared_ptr<ds5_advanced_mode_base> preset_recover; | ||
| if (_speed == 4) |
There was a problem hiding this comment.
Replace hard-coded values with enums
| // Begin auto-calibration | ||
| _hw_monitor->send(command{ ds::AUTO_CALIB, auto_calib_begin, _speed }); | ||
|
|
||
| DirectSearchCalibrationResult result; |
| * \param[in] callback callback to get progress notifications | ||
| * \return new calibration table | ||
| * \param[in] callback Callback to get progress notifications | ||
| * \return Nnew calibration table |
ev-mp
left a comment
There was a problem hiding this comment.
Maybe it is better for now to extract the refactoring and deal with it in a separate PR
| "${CMAKE_CURRENT_LIST_DIR}/advanced_mode/presets.cpp" | ||
| "${CMAKE_CURRENT_LIST_DIR}/advanced_mode/advanced_mode.cpp" | ||
| "${CMAKE_CURRENT_LIST_DIR}/ds5-auto-calibration.cpp" | ||
| "${CMAKE_CURRENT_LIST_DIR}/ds5-wide-fov.cpp" |
There was a problem hiding this comment.
Tabs
I strongly recommend to rename the class to ov9282_depth or similar - wide-fov descriptive and not unique given the other SKUs to consider. In addition it doesn't allow for scaling and reuse
| "${CMAKE_CURRENT_LIST_DIR}/ds5-fw-update-device.h" | ||
| "${CMAKE_CURRENT_LIST_DIR}/advanced_mode/json_loader.hpp" | ||
| "${CMAKE_CURRENT_LIST_DIR}/ds5-auto-calibration.h" | ||
| "${CMAKE_CURRENT_LIST_DIR}/ds5-wide-fov.h" |
| const int DEFAULT_AVERAGE_STEP_COUNT = 20; | ||
| const int DEFAULT_STEP_COUNT = 10; | ||
| const int DEFAULT_ACCURACY = 2; | ||
| const int DEFAULT_SPEED = 3; |
There was a problem hiding this comment.
= auto_calib_speed::speed_slow;
| const int DEFUALT_SPEED = 3; | ||
| const int DEFAULT_AVERAGE_STEP_COUNT = 20; | ||
| const int DEFAULT_STEP_COUNT = 10; | ||
| const int DEFAULT_ACCURACY = 2; |
There was a problem hiding this comment.
= subpixel_accuracy::speed_medium;
| auto usb_spec = get_usb_spec(); | ||
| if (usb_spec >= platform::usb3_type || usb_spec == platform::usb_undefined) | ||
| { | ||
| tags.push_back({ RS2_STREAM_COLOR, -1, 640, 480, RS2_FORMAT_RGB8, 30, profile_tag::PROFILE_TAG_SUPERSET | profile_tag::PROFILE_TAG_DEFAULT }); |
There was a problem hiding this comment.
Why should we reduce 720P to VGA for USB3?
| } | ||
| return tags; | ||
| }; | ||
| } No newline at end of file |
| { | ||
| std::vector<tagged_profile> tags; | ||
| auto usb_spec = get_usb_spec(); | ||
| if (usb_spec >= platform::usb3_type || usb_spec == platform::usb_undefined) |
There was a problem hiding this comment.
You also can use the ds5-factory.cpp method for maintainability and clearness:
bool usb3mode = (usb_spec >= platform::usb3_type || usb_spec == platform::usb_undefined);
uint32_t width = usb3mode ? 1280 : 640;
uint32_t height = usb3mode ? 720 : 480;
uint32_t fps = usb3mode ? 30 : 15;
tags.push_back({ RS2_STREAM_COLOR, -1, width, height, RS2_FORMAT_RGB8, fps,...| @@ -0,0 +1,21 @@ | |||
| #include "ds5-wide-fov.h" | |||
… more small fixes
Added auto_calibrated_device extension for on-chip (plane fit RMS) and tare calibration (absolute distance).
Use this API in viewer and added example on python for auto calibration.
Fixed viewer to put the default resolution on top and fixed default resolution in RS435.