Skip to content

Added API for depth auto calibration. - #5346

Merged
ev-mp merged 5 commits into
realsenseai:developmentfrom
aangerma:development
Dec 2, 2019
Merged

Added API for depth auto calibration.#5346
ev-mp merged 5 commits into
realsenseai:developmentfrom
aangerma:development

Conversation

@aangerma

Copy link
Copy Markdown
Contributor

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.

aangerma and others added 2 commits November 28, 2019 17:42
Comment thread include/librealsense2/h/rs_types.h Outdated
RS2_EXTENSION_UPDATE_DEVICE,
RS2_EXTENSION_L500_DEPTH_SENSOR,
RS2_EXTENSION_TM2_SENSOR,
RS2_EXTENSION_AUTO_CALIBRARED_DEVICE,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calibrated

Comment thread src/ds5/ds5-auto-calibration.cpp Outdated
}

std::shared_ptr<ds5_advanced_mode_base> preset_recover;
if (_speed == 4)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace hard-coded values with enums

Comment thread src/ds5/ds5-auto-calibration.cpp Outdated
// Begin auto-calibration
_hw_monitor->send(command{ ds::AUTO_CALIB, auto_calib_begin, _speed });

DirectSearchCalibrationResult result;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be simplified with {}

Comment thread src/ds5/ds5-auto-calibration.cpp
Comment thread src/ds5/ds5-auto-calibration.cpp
Comment thread src/rs.cpp
Comment thread wrappers/python/examples/auto_calibration_config.json
Comment thread wrappers/python/pyrs_device.cpp Outdated
Comment thread wrappers/python/pyrs_device.cpp Outdated
Comment thread wrappers/python/pyrs_device.cpp Outdated

@ev-mp ev-mp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add Jira reference

Comment thread src/ds5/ds5-auto-calibration.h Outdated
Comment thread src/ds5/ds5-auto-calibration.h Outdated
Comment thread src/ds5/ds5-auto-calibration.h Outdated
Comment thread include/librealsense2/h/rs_device.h Outdated
* \param[in] callback callback to get progress notifications
* \return new calibration table
* \param[in] callback Callback to get progress notifications
* \return Nnew calibration table

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nnew

Comment thread include/librealsense2/hpp/rs_device.hpp Outdated
Comment thread include/librealsense2/hpp/rs_device.hpp Outdated

@ev-mp ev-mp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it is better for now to extract the refactoring and deal with it in a separate PR

Comment thread src/ds5/CMakeLists.txt Outdated
"${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"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread src/ds5/CMakeLists.txt Outdated
"${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"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tabs + rename

Comment thread src/ds5/ds5-auto-calibration.h Outdated
const int DEFAULT_AVERAGE_STEP_COUNT = 20;
const int DEFAULT_STEP_COUNT = 10;
const int DEFAULT_ACCURACY = 2;
const int DEFAULT_SPEED = 3;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

= auto_calib_speed::speed_slow;

Comment thread src/ds5/ds5-auto-calibration.h Outdated
const int DEFUALT_SPEED = 3;
const int DEFAULT_AVERAGE_STEP_COUNT = 20;
const int DEFAULT_STEP_COUNT = 10;
const int DEFAULT_ACCURACY = 2;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

= subpixel_accuracy::speed_medium;

Comment thread src/ds5/ds5-auto-calibration.h
Comment thread src/ds5/ds5-color.cpp Outdated
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 });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why should we reduce 720P to VGA for USB3?

Comment thread src/ds5/ds5-wide-fov.cpp Outdated
}
return tags;
};
} No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EOF is missing

Comment thread src/ds5/ds5-wide-fov.cpp Outdated
{
std::vector<tagged_profile> tags;
auto usb_spec = get_usb_spec();
if (usb_spec >= platform::usb3_type || usb_spec == platform::usb_undefined)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,...

Comment thread src/ds5/ds5-wide-fov.cpp Outdated
@@ -0,0 +1,21 @@
#include "ds5-wide-fov.h"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing copyright

@ev-mp ev-mp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with the reservation for wrappers.
Remove ds5-wide-fov class and files

@ev-mp
ev-mp merged commit 93780b6 into realsenseai:development Dec 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants