Skip to content

Commit

Permalink
Added logs to auto calibration and small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
aangerma committed Dec 9, 2019
1 parent 02df9e6 commit d784d51
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 32 deletions.
22 changes: 11 additions & 11 deletions include/librealsense2/h/rs_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,8 @@ void rs2_enter_update_state(const rs2_device* device, rs2_error** error);
* \param[in] json_content Json string to configure speed on chip calibration parameters:
{
"speed": 3,
"scan_parameter": 0,
"data_sampling": 0
"scan parameter": 0,
"data sampling": 0
}
speed - value can be one of: Very fast = 0, Fast = 1, Medium = 2, Slow = 3, White wall = 4, default is Slow
scan_parameter - value can be one of: Py scan (default) = 0, Rx scan = 1
Expand All @@ -268,8 +268,8 @@ const rs2_raw_data_buffer* rs2_run_on_chip_calibration_cpp(rs2_device* device, c
* \param[in] json_content Json string to configure speed on chip calibration parameters:
{
"speed": 3,
"scan_parameter": 0,
"data_sampling": 0
"scan parameter": 0,
"data sampling": 0
}
speed - value can be one of: Very fast = 0, Fast = 1, Medium = 2, Slow = 3, White wall = 4, default is Slow
scan_parameter - value can be one of: Py scan (default) = 0, Rx scan = 1
Expand All @@ -291,11 +291,11 @@ const rs2_raw_data_buffer* rs2_run_on_chip_calibration(rs2_device* device, const
* \param[in] ground_truth_mm Ground truth in mm must be between 2500 - 2000000
* \param[in] json_content Json string to configure tare calibration parameters:
{
"average_step_count": 20,
"step_count": 20,
"average step count": 20,
"step count": 20,
"accuracy": 2,
"scan_parameter": 0,
"data_sampling": 0
"scan parameter": 0,
"data sampling": 0
}
average step count - number of frames to average, must be between 1 - 30, default = 20
step count - max iteration steps, must be between 5 - 30, default = 10
Expand All @@ -316,10 +316,10 @@ const rs2_raw_data_buffer* rs2_run_tare_calibration_cpp(rs2_device* dev, float g
* \param[in] json_content Json string to configure tare calibration parameters:
{
"average_step_count": 20,
"step_count": 20,
"step count": 20,
"accuracy": 2,
"scan_parameter": 0,
"data_sampling": 0
"scan parameter": 0,
"data sampling": 0
}
average step count - number of frames to average, must be between 1 - 30, default = 20
step count - max iteration steps, must be between 5 - 30, default = 10
Expand Down
28 changes: 14 additions & 14 deletions include/librealsense2/hpp/rs_device.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,8 @@ return results;
* \param[in] json_content Json string to configure speed on chip calibration parameters:
{
"speed": 3,
"scan_parameter": 0,
"data_sampling": 0
"scan parameter": 0,
"data sampling": 0
}
speed - value can be one of: Very fast = 0, Fast = 1, Medium = 2, Slow = 3, White wall = 4, default is Slow
scan_parameter - value can be one of: Py scan (default) = 0, Rx scan = 1
Expand Down Expand Up @@ -372,12 +372,12 @@ return results;
* \param[in] json_content Json string to configure speed on chip calibration parameters:
{
"speed": 3,
"scan_parameter": 0,
"data_sampling": 0
"scan parameter": 0,
"data sampling": 0
}
speed - value can be one of: Very fast = 0, Fast = 1, Medium = 2, Slow = 3, White wall = 4, default is Slow
scan_parameter - value can be one of: Py scan (default) = 0, Rx scan = 1
data_sampling - value can be one of:polling data sampling = 0, interrupt data sampling = 1
scan parameter - value can be one of: Py scan (default) = 0, Rx scan = 1
data sampling - value can be one of:polling data sampling = 0, interrupt data sampling = 1
if json is nullptr it will be ignored and calibration will use the default parameters
* \param[out] health Calibration Health-Check captures how far camera calibration is from the optimal one
[0, 0.25) - Good
Expand Down Expand Up @@ -410,11 +410,11 @@ return results;
* \param[in] ground_truth_mm Ground truth in mm must be between 2500 - 2000000
* \param[in] json_content Json string to configure tare calibration parameters:
{
"average_step_count": 20,
"step_count": 20,
"average step count": 20,
"step count": 20,
"accuracy": 2,
"scan_parameter": 0,
"data_sampling": 0
"scan parameter": 0,
"data sampling": 0
}
average step count - number of frames to average, must be between 1 - 30, default = 20
step count - max iteration steps, must be between 5 - 30, default = 10
Expand Down Expand Up @@ -453,11 +453,11 @@ return results;
* \param[in] ground_truth_mm Ground truth in mm must be between 2500 - 2000000
* \param[in] json_content Json string to configure tare calibration parameters:
{
"average_step_count": 20,
"step_count": 20,
"average step count": 20,
"step count": 20,
"accuracy": 2,
"scan_parameter": 0,
"data_sampling": 0
"scan parameter": 0,
"data sampling": 0
}
average step count - number of frames to average, must be between 1 - 30, default = 20
step count - max iteration steps, must be between 5 - 30, default = 10
Expand Down
17 changes: 10 additions & 7 deletions src/ds5/ds5-auto-calibration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ namespace librealsense
}
}

LOG_INFO("run_on_chip_calibration with parameters: speed = " << speed << " scan_parameter = " << scan_parameter << " data_sampling = " << data_sampling);

check_params(speed, scan_parameter, data_sampling);

param4 param{ (byte)scan_parameter, 0, (byte)data_sampling };
Expand All @@ -134,7 +136,7 @@ namespace librealsense
std::this_thread::sleep_for(std::chrono::milliseconds(200));

// Begin auto-calibration
_hw_monitor->send(command{ ds::AUTO_CALIB, auto_calib_begin, speed, 0, 0, param.param_4});
_hw_monitor->send(command{ ds::AUTO_CALIB, auto_calib_begin, speed, 0, param.param_4});

DirectSearchCalibrationResult result{};

Expand Down Expand Up @@ -209,28 +211,29 @@ namespace librealsense
{
speed = jsn["speed"];
}
if (jsn.find("average_step_count") != jsn.end())
if (jsn.find("average step count") != jsn.end())
{
average_step_count = jsn["average_step_count"];
average_step_count = jsn["average step count"];
}
if (jsn.find("step_count") != jsn.end())
if (jsn.find("step count") != jsn.end())
{
step_count = jsn["step_count"];
step_count = jsn["step count"];
}
if (jsn.find("accuracy") != jsn.end())
{
accuracy = jsn["accuracy"];
}
if (jsn.find("scan_parameter") != jsn.end())
if (jsn.find("scan parameter") != jsn.end())
{
scan_parameter = jsn["scan parameter"];
}
if (jsn.find("data_sampling") != jsn.end())
if (jsn.find("data sampling") != jsn.end())
{
data_sampling = jsn["data sampling"];
}
}

LOG_INFO("run_tare_calibration with parameters: speed = " << speed << " average_step_count = " << average_step_count << " step_count = " << step_count << " accuracy = " << accuracy << " scan_parameter = " << scan_parameter << " data_sampling = " << data_sampling);
check_tare_params(speed, scan_parameter, data_sampling, average_step_count, step_count, accuracy);

auto preset_recover = change_preset();
Expand Down

0 comments on commit d784d51

Please sign in to comment.